Exemple #1
0
 /**
  * Toggle wether the app is under construction
  *
  * @param array $args Accept "false", "0", 0, and false as disablers.
  * @return bool
  */
 public function setUnderConstruction(array $args = array())
 {
     $enabled = empty($args) ? true : !in_array(current($args), array(0, false, 'false', '0'));
     Garp_Cli::lineOut(Zend_Registry::get('config')->app->name . ' is' . ($enabled ? '' : ' no longer') . ' under construction');
     return Garp_Application::setUnderConstruction($enabled);
 }
Exemple #2
0
 /**
  * Restore a gumball. Assumption: this is run after a gumball is uploaded and extracted to the
  * webroot.
  *
  * @return void
  */
 public function restore()
 {
     // if database, import database
     if ($this->_hasDatabaseDump()) {
         $this->restoreDatabase();
     } else {
         // Execute a spawn call in batch mode, to make sure all new columns are there
         $spawnCmd = new Garp_Cli_Command_Spawn();
         $spawnCmd->main(array('b' => true, 'only' => 'db'));
     }
     // set permissions on folders
     $this->setWritePermissions();
     // create snippets
     $this->createSnippets();
     // disable under construction
     Garp_Application::setUnderConstruction(false);
 }