Esempio n. 1
0
 * //TODO resync of single folders of a users device
 */
/************************************************
 * MAIN
 */
define('BASE_PATH_CLI', dirname(__FILE__) . "/");
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
try {
    ZPush::CheckConfig();
    ZLog::Initialize();
    ZPushAdminCLI::CheckEnv();
    ZPushAdminCLI::CheckOptions();
    if (!ZPushAdminCLI::SureWhatToDo()) {
        // show error message if available
        if (ZPushAdminCLI::GetErrorMessage()) {
            echo "ERROR: " . ZPushAdminCLI::GetErrorMessage() . "\n";
        }
        echo ZPushAdminCLI::UsageInstructions();
        exit(1);
    }
    ZPushAdminCLI::RunCommand();
} catch (ZPushException $zpe) {
    die(get_class($zpe) . ": " . $zpe->getMessage() . "\n");
}
/************************************************
 * Z-Push-Admin CLI
 */
class ZPushAdminCLI
{
    const COMMAND_SHOWALLDEVICES = 1;
    const COMMAND_SHOWDEVICESOFUSER = 2;
Esempio n. 2
0
/**
 * //TODO resync of single folders of a users device
 */
/************************************************
 * MAIN
 */
define('BASE_PATH_CLI', dirname(__FILE__) . "/");
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
try {
    ZPush::CheckConfig();
    ZPushAdminCLI::CheckEnv();
    ZPushAdminCLI::CheckOptions();
    if (!ZPushAdminCLI::SureWhatToDo()) {
        // show error message if available
        if (ZPushAdminCLI::GetErrorMessage()) {
            fwrite(STDERR, ZPushAdminCLI::GetErrorMessage() . "\n");
        }
        echo ZPushAdminCLI::UsageInstructions();
        exit(1);
    }
    ZPushAdminCLI::RunCommand();
} catch (ZPushException $zpe) {
    fwrite(STDERR, get_class($zpe) . ": " . $zpe->getMessage() . "\n");
    exit(1);
}
/************************************************
 * Z-Push-Admin CLI
 */
class ZPushAdminCLI
{
    const COMMAND_SHOWALLDEVICES = 1;