/**
  * @see sfTask
  */
 protected function execute($arguments = array(), $options = array())
 {
     $plugins = sfSympalPluginToolkit::getAvailablePlugins();
     $api = new sfSympalPluginApi();
     if ($api->getUsername() && $api->getPassword()) {
         foreach ($plugins as $plugin) {
             $result = $api->put('plugins/' . $plugin . '/users.xml');
             if ($result['status'] == 1) {
                 $this->logSection('sympal', 'Reported use of "' . $plugin . '"...');
             }
         }
     } else {
         throw new sfException('You must specify a username and password for the Symfony plugins api in your Sympal configuration.');
     }
 }
Exemplo n.º 2
0
 protected function _loadFromSymfonyPlugins()
 {
     $api = new sfSympalPluginApi();
     if ($api->getUsername() && $api->getPassword()) {
         $plugins = $api->get('categories/Sympal.xml');
         if (isset($plugins['plugins']['plugin'])) {
             foreach ($plugins['plugins']['plugin'] as $plugin) {
                 if ($plugin['id'] == $this->_name) {
                     $this->_plugin = $plugin;
                     $this->_plugin['name'] = $plugin['id'];
                     break;
                 }
             }
         }
     }
 }