当前位置: 首页>>代码示例>>PHP>>正文


PHP displayHelp函数代码示例

本文整理汇总了PHP中displayHelp函数的典型用法代码示例。如果您正苦于以下问题:PHP displayHelp函数的具体用法?PHP displayHelp怎么用?PHP displayHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了displayHelp函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

function remove($argv)
{
    if (!isset($argv[2])) {
        displayHelp();
        exit;
    }
    $name = $argv[2];
    exec('pwd', $info);
    $curPath = $info[0];
    $parentPath = dirname($curPath);
    $projectPath = $parentPath . '/project/' . $name;
    out("确定删除{$name}项目(y/n)", 'info');
    $line = trim(fgets(STDIN));
    if ($line === 'y') {
        if (file_exists($projectPath)) {
            exec("rm -rf {$projectPath}", $info, $ret);
            if (!$ret) {
                out('删除成功', 'success');
            } else {
                out('删除失败', 'error');
            }
        } else {
            out("{$name}不存在", 'error');
        }
    }
}
开发者ID:chenyongze,项目名称:m3d,代码行数:26,代码来源:m3d.php

示例2: process

/**
 * processes the installer
 */
function process($argv)
{
    // Determine ANSI output from --ansi and --no-ansi flags
    setUseAnsi($argv);
    if (in_array('--help', $argv)) {
        displayHelp();
        exit(0);
    }
    $check = in_array('--check', $argv);
    $help = in_array('--help', $argv);
    $force = in_array('--force', $argv);
    $quiet = in_array('--quiet', $argv);
    $channel = in_array('--snapshot', $argv) ? 'snapshot' : (in_array('--preview', $argv) ? 'preview' : 'stable');
    $disableTls = in_array('--disable-tls', $argv);
    $installDir = getOptValue('--install-dir', $argv, false);
    $version = getOptValue('--version', $argv, false);
    $filename = getOptValue('--filename', $argv, 'composer.phar');
    $cafile = getOptValue('--cafile', $argv, false);
    if (!checkParams($installDir, $version, $cafile)) {
        exit(1);
    }
    $ok = checkPlatform($quiet, $disableTls);
    if (true === $disableTls) {
        out("You have instructed the Installer not to enforce SSL/TLS security on remote HTTPS requests.", 'info');
        out("This will leave all downloads during installation vulnerable to Man-In-The-Middle (MITM) attacks.", 'info');
    }
    if ($check) {
        exit($ok ? 0 : 1);
    }
    if ($ok || $force) {
        installComposer($version, $installDir, $filename, $quiet, $disableTls, $cafile, $channel);
        exit(0);
    }
    exit(1);
}
开发者ID:alexburrows,项目名称:cream-2.x,代码行数:38,代码来源:composer-setup.php

示例3: process

/**
 * processes the installer
 */
function process($argv)
{
    // Determine ANSI output from --ansi and --no-ansi flags
    setUseAnsi($argv);
    if (in_array('--help', $argv)) {
        displayHelp();
        exit(0);
    }
    $check = in_array('--check', $argv);
    $help = in_array('--help', $argv);
    $force = in_array('--force', $argv);
    $quiet = in_array('--quiet', $argv);
    $channel = in_array('--snapshot', $argv) ? 'snapshot' : (in_array('--preview', $argv) ? 'preview' : 'stable');
    $disableTls = in_array('--disable-tls', $argv);
    $installDir = getOptValue('--install-dir', $argv, false);
    $version = getOptValue('--version', $argv, false);
    $filename = getOptValue('--filename', $argv, 'composer.phar');
    $cafile = getOptValue('--cafile', $argv, false);
    if (!checkParams($installDir, $version, $cafile)) {
        exit(1);
    }
    $ok = checkPlatform($warnings, $quiet, $disableTls);
    if ($check) {
        // Only show warnings if we haven't output any errors
        if ($ok) {
            showWarnings($warnings);
            showSecurityWarning($disableTls);
        }
        exit($ok ? 0 : 1);
    }
    if ($ok || $force) {
        installComposer($version, $installDir, $filename, $quiet, $disableTls, $cafile, $channel);
        showWarnings($warnings);
        showSecurityWarning($disableTls);
        exit(0);
    }
    exit(1);
}
开发者ID:hisambahaa,项目名称:DARES,代码行数:41,代码来源:composer-setup.php

示例4: runCLIVersion

/**
 * Parse command line arguments and execute appropriate function when
 * running from the command line.
 *
 * If no arguments are provided, usage information will be provided.
 *
 * @param array $argv The array of command line arguments provided by PHP.
 *          $argv[0] should be the current executable name or '-' if
 *          not available.
 * @param int $argc The size of $argv.
 */
function runCLIVersion($argv, $argc)
{
    if (isset($argc) && $argc >= 2) {
        # Prepare a server connection
        if ($argc >= 4) {
            try {
                $client = getClientLoginHttpClient($argv[2], $argv[3]);
                $docs = new Zend_Gdata_Docs($client);
            } catch (Zend_Gdata_App_AuthException $e) {
                echo "Error: Unable to authenticate. Please check your";
                echo " credentials.\n";
                exit(1);
            }
        }

        # Dispatch arguments to the desired method
        switch ($argv[1]) {
            case 'retrieveAllDocuments':
                if ($argc >= 4) {
                    retrieveAllDocuments($docs, false);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password>\n\n";
                    echo "This lists all of the documents in the user's";
                    echo " account.\n";
                }
                break;
            case 'retrieveWPDocs':
                if ($argc >= 4) {
                    //echo "!WP Docs:";
                    //var_dump($docs);
                    retrieveWPDocs($docs, false);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password>\n\n";
                    echo "This lists all of the word processing documents in";
                    echo " the user's account.\n";
                }
                break;
            case 'retrieveSpreadsheets':
                if ($argc >= 4) {
                    retrieveAllDocuments($docs, false);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password>\n\n";
                    echo "This lists all of the spreadsheets in the user's";
                    echo " account.\n";
                }
                break;
            case 'fullTextSearch':
                if ($argc >= 4) {
                    // Combine all of the query args into one query string. 
                    // The command line split the query string on space 
                    // characters.
                    $queryString = implode(' ', array_slice($argv, 4));
                    fullTextSearch($docs, false, $queryString);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password> <query string>\n\n";
                    echo "This lists all of the documents which contain the";
                    echo " query string.\n";
                }
                break;
            case 'uploadDocument':
                if ($argc >= 5) {
                    // Pass in the file name of the document to be uploaded. 
                    // Since the document is on this machine, we  do not need
                    // to set the temporary file name. The temp file name is
                    // used only when uploading to a webserver.
                    uploadDocument($docs, false, $argv[4], null);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password> <file_with_path>\n\n";
                    echo "This lists all of the documents which contain the";
                    echo " query string.\n";
                    echo "\nExample: php {$argv[0]} {$argv[1]} <username>";
                    echo " <password> /tmp/testSpreadsheet.ods\n";
                }
                break;
            default:
                // Invalid action entered
                displayHelp($argv[0]);
        // End switch block
        }
    } else {
        // action left unspecified
        displayHelp($argv[0]);
    }
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:100,代码来源:Docs.php

示例5: process

function process($argv)
{
    $check = in_array('--check', $argv);
    $help = in_array('--help', $argv);
    $force = in_array('--force', $argv);
    $quiet = in_array('--quiet', $argv);
    $disableTls = in_array('--disable-tls', $argv);
    $installDir = FALSE;
    $version = FALSE;
    $filename = 'slicer.phar';
    $cafile = FALSE;
    // --no-ansi wins over --ansi
    if (in_array('--no-ansi', $argv)) {
        define('USE_ANSI', FALSE);
    } elseif (in_array('--ansi', $argv)) {
        define('USE_ANSI', TRUE);
    } else {
        // On Windows, default to no ANSI, except in ANSICON and ConEmu.
        // Everywhere else, default to ANSI if stdout is a terminal.
        define('USE_ANSI', DIRECTORY_SEPARATOR == '\\' ? FALSE !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') : function_exists('posix_isatty') && posix_isatty(1));
    }
    foreach ($argv as $key => $val) {
        if (0 === strpos($val, '--install-dir')) {
            if (13 === strlen($val) && isset($argv[$key + 1])) {
                $installDir = trim($argv[$key + 1]);
            } else {
                $installDir = trim(substr($val, 14));
            }
        }
        if (0 === strpos($val, '--version')) {
            if (9 === strlen($val) && isset($argv[$key + 1])) {
                $version = trim($argv[$key + 1]);
            } else {
                $version = trim(substr($val, 10));
            }
        }
        if (0 === strpos($val, '--filename')) {
            if (10 === strlen($val) && isset($argv[$key + 1])) {
                $filename = trim($argv[$key + 1]);
            } else {
                $filename = trim(substr($val, 11));
            }
        }
        if (0 === strpos($val, '--cafile')) {
            if (8 === strlen($val) && isset($argv[$key + 1])) {
                $cafile = trim($argv[$key + 1]);
            } else {
                $cafile = trim(substr($val, 9));
            }
        }
    }
    if ($help) {
        displayHelp();
        exit(0);
    }
    $ok = checkPlatform($quiet, $disableTls);
    if (FALSE !== $installDir && !is_dir($installDir)) {
        out("The defined install dir ({$installDir}) does not exist.", 'info');
        $ok = FALSE;
    }
    if (FALSE !== $version && 1 !== preg_match('/^\\d+\\.\\d+\\.\\d+(\\-(alpha|beta)\\d+)*$/', $version)) {
        out("The defined install version ({$version}) does not match release pattern.", 'info');
        $ok = FALSE;
    }
    if (FALSE !== $cafile && (!file_exists($cafile) || !is_readable($cafile))) {
        out("The defined Certificate Authority (CA) cert file ({$cafile}) does not exist or is not readable.", 'info');
        $ok = FALSE;
    }
    if (TRUE === $disableTls) {
        out("You have instructed the Installer not to enforce SSL/TLS security on remote HTTPS requests.", 'info');
        out("This will leave all downloads during installation vulnerable to Man-In-The-Middle (MITM) attacks.", 'info');
    }
    if ($check) {
        exit($ok ? 0 : 1);
    }
    if ($ok || $force) {
        installSlicer($version, $installDir, $filename, $quiet, $disableTls, $cafile);
        exit(0);
    }
    exit(1);
}
开发者ID:rawphp,项目名称:slicer,代码行数:81,代码来源:installer.php

示例6: runCLIVersion


//.........这里部分代码省略.........
            case 'retrieveNicknames':
                if ($argc == 6) {
                    retrieveNicknames($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<user's username>\n\n";
                    echo "Output all nicknames owned by a specific username.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "jdoe\n";
                }
                break;
            case 'retrieveAllNicknames':
                if ($argc == 5) {
                    retrieveAllNicknames($gapps, false);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "\n\n";
                    echo "Output all registered nicknames on the system.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "\n";
                }
                break;
            case 'deleteNickname':
                if ($argc == 6) {
                    deleteNickname($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<nickname>\n\n";
                    echo "Delete a specific nickname.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "johnny\n";
                }
                break;
            case 'createEmailList':
                if ($argc == 6) {
                    createEmailList($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<email list>\n\n";
                    echo "Create a new email list with the specified name.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "friends\n";
                }
                break;
            case 'retrieveEmailLists':
                if ($argc == 6) {
                    retrieveEmailLists($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<recipient>\n\n";
                    echo "Retrieve all email lists to which the specified " . "address is subscribed.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "johnny@somewhere.com.invalid\n";
                }
                break;
            case 'retrieveAllEmailLists':
                if ($argc == 5) {
                    retrieveAllEmailLists($gapps, false);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "\n\n";
                    echo "Retrieve a list of all email lists on the current " . "domain.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "\n";
                }
                break;
            case 'deleteEmailList':
                if ($argc == 6) {
                    deleteEmailList($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<email list>\n\n";
                    echo "Delete a specified email list.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "friends\n";
                }
                break;
            case 'addRecipientToEmailList':
                if ($argc == 7) {
                    addRecipientToEmailList($gapps, false, $argv[5], $argv[6]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<recipient> <email list>\n\n";
                    echo "Add a recipient to an existing email list.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "johnny@somewhere.com.invalid friends\n";
                }
                break;
            case 'retrieveAllRecipients':
                if ($argc == 6) {
                    retrieveAllRecipients($gapps, false, $argv[5]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<email list>\n\n";
                    echo "Retrieve all recipients for an existing email list.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "friends\n";
                }
                break;
            case 'removeRecipientFromEmailList':
                if ($argc == 7) {
                    removeRecipientFromEmailList($gapps, false, $argv[5], $argv[6]);
                } else {
                    echo "Usage: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "<recipient> <email list>\n\n";
                    echo "Remove an existing recipient from an email list.\n";
                    echo "EXAMPLE: php {$argv[0]} {$argv[1]} <username> <domain> <password> " . "johnny@somewhere.com.invalid friends\n";
                }
                break;
            default:
                // Invalid action entered
                displayHelp($argv[0]);
                // End switch block
        }
    } else {
        // action left unspecified
        displayHelp($argv[0]);
    }
}
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:101,代码来源:Gapps.php

示例7: exit

<?php

if (php_sapi_name() !== 'cli') {
    exit(1);
}
set_time_limit(0);
ini_set('display_errors', 1);
define('COMPOSER_FILE', 'composer.phar');
define('COMPOSER_SETUP_FILE', 'composer-setup.php');
setUseAnsi($argv);
$argv = is_array($argv) ? $argv : array();
$argv[1] = isset($argv[1]) ? $argv[1] : null;
$argv[2] = isset($argv[2]) ? $argv[2] : null;
if (in_array('--help', $argv) || empty($argv[1])) {
    displayHelp($argv);
    exit(0);
}
if (in_array('-v', $argv) || in_array('--version', $argv)) {
    require __DIR__ . '/src/Eccube/Common/Constant.php';
    echo 'EC-CUBE ' . Eccube\Common\Constant::VERSION . PHP_EOL;
    exit(0);
}
out('EC-CUBE3 installer use database driver of ', null, false);
$database_driver = 'pdo_sqlite';
switch ($argv[1]) {
    case 'mysql':
        $database_driver = 'pdo_mysql';
        break;
    case 'pgsql':
        $database_driver = 'pdo_pgsql';
        break;
开发者ID:ec-cube,项目名称:ec-cube,代码行数:31,代码来源:eccube_install.php

示例8: createController

/**
 * 
 * 
 * @param int $argc
 * @param array $argv
 * 
 * @return void
 * 
 * @throws \InvalidArgumentException
 * @throws \RuntimeException if this function is called in a script that is not run at the command line.
 */
function createController($argc, array $argv)
{
    //////////////////////////////////////////
    // START: Environment and Args Validation
    //////////////////////////////////////////
    if (!isPhpRunningInCliMode()) {
        $err_msg = '`' . __FUNCTION__ . '($argc, array $argv)` should only be called from within' . ' php scripts that should be run via the command line!!!' . PHP_EOL;
        throw new \RuntimeException($err_msg);
    }
    if (is_string($argc) && is_numeric($argc)) {
        $argc = (int) $argc;
    }
    if (!is_int($argc)) {
        $err_msg = 'The expected value for the first argument to ' . '`' . __FUNCTION__ . '($argc, array $argv)` should be an int.' . ' `' . ucfirst(gettype($argc)) . '` with the value below was supplied:' . PHP_EOL . var_export($argc, true) . PHP_EOL . PHP_EOL . 'Good bye!!!';
        throw new \InvalidArgumentException($err_msg);
    }
    if (count($argv) < 1) {
        $err_msg = 'The expected value for the second argument to ' . '`' . __FUNCTION__ . '($argc, array $argv)` should be an array with at least one element. Empty Array was supplied.' . 'This second argument is expected to be the $argv array passed by PHP to the script calling this function.';
        throw new \InvalidArgumentException($err_msg);
    }
    //////////////////////////////////////////
    // END: Environment and Args Validation
    //////////////////////////////////////////
    //////////////////////////////////
    ///START: COMMAND PROCESSING
    //////////////////////////////////
    $ds = DIRECTORY_SEPARATOR;
    if ($argc < 5 || in_array('--help', $argv) || in_array('-help', $argv) || in_array('-h', $argv) || in_array('-?', $argv)) {
        displayHelp(basename($argv[0]));
    } else {
        if ($argc === 5 && (in_array('--controller-name', $argv) || in_array('-c', $argv)) && (in_array('--path-to-src-folder', $argv) || in_array('-p', $argv)) || $argc >= 7 && (in_array('--controller-name', $argv) || in_array('-c', $argv)) && (in_array('--path-to-src-folder', $argv) || in_array('-p', $argv)) && (in_array('--extends-controller', $argv) || in_array('-e', $argv))) {
            $templates_dir = dirname(__DIR__) . $ds . 'templates' . $ds;
            $controller_name = getOptVal('--controller-name', $argv);
            if ($controller_name === false) {
                $controller_name = getOptVal('-c', $argv);
            }
            $studly_controller_name = \Slim3MvcTools\Functions\Str\dashesToStudly(\Slim3MvcTools\Functions\Str\underToStudly($controller_name));
            $dashed_controller_name = \Slim3MvcTools\Functions\Str\toDashes($controller_name);
            if (!isValidClassName($studly_controller_name)) {
                printError("Invalid controller class name `{$controller_name}` supplied. Goodbye!!");
                return;
            }
            $src_folder_path = getOptVal('--path-to-src-folder', $argv);
            if ($src_folder_path === false) {
                $src_folder_path = getOptVal('-p', $argv);
            }
            $src_folder_path = normalizeFolderPathForOs($src_folder_path);
            if (!file_exists($src_folder_path) || !is_dir($src_folder_path)) {
                printError("The src folder path `{$src_folder_path}` supplied is a non-existent directory. Goodbye!!");
                return;
            }
            ////////////////////////////////////////////////////////////////////////////
            $default_controller_2_extend = '\\Slim3MvcTools\\Controllers\\BaseController';
            $controller_2_extend = getOptVal('--extends-controller', $argv);
            if ($controller_2_extend === false) {
                $controller_2_extend = getOptVal('-e', $argv);
                if ($controller_2_extend !== false) {
                    if (!isValidExtendsClassName($controller_2_extend)) {
                        printError("Invalid controller class name `{$controller_2_extend}` for extension supplied. Goodbye!!");
                        return;
                    }
                } else {
                    //use default controller class to be extended
                    $controller_2_extend = $default_controller_2_extend;
                }
            } else {
                if (!isValidExtendsClassName($controller_2_extend)) {
                    printError("Invalid controller class name `{$controller_2_extend}` for extension supplied. Goodbye!!");
                    return;
                }
            }
            ////////////////////////////////////////////////////////////////////////////
            $namepace_declaration = '';
            //omit namespace declaration by default
            $namepace_4_controller = getOptVal('--namespace-4-controller', $argv);
            if ($namepace_4_controller === false) {
                $namepace_4_controller = getOptVal('-n', $argv);
                if ($namepace_4_controller !== false) {
                    if (!isValidNamespaceName($namepace_4_controller)) {
                        printError("Invalid namespace `{$namepace_4_controller}` supplied. Goodbye!!");
                        return;
                    }
                    //validation passed
                    $namepace_declaration = "namespace {$namepace_4_controller};";
                } else {
                    $namepace_4_controller = '';
                }
            } else {
                if (!isValidNamespaceName($namepace_4_controller)) {
//.........这里部分代码省略.........
开发者ID:rotexsoft,项目名称:slim3-skeleton-mvc-tools,代码行数:101,代码来源:cli-script-helper-functions.php

示例9: array

<?php

/**
* Create a phar
*
* @author Cal Evans <cal@calevans.com>
* @author John Douglass <john .douglass@oit.gatech.edu>
*/
$getOptLongArray = array("stub:");
$getOptParams = "s:p:v";
$options = getOpt($getOptParams, $getOptLongArray);
if (!isset($options['s'], $options['p'])) {
    echo "You did not specify either a path or a phar file name.\n";
    displayHelp();
    die(1);
}
/*
 * Set up our environment
 */
$sourceLocation = $options['s'];
$pharFile = $options['p'];
// At this point, we need to check to see if the file exists. If neither exist, throw exception.
if (isset($options['stub'])) {
    $stubFile = $options['stub'];
} else {
    $stubFile = 'stub.php';
}
if (!file_exists($sourceLocation)) {
    echo "ERROR: Source file location does not exist!\nCheck your source and try again.\n";
    displayhelp();
    die(1);
开发者ID:gossi,项目名称:webform,代码行数:31,代码来源:makephar.php

示例10: testThatDisplayHelpWorksAsExpected

    public function testThatDisplayHelpWorksAsExpected()
    {
        $output = $this->execFuncAndReturnBufferedOutput('displayHelp', ['create-controller.php']);
        $expected_substr = <<<INPUT
This is a script intended for creating a controller class and a default index view file in rotexsoft/slim3-skeleton-mvc-app derived projects.

Usage:
  php create-controller.php [options]

Example:
# either of the commands below will create a controller with the class named `FooBar` in `src/controllers/FooBar.php` (which by default extends `\\Slim3MvcTools\\Controllers\\BaseController`)  and a default view in `src/views/foo-bar/index.php`
    
    php create-controller.php -c foo-bar -p "/var/www/html/my-app/src"
    
    php create-controller.php --controller-name foo-bar --path-to-src-folder "/var/www/html/my-app/src"
  
# either of the commands below will create a controller with the class named `FooBar` in `src/controllers/FooBar.php` (which extends `\\SomeNameSpace\\Controller2Extend`) and a default view in `src/views/foo-bar/index.php`
  
    php create-controller.php -c foo-bar -p "/var/www/html/my-app/src" -e "\\SomeNameSpace\\Controller2Extend"
    
    php create-controller.php --controller-name foo-bar --path-to-src-folder "/var/www/html/my-app/src" --extends-controller "\\SomeNameSpace\\Controller2Extend"

Options:
  -h, -?, -help, --help         Display this help message
    
  -c, --controller-name         The name of the controller class you want to create. The name will be converted to Studly case eg. foo-bar will be changed to FooBar. This option REQUIRES at least the `-p` or `--path-to-src-folder` option to work.
  
  -e, --extends-controller      The name of the controller class (optionally including the name-space prefix) that you want your created controller to extend. `\\Slim3MvcTools\\Controllers\\BaseController` is the default value if this option is not specified. Unlike the value supplied for `--controller-name`, the value supplied for this option will not be converted to Studly case (make sure the value is the correct full class name). This option REQUIRES at least the `-c` (or `--controller-name`) and the `-p` (or `--path-to-src-folder`) options to work.
    
  -n, --namespace-4-controller  The name of the namespace the new controller will belong to. If omitted the namespace declaration will not be present in the new controller class. Unlike the value supplied for `--controller-name`, the value supplied for this option will not be converted to Studly case (make sure the value is a valid name for a php namespace). This option REQUIRES at least the `-c` (or `--controller-name`) and the `-p` (or `--path-to-src-folder`) options to work.
    
  -p, --path-to-src-folder      The absolute path to the `src` folder. Eg. `/var/www/html/my-app/src`. This option REQUIRES at least the `-c` (or `--controller-name`) option to work.
INPUT;
        $this->assertContains($expected_substr, $output);
        ///////////////////////////////////////////
        //Test \InvalidArgumentException messages
        ///////////////////////////////////////////
        $args = array('Integer' => 111, 'Double' => 111.1234, 'Boolean' => true, 'Array' => [], 'Object' => new stdclass(), 'NULL' => null, 'Resource' => tmpfile());
        $function_sig_in_err_msg = 'displayHelp($cur_script)';
        foreach ($args as $arg_type => $arg) {
            try {
                displayHelp($arg);
                $msg = '\\InvalidArgumentException should have been thrown in `' . __FILE__ . '`' . ' on line ' . (__LINE__ - 1);
                static::fail($msg);
            } catch (\InvalidArgumentException $e) {
                $msg_substr = "The expected value for the first argument to `{$function_sig_in_err_msg}`" . " should be a String value. `{$arg_type}` with the value below was supplied:";
                $this->assertContains($msg_substr, $e->getMessage());
            }
        }
        // test the callable type
        try {
            displayHelp(function () {
                echo 'blah';
            });
            $msg = '\\InvalidArgumentException should have been thrown in `' . __FILE__ . '`' . ' on line ' . (__LINE__ - 1);
            static::fail($msg);
        } catch (\InvalidArgumentException $e) {
            $msg_substr = "The expected value for the first argument to `{$function_sig_in_err_msg}`" . " should be a String value. `Object` with the value below was supplied:";
            $this->assertContains($msg_substr, $e->getMessage());
        }
    }
开发者ID:rotexsoft,项目名称:slim3-skeleton-mvc-tools,代码行数:61,代码来源:CliScriptHelperFunctionsTest.php

示例11: displayHelp

            $conductor->startLaravelApplication();
            $conductor->endWithSuccess();
            break;
        case "stop":
            $conductor->stopLaravelApplication();
            $conductor->endWithSuccess();
            break;
        case "services":
            $conductor->serviceControl($commands[2]);
            $conductor->endWithSuccess();
            break;
        default:
            displayHelp($conductor);
    }
} else {
    displayHelp($conductor);
}
/**
 * The 'help' screen text.
 */
function displayHelp($conductor)
{
    $conductor->writeln();
    $conductor->writeln('Usage: conductor [OPTION]');
    $conductor->writeln();
    $conductor->writeln('Options:');
    $conductor->writeln('  list              List all currently hosted applications');
    $conductor->writeln('  new {name}        Prepares and deploys a new application');
    $conductor->writeln('  destroy {name}    Removes an application from the server');
    $conductor->writeln('  update {name}     Upgrades an application via. Git');
    $conductor->writeln('  rollback {name}   Rolls back the most recent upgrade');
开发者ID:CodeWire,项目名称:conductor,代码行数:31,代码来源:conductor.php


注:本文中的displayHelp函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。