Ejemplo n.º 1
0
/**
 * setup_plugin_manager () - initialise the plugin infrastructure
 *
 */
function setup_plugin_manager()
{
    $pm =& plugin_manager_get_object();
    $pm->LoadPlugins();
    $pm->SetupHooks();
    return true;
}
Ejemplo n.º 2
0
                 // the apache group or user should have write perms in $sys_etc_path/plugins folder...
                 if (!$result) {
                     $feedback .= _('Success, config not deleted');
                 }
             }
         }
     }
 } else {
     $sql = "INSERT INTO plugins (plugin_name,plugin_desc) VALUES ('{$pluginname}','This is the {$pluginname} plugin')";
     $res = db_query($sql);
     if (!$res) {
         exit_error("SQL ERROR", db_error());
     } else {
         $feedback = sprintf(_('Plugin %1$s updated Successfully'), $pluginname);
         // Load the plugin and now get information from it.
         $pm = plugin_manager_get_object();
         $pm->LoadPlugin($pluginname);
         $plugin = $pm->GetPluginObject($pluginname);
         $installdir = $plugin->getInstallDir();
         // Create a symbolic links to plugins/<plugin>/www (if directory exists).
         if (is_dir($sys_plugins_path . '/' . $pluginname . '/www')) {
             // if the plugin has a www dir make a link to it
             // The apache group or user should have write perms the www/plugins folder...
             if (!is_link('../' . $installdir)) {
                 $code = symlink($sys_plugins_path . '/' . $pluginname . '/www', '../' . $installdir);
                 if (!$code) {
                     $feedback .= '<br />[' . '../' . $installdir . '->' . $sys_plugins_path . '/' . $pluginname . '/www]';
                     $feedback .= _('<br />Soft link to www couldn\'t be created. Check the write permissions for apache in gforge www/plugins dir or create the link manually.');
                 }
             }
         }