Exemple #1
0
 /**
  * Trigger install.
  */
 public function main()
 {
     if (!CakePlugin::loaded('Admin')) {
         $this->err('Admin plugin is not installed, aborting!');
         return;
     }
     $this->setSteps(array('Check Database Configuration' => 'checkDbConfig', 'Set Table Prefix' => 'checkTablePrefix', 'Set Users Table' => 'checkUsersTable', 'Check Table Status' => 'checkRequiredTables', 'Create Database Tables' => 'createTables', 'Finish Installation' => 'finish'))->setDbConfig(FORUM_DATABASE)->setTablePrefix(FORUM_PREFIX)->setRequiredTables(array('aros', 'acos', 'aros_acos'));
     $this->out('Plugin: Forum v' . Configure::read('Forum.version'));
     $this->out('Copyright: Miles Johnson, 2010-' . date('Y'));
     $this->out('Help: http://milesj.me/code/cakephp/forum');
     parent::main();
 }
Exemple #2
0
 /**
  * Add sub-commands.
  *
  * @return ConsoleOptionParser
  */
 public function getOptionParser()
 {
     $parser = parent::getOptionParser();
     $parser->addSubcommand('plugin', array('help' => 'Install ACOs for all plugin models', 'parser' => array('description' => 'This command will install ACO (access control objects) for every plugin model. This will allow for CRUD level access permissions for users.', 'arguments' => array('plugin' => array('help' => 'Plugin name', 'required' => true)))));
     $parser->addSubcommand('model', array('help' => 'Install ACOs for a single model', 'parser' => array('description' => 'This command will install ACO (access control objects) for the model. This will allow for CRUD level access permissions for users.', 'arguments' => array('model' => array('help' => 'Model name', 'required' => true)))));
     return $parser;
 }