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


PHP CLI::taskArg方法代码示例

本文整理汇总了PHP中CLI::taskArg方法的典型用法代码示例。如果您正苦于以下问题:PHP CLI::taskArg方法的具体用法?PHP CLI::taskArg怎么用?PHP CLI::taskArg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CLI的用法示例。


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

示例1: run_flush_cache

 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 *
 * @package workflow-engine-bin-tasks
 */
G::LoadSystem("g");

CLI::taskName('flush-cache');
CLI::taskDescription(<<<EOT
    Flush cache of all workspaces of a given workspace
EOT
);

CLI::taskArg('workspace', true, true);
CLI::taskRun('run_flush_cache');

function run_flush_cache($args, $opts)
{
    $rootDir = realpath(__DIR__."/../../../../");
    $app = new Maveriks\WebApplication();
    $app->setRootDir($rootDir);
    $loadConstants = false;
    $workspaces = get_workspaces_from_args($args);

    if (! defined("PATH_C")) {
        die("ERROR: seems processmaker is not properly installed (System constants are missing).".PHP_EOL);
    }

    CLI::logging("Flush ".pakeColor::colorize("system", "INFO")." cache ... ");
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:31,代码来源:cliFlushCache.php

示例2: rm_dir

 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 *
 * @author Alexandre Rosenfeld <alexandre@colosa.com>
 * @package workflow-engine-bin-tasks
 */
G::LoadClass("system");
G::LoadClass("wsTools");
G::LoadSystem("dbMaintenance");
G::LoadClass("cli");
CLI::taskName('upgrade');
CLI::taskDescription("Upgrade workspaces.\n\n This command should be run after upgrading ProcessMaker to a new version so that all workspaces are also upgraded to the\n  new version.");
CLI::taskOpt("buildACV", "If this option is enabled, the Cache View is built.", "ACV", "buildACV");
CLI::taskRun("run_upgrade");
/*----------------------------------********---------------------------------*/
CLI::taskArg('workspace');
/*----------------------------------********---------------------------------*/
/**
 * A version of rm_dir which does not exits on error.
 *
 * @param  string $filename directory or file to remove
 * @param  bool $filesOnly either to remove the containing directory as well or not
 */
function rm_dir($filename, $filesOnly = false)
{
    if (is_file($filename)) {
        @unlink($filename) or CLI::logging(CLI::error("Could not remove file {$filename}") . "\n");
    } else {
        foreach (glob("{$filename}/*") as $f) {
            rm_dir($f);
        }
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:cliUpgrade.php

示例3:

  This command populate the table "self-service by value", this for the cases when

  a task it's defined with "Self Service Value Based Assignment" in "Assignment Rules".



  If no workspace is specified, the command will be run in all workspaces. More

  than one workspace can be specified.

EOT

);

CLI::taskArg("workspace-name", true, true);

CLI::taskRun("run_database_generate_self_service_by_value");



/*----------------------------------********---------------------------------*/



  /**

   * Function run_info

   * access public
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:29,代码来源:cliWorkspaces.php

示例4: run_create

EOT
);
CLI::taskArg('plugin', false);
CLI::taskArg('lang', false);
CLI::taskRun("run_update");
CLI::taskName('plugins-translation-create');
CLI::taskDescription(<<<EOT
    Create .po file for the plugin

    LANG is the language, such as 'fr' (French) or 'zh-CN' (mainland Chinese).
  If the language is not specified, then it is 'en' (English) by default.

EOT
);
CLI::taskArg('plugin', true);
CLI::taskArg('lang', true);
CLI::taskRun("run_create");
function run_create($command, $args)
{
    CLI::logging("Create .po file ...\n");
    $language = new Language();
    $language->createLanguagePlugin($command[0], $command[1]);
    CLI::logging("Create successful\n");
}
function run_update($command, $args)
{
    CLI::logging("Updating...\n");
    $language = new Language();
    $language->updateLanguagePlugin($command[0], $command[1]);
    CLI::logging("Update successful\n");
}
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:cliPlugins.php


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