示例#1
0
 * 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 ... ");
示例#2
0
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 *
 * @author Alexandre Rosenfeld <*****@*****.**>
 * @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);
        }
示例#3
0
  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
示例#4
0
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");
}