Exemplo n.º 1
0
 /**
  * Default run method
  * TODO: Needs more work
  * @return	void
  */
 public function run()
 {
     $this->printMessage('Generating code event listener...');
     $config = XDT_CLI_Application::getConfig();
     $namespace = $config['namespace'] . '_';
     $className = $namespace . 'Listener';
     if (!$namespace) {
         $namespace = '';
     }
     if (!XDT_CLI_Helper::classExists($className, false)) {
         //$extendName = 'XenForo_Controller' . XfCli_Helpers::camelcaseString($type, false) . '_Abstract';
         $class = new Zend_CodeGenerator_Php_Class();
         $class->setName($className);
         //$class->setExtendedClass($extendName);
         XDT_CLI_ClassGenerator::create($className, $class);
         $this->printMessage('ok');
     } else {
         $this->printMessage('skipped (already exists)');
     }
     $this->printMessage($namespace);
     if (!empty($config['name'])) {
         $this->printMessage($this->colorText('Active Add-on: ', XDT_CLI_Abstract::BROWN), false);
         $this->printMessage($config['name']);
     } else {
         $this->printMessage($this->colorText('No add-on selected.', XDT_CLI_Abstract::RED));
     }
 }
Exemplo n.º 2
0
 /**
  * Default run method
  *
  * @return	void
  */
 public function run()
 {
     $config = XDT_CLI_Application::getConfig();
     if (!empty($config['name'])) {
         $this->printMessage($this->colorText('Active Add-on: ', XDT_CLI_Abstract::BROWN), false);
         $this->printMessage($config['name']);
     } else {
         $this->printMessage($this->colorText('No add-on selected.', XDT_CLI_Abstract::RED));
     }
 }
Exemplo n.º 3
0
 public static function writeToFile($file, $contents, $createPath = false)
 {
     $config = XDT_CLI_Application::getConfig();
     $filePath = dirname($file);
     if (!is_dir($filePath) and $createPath) {
         mkdir($filePath, octdec($config->dir_mask), true);
     }
     if (!is_dir($filePath) or !file_put_contents($file, trim($contents))) {
         XDT_CLI_Abstract::getInstance()->bail("File could not be created: " . $file);
         return false;
     }
     chmod($file, octdec($config['file_mask']));
     return true;
 }
Exemplo n.º 4
0
 public function run()
 {
     $addOnId = $this->getOption('addon-id');
     $config = XDT_CLI_Application::getConfig();
     if (!$addOnId) {
         if (!$config or empty($config['addon_id'])) {
             $this->bail('There is no addon selected and the --addon-id is not set');
         }
         $addOnId = $config['addon_id'];
     }
     $dw = XenForo_DataWriter::create('XenForo_DataWriter_AddOn');
     $dw->setExistingData($addOnId);
     $dw->set('active', 0);
     $dw->save();
     $this->printInfo($this->colorText($addOnId . ' was disabled successfully.', self::LIGHT_GREEN));
 }
Exemplo n.º 5
0
 public function run()
 {
     $config = XDT_CLI_Application::getConfig();
     $this->printMessage($this->colorText('Active Add-on: ', XDT_CLI_Abstract::BROWN), false);
     // TODO: Not yet finished...
 }