本文整理匯總了PHP中CLI::taskName方法的典型用法代碼示例。如果您正苦於以下問題:PHP CLI::taskName方法的具體用法?PHP CLI::taskName怎麽用?PHP CLI::taskName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CLI
的用法示例。
在下文中一共展示了CLI::taskName方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run_flush_cache
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* 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);
示例2: minify_javascript
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* 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.
*
* @author Alexandre Rosenfeld <alexandre@colosa.com>
* @package workflow-engine-bin-tasks
*/
CLI::taskName('build-js');
CLI::taskDescription(<<<EOT
Generate Javascript Files
This command should be run after any modification of javascript files in
folder gulliver/js/*.
EOT
);
//CLI::taskOpt("minify", "If the option is enabled, performs the build only with minified files", "min", "buildmin");
CLI::taskRun("minify_javascript");
function minify_javascript($command, $args)
{
CLI::logging("BUILD-JS\n");
//disabling the rakefile version, until we have updated the dev environment
//CLI::logging("Checking if rake is installed...\n");
示例3: run_create_translation
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* 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::LoadClass("system");
G::LoadClass("wsTools");
CLI::taskName('mafe-translation');
CLI::taskDescription(<<<EOT
Creates labels of mafe for the database
If no workspace is specified, then the translation labels will be created in all available workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "Specify the language to create the translation labels. If not specified then the language will be 'en' (English) by default.\n Ex: -lfr (French)\n Ex: --lang=zh-CN (Mainland Chinese)", "lLANG", "lang=LANG");
CLI::taskRun('run_create_translation');
function run_create_translation($args, $opts)
{
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
示例4:
EOT
);
//CLI::taskArg('workspace', true);
CLI::taskOpt("workspace", "Select which workspace to migrate the cases folders, if multiple workspaces are present in the server.",
"w:", "workspace=");
CLI::taskRun("runStructureDirectories");
CLI::taskName("database-generate-self-service-by-value");
CLI::taskDescription(<<<EOT
Generate or upgrade the table "self-service by value".
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
示例5: workspace
CLI::taskRun(run_workspace_upgrade);
CLI::taskName('translation-repair');
CLI::taskDescription(<<<EOT
Upgrade or repair translations for the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
This command will go through each language installed in ProcessMaker and
update this workspace translations to match the current version of
ProcessMaker.
EOT
);
CLI::taskArg('workspace-name', true, true);
CLI::taskRun(run_translation_upgrade);
CLI::taskName('migrate-cases-folders');
CLI::taskDescription(<<<EOT
Migrating cases folders of the workspaces
Specify the WORKSPACE to migrate from a existing workspace.
EOT
);
//CLI::taskArg('workspace', true);
CLI::taskOpt("workspace", "Select which workspace to migrate the cases folders, if multiple workspaces are present in the server.", "w:", "workspace=");
CLI::taskRun(runStructureDirectories);
/**
* Function run_info
* access public
*/
function run_info($args, $opts)
{
示例6: workspace
Upgrade the workspace(s) specified.
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
This command is a shortcut to execute all upgrade commands for workspaces.
Upgrading a workspace will make it correspond to the current version of
ProcessMaker.
Use this command to upgrade workspaces individually, otherwise use the
upgrade command to upgrade the entire system.
EOT
);
CLI::taskArg('workspace-name', true, true);
CLI::taskRun(run_workspace_upgrade);
CLI::taskName('translation-repair');
CLI::taskDescription(<<<EOT
Upgrade or repair translations for the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces. More
than one workspace can be specified.
This command will go through each language installed in ProcessMaker and
update this workspace translations to match the current version of
ProcessMaker.
EOT
);
CLI::taskArg('workspace-name', true, true);
CLI::taskRun(run_translation_upgrade);
/**
* Function run_info
示例7: runHotfixInstall
<?php
CLI::taskName("hotfix-install");
CLI::taskDescription(<<<EOT
Install hotfix to system
This command installs a hotfix, which updates ProcessMaker in order to add improvements or fix bugs.
EOT
);
CLI::taskRun("runHotfixInstall");
function runHotfixInstall($command, $args)
{
CLI::logging("HOTFIX", PATH_DATA . "log" . PATH_SEP . "upgrades.log");
CLI::logging("Install hotfix to system\n");
$arrayFile = $command;
if (count($arrayFile) > 0) {
//Install hotfix
foreach ($arrayFile as $value) {
$f = $value;
$result = workspaceTools::hotfixInstall($f);
CLI::logging($result["message"] . "\n");
}
//Clear server's cache
CLI::logging("\nClearing cache...\n");
if (defined("PATH_C")) {
G::rm_dir(PATH_C);
G::mk_dir(PATH_C, 0777);
}
//Safe upgrade for JavaScript files
CLI::logging("\nSafe upgrade for files cached by the browser\n\n");
G::browserCacheFilesSetUid();
示例8: run
/**
* Run the CLI task, which will check which command is specified and run it.
*/
public static function run()
{
CLI::taskName("help");
CLI::taskRun(array('self', 'help'));
global $argv;
$args = $argv;
$cliname = array_shift($args);
$taskName = array_shift($args);
while ($taskName[0] == '-') {
$taskName = array_shift($args);
}
if (!$taskName) {
echo self::error("Specify a task from the list below.") . "\n\n";
self::help(null, null);
return;
}
$taskData = null;
foreach (self::$tasks as $name => $data) {
if (strcasecmp($name, $taskName) === 0) {
$taskData = $data;
break;
}
}
if (!$taskData) {
echo self::error("Command not found: '{$taskName}'") . "\n\n";
self::help(null, null);
return;
}
G::LoadThirdParty('pear/Console', 'Getopt');
$short = "h" . $taskData['opt']['short'];
$long = array_merge(array("help"), $taskData['opt']['long']);
$getopt = Console_GetOpt::getopt2($args, $short, $long);
if (!is_array($getopt)) {
echo self::error("Invalid options (" . $getopt->getMessage() . ")") . "\n\n";
self::help($taskName);
return;
}
list($options, $arguments) = $getopt;
foreach ($taskData['opt']['descriptions'] as $optName => $optDescription) {
$short = str_replace(":", "", $optDescription['short']);
$long = str_replace("=", "", $optDescription['long']);
$validOpts[$short] = $optName;
$validOpts[$long] = $optName;
}
$taskOpts = array();
try {
foreach ($options as $opt) {
list($optName, $optArg) = $opt;
if ($optName === "h" || $optName === "--help") {
self::help($taskName);
return;
}
if (strpos($optName, '--') === 0) {
$optName = substr($optName, 2);
}
if (!array_key_exists($optName, $validOpts)) {
throw new Exception("option not found: {$optName}");
}
if (array_key_exists($validOpts[$optName], $taskOpts)) {
throw new Exception("'{$optName}' specified more then once");
}
$taskOpts[$validOpts[$optName]] = $optArg;
}
} catch (Exception $e) {
echo self::error("Invalid options: " . $e->getMessage()) . "\n\n";
self::help($taskName);
return;
}
try {
call_user_func($taskData['function'], $arguments, $taskOpts);
} catch (Exception $e) {
echo self::error("\n Error executing '{$taskName}':\n\n {$e->getMessage()}\n") . "\n";
}
}
示例9: rm_dir
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* 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.
*
* @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)) {
示例10: run_create
*/
G::LoadClass("system");
G::LoadClass("wsTools");
CLI::taskName('plugins-translation-update');
CLI::taskDescription(<<<EOT
Update plugin translations
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', 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();
示例11: runBrowserCacheFiles
<?php
CLI::taskName("browser-cache-files-upgrade");
CLI::taskDescription(<<<EOT
Safe upgrade for files cached by the browser
This command should be run after any upgrade/modification of files cached by the browser.
EOT
);
CLI::taskRun(runBrowserCacheFiles);
function runBrowserCacheFiles($command, $args)
{
CLI::logging("Safe upgrade for files cached by the browser\n");
G::browserCacheFilesSetUid();
CLI::logging("Upgrade successful\n");
}