예제 #1
0
    define('PUBLIC_FOLDER', 'public');
}
require_once 'init.php';
if (!isset($argv) || !is_array($argv)) {
    die("There is no input arguments\n");
}
// if
$command = array_var($argv, 1);
$arg1 = array_var($argv, 2);
$usr = Contacts::findOne(array("conditions" => "user_type = (SELECT id FROM " . TABLE_PREFIX . "permission_groups WHERE name='Super Administrator')"));
$usr or die("Super Administrator user not found\n");
CompanyWebsite::instance()->logUserIn($usr);
$ctrl = new PluginController();
trim($command) or die("Command is required \n" . $usage);
if ($command == 'list') {
    foreach ($ctrl->index() as $plg) {
        /* @var $plg Plugin */
        echo "---------------------------------------------\n";
        echo "NAME: \t\t" . $plg->getSystemName() . "\n";
        echo "VERSION: \t" . $plg->getVersion() . "\n";
        echo "STATUS: \t" . ($plg->isInstalled() ? 'Installed ' : 'Uninstalled ') . ($plg->isActive() ? 'Activated ' : 'Inactive ') . "\n";
        if ($plg->updateAvailable()) {
            echo "*** There is a new version of this plugin *** \n";
        }
    }
} else {
    if ($command == 'update_all') {
        $ctrl->updateAll();
    } else {
        $arg1 or die("Plugin is required \n{$usage}");
        $plg = Plugins::instance()->findOne(array("conditions" => " name = '{$arg1}'"));
예제 #2
0
}
require_once 'init.php';
$success_message = "";
try {
    if (!isset($argv) || !is_array($argv)) {
        die("There is no input arguments\n");
    }
    // if
    $command = array_var($argv, 1);
    $arg1 = array_var($argv, 2);
    $usr = Contacts::findOne(array("conditions" => "user_type > 0", "order" => "user_type"));
    $usr or die("No users found\n");
    CompanyWebsite::instance()->logUserIn($usr);
    $ctrl = new PluginController();
    trim($command) or die("Command is required \n" . $usage);
    $plugins = $ctrl->index();
    if ($command == 'list') {
        foreach ($plugins as $plg) {
            /* @var $plg Plugin */
            echo "---------------------------------------------\n";
            echo "NAME: \t\t" . $plg->getSystemName() . "\n";
            echo "VERSION: \t" . $plg->getVersion() . "\n";
            echo "STATUS: \t" . ($plg->isInstalled() ? 'Installed ' : 'Uninstalled ') . ($plg->isActive() ? 'Activated ' : 'Inactive ') . "\n";
            if ($plg->updateAvailable()) {
                echo "*** There is a new version of this plugin *** \n";
            }
        }
    } else {
        if ($command == 'update_all') {
            $ctrl->updateAll();
        } else {