本文整理汇总了PHP中CLI::taskOpt方法的典型用法代码示例。如果您正苦于以下问题:PHP CLI::taskOpt方法的具体用法?PHP CLI::taskOpt怎么用?PHP CLI::taskOpt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLI
的用法示例。
在下文中一共展示了CLI::taskOpt方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run_create_translation
* 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);
$rootDir = realpath(__DIR__ . "/../../../../");
$app = new Maveriks\WebApplication();
$app->setRootDir($rootDir);
$loadConstants = false;
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$translation = new Translation();
CLI::logging("Updating labels Mafe ...\n");
示例2:
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");
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
示例3:
Restore a workspace from a backup.
BACKUP-FILE is the backup filename. If it contains slashes, it will be
treated as a path and filename, either absolute or relative. Otherwise, it
will be treated as a filename inside the 'shared/backups' directory.
Specify the WORKSPACE to restore to a different workspace name. Otherwise,
it will restore to the same workspace name as the original backup.
EOT
);
CLI::taskArg('backup-file', false);
CLI::taskArg('workspace', true);
CLI::taskOpt("overwrite", "If a workspace already exists, overwrite it.", "o", "overwrite");
CLI::taskOpt("info", "Only shows information about a backup archive.", "i");
CLI::taskOpt("multiple", "Restore from multiple compresed enumerated files.", "m");
CLI::taskOpt("workspace", "Select which workspace to restore if multiple workspaces are present in the archive.", "w:", "workspace=");
CLI::taskRun(run_workspace_restore);
CLI::taskName('cacheview-repair');
CLI::taskDescription(<<<EOT
Create and populate the APP_CACHE_VIEW table
Specify the workspaces whose cases cache should be repaired. If no workspace
is specified, then the cases will be repaired on all available workspaces.
In order to improve the performance, ProcessMaker includes a cache of cases
in the table APP_CACHE_VIEW. This table must be in sync with the database
to present the correct information in the cases inbox. This command will
create the table and populate it with the right information. This only needs
to be used after upgrading ProcessMaker or if the cases inbox is out of sync.
EOT
);
示例4: run_create_translation
*
* @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
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "languaje", "l:","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);
$rootDir = realpath(__DIR__."/../../../../");
$app = new Maveriks\WebApplication();
$app->setRootDir($rootDir);
$loadConstants = false;
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
示例5:
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 the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow",
"wWORKSPACE", "workspace=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 populates the table "self-service by value" for cases whose
示例6: rm_dir
* 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)) {
@unlink($filename) or CLI::logging(CLI::error("Could not remove file {$filename}") . "\n");
} else {
示例7:
CLI::taskName('cacheview-repair');
CLI::taskDescription(<<<EOT
Create and populate the APP_CACHE_VIEW table
Specify the workspaces whose cases cache should be repaired. If no workspace
is specified, then the cases will be repaired on all available workspaces.
In order to improve the performance, ProcessMaker includes a cache of cases
in the table APP_CACHE_VIEW. This table must be in sync with the database
to present the correct information in the cases inbox. This command will
create the table and populate it with the right information. This only needs
to be used after upgrading ProcessMaker or if the cases inbox is out of sync.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "You must specify language on which rebuild of the case cache list builder will be done; if you don't specify this, it will use 'en' by default", "l:", "lang=");
CLI::taskRun(run_cacheview_upgrade);
CLI::taskName('database-upgrade');
CLI::taskDescription(<<<EOT
Upgrade or repair the database schema to match the latest version
Specify the workspaces whose database schema should be upgraded or repaired.
If no workspace is specified, then the database schema will be upgraded or
repaired on all available workspaces.
This command will read the system schema and attempt to modify the workspaces
tables to match this new schema. Use this command to fix corrupted database
schemas or after ProcessMaker has been upgraded, so the database schemas will
changed to match the new ProcessMaker code.
EOT
);
示例8: minify_javascript
*
* 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
the gulliver/js/* directory.
EOT
);
CLI::taskOpt("lang", "", "lLANG", "lang=LANG");
//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");
//$rakeFile = PROCESSMAKER_PATH . "workflow/engine/bin/tasks/Rakefile";
//system('rake -f ' . $rakeFile);
require_once PATH_THIRDPARTY . 'jsmin/jsmin.php';
$libraries = json_decode(file_get_contents(PATH_HOME . 'engine/bin/tasks/libraries.json'));
//print_r($libraries);
foreach ($libraries as $k => $library) {
$build = $library->build;
if ($build) {
示例9: rm_dir
* 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");
CLI::taskName('upgrade');
CLI::taskDescription(<<<EOT
Upgrade workspaces.
This command should be run after ProcessMaker files are upgraded so that all
workspaces are upgraded to the current version.
EOT
);
CLI::taskOpt("buildACV", "If the option is enabled, performs the Build Cache View.", "ACV", "buildACV");
CLI::taskRun(run_upgrade);
/**
* 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);
}