protected function execute($arguments = array(), $options = array())
 {
     $plugin = $arguments['plugin'];
     // Validate the application name
     if (!preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/', $plugin)) {
         throw new sfCommandException(sprintf('The OpenPNE plugin name "%s" is invalid.', $plugin));
     }
     $opPluginDir = sfConfig::get('sf_plugins_dir') . '/' . $plugin;
     if (is_dir($opPluginDir)) {
         throw new sfCommandException(sprintf('The OpenPNE plugin "%s" already exists.', $opPluginDir));
     }
     // create basic opPlugin structure
     $finder = sfFinder::type('any')->discard('.sf');
     $this->getFilesystem()->mirror(dirname(__FILE__) . '/skeleton/opPlugin', $opPluginDir, $finder);
     $fixPerms = new openpnePermissionTask($this->dispatcher, $this->formatter);
     $fixPerms->setCommandApplication($this->commandApplication);
     @$fixPerms->run();
 }
 protected function fixPerms()
 {
     $permissions = new openpnePermissionTask($this->dispatcher, $this->formatter);
     $permissions->run();
 }
 protected function installPlugins()
 {
     $task = new sfCacheClearTask($this->dispatcher, $this->formatter);
     $task->run();
     $task = new openpnePermissionTask($this->dispatcher, $this->formatter);
     $task->run();
     $task = new opPluginSyncTask($this->dispatcher, $this->formatter);
     $task->run();
 }
 protected function installPlugins($target = null)
 {
     if ('OpenPNE' === $target) {
         return null;
     }
     $task = new sfCacheClearTask($this->dispatcher, $this->formatter);
     @$task->run();
     $task = new openpnePermissionTask($this->dispatcher, $this->formatter);
     @$task->run();
     $options = array();
     if ($target) {
         $options[] = '--target=' . $target;
     }
     $task = new opPluginSyncTask($this->dispatcher, $this->formatter);
     $task->run(array(), $options);
 }