Ejemplo n.º 1
0
 *
 * 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 <*****@*****.**>
 * @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");
    //$rakeFile = PROCESSMAKER_PATH . "workflow/engine/bin/tasks/Rakefile";
    //system('rake -f ' . $rakeFile);

    require_once (PATH_THIRDPARTY . 'jsmin/jsmin.php');
Ejemplo n.º 2
0
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

  than one workspace can be specified.

EOT

);

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

CLI::taskRun("run_database_generate_self_service_by_value");

Ejemplo n.º 3
0
 * 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);

    if (! defined("PATH_C")) {
        die("ERROR: seems processmaker is not properly installed (System constants are missing).".PHP_EOL);
Ejemplo n.º 4
0
 * 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 

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();
Ejemplo n.º 5
0
 * 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);
    $rootDir = realpath(__DIR__ . "/../../../../");
    $app = new Maveriks\WebApplication();
    $app->setRootDir($rootDir);
    $loadConstants = false;
Ejemplo n.º 6
0
  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)
{
    $workspaces = get_workspaces_from_args($args);
    workspaceTools::printSysInfo();
    foreach ($workspaces as $workspace) {
        echo "\n";
Ejemplo n.º 7
0
  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
 * access public
 */
function run_info($args, $opts)
{
    $workspaces = get_workspaces_from_args($args);
    workspaceTools::printSysInfo();
Ejemplo n.º 8
0
 * 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

    If no workspace is specified, then the cache will be flushed in all available workspaces.
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 ... ");
Ejemplo n.º 9
0
<?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();
Ejemplo n.º 10
0
<?php

CLI::taskName("hotfix-install");
CLI::taskDescription(<<<EOT
    Install hotfix to system

    This command is executed when you want to update certain files, which have improvements or bugs solutions.
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();
Ejemplo n.º 11
0
 *
 * 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 <*****@*****.**>
 * @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");
Ejemplo n.º 12
0
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();
    $language->createLanguagePlugin($command[0], $command[1]);
    CLI::logging("Create successful\n");
}
function run_update($command, $args)
{
Ejemplo n.º 13
0
 * 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 <*****@*****.**>
 * @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'));
Ejemplo n.º 14
0
 * 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 <*****@*****.**>
 * @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");
Ejemplo n.º 15
0
G::LoadClass("wsTools");

CLI::taskName('plugins-translation-update');
CLI::taskDescription(<<<EOT
    Update plugin translations

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

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");
Ejemplo n.º 16
0
<?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");
}