Merged in bugfix/HOR-3621-A (pull request #5855)
HOR-3621-A The following command works: Approved-by: David Callizaya <david.callizaya@processmaker.com> Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -69,6 +69,7 @@
|
|||||||
"thirdparty/pear",
|
"thirdparty/pear",
|
||||||
"thirdparty/html2ps_pdf",
|
"thirdparty/html2ps_pdf",
|
||||||
"thirdparty/phing",
|
"thirdparty/phing",
|
||||||
|
"thirdparty/pake",
|
||||||
"rbac/engine/classes/"
|
"rbac/engine/classes/"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
@@ -1,108 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* cli.php
|
|
||||||
* @package workflow-engine-bin
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2011 Colosa Inc.
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* 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>
|
|
||||||
*/
|
|
||||||
|
|
||||||
// /* Windows supports both / and \ as path separators, so use the Unix separator
|
require_once(__DIR__ . '/../../../bootstrap/autoload.php');
|
||||||
// * for maximum compatibility.
|
|
||||||
// */
|
|
||||||
// define('PATH_SEP', '/');
|
|
||||||
//
|
|
||||||
// define('PATH_HOME', WORKFLOW_PATH );
|
|
||||||
// define('PATH_TRUNK', PROCESSMAKER_PATH );
|
|
||||||
// define('PATH_OUTTRUNK', realpath(PROCESSMAKER_PATH.'/..') );
|
|
||||||
//
|
|
||||||
///* Most definitions (including the G class) is done in paths.php
|
|
||||||
// * This mostly simulates a sysGeneric.php call.
|
|
||||||
// */
|
|
||||||
//if (file_exists(PATH_HOME . "engine" . PATH_SEP . "config" . PATH_SEP . "paths_installed.php")) {
|
|
||||||
// require_once(PATH_HOME . "engine" . PATH_SEP . "config" . PATH_SEP . "paths_installed.php");
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "config" . PATH_SEP . "paths.php");
|
|
||||||
//
|
|
||||||
//require_once (PATH_THIRDPARTY . "pake" . PATH_SEP . "pakeFunction.php");
|
|
||||||
//require_once (PATH_THIRDPARTY . "pake" . PATH_SEP . "pakeGetopt.class.php");
|
|
||||||
//require_once (PATH_CORE . "config" . PATH_SEP . "environments.php");
|
|
||||||
//require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.system.php");
|
|
||||||
//
|
|
||||||
//require_once (PATH_GULLIVER . "class.bootstrap.php");
|
|
||||||
//
|
|
||||||
//spl_autoload_register(array("Bootstrap", "autoloadClass"));
|
|
||||||
//
|
|
||||||
//Bootstrap::registerSystemClasses();
|
|
||||||
//
|
|
||||||
//$config = System::getSystemConfiguration(PATH_HOME . "engine" . PATH_SEP . "config" . PATH_SEP . "env.ini");
|
|
||||||
//
|
|
||||||
// $e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL;
|
|
||||||
// $e_all = defined('E_STRICT') ? E_ALL & ~E_STRICT : $e_all;
|
|
||||||
// $e_all = $e_all & E_WARNING; // show warning
|
|
||||||
// $e_all = $e_all & ~E_NOTICE; // don't notices
|
|
||||||
//
|
|
||||||
// // Do not change any of these settings directly, use env.ini instead
|
|
||||||
// ini_set('display_errors', $config['debug']);
|
|
||||||
// ini_set('error_reporting', $e_all);
|
|
||||||
// ini_set('short_open_tag', 'On');
|
|
||||||
// ini_set('default_charset', "UTF-8");
|
|
||||||
// ini_set('memory_limit', $config['memory_limit']);
|
|
||||||
// ini_set('soap.wsdl_cache_enabled', $config['wsdl_cache']);
|
|
||||||
// ini_set('date.timezone', $config['time_zone']);
|
|
||||||
//
|
|
||||||
// define ('DEBUG_SQL_LOG', $config['debug_sql']);
|
|
||||||
// define ('DEBUG_TIME_LOG', $config['debug_time']);
|
|
||||||
// define ('DEBUG_CALENDAR_LOG', $config['debug_calendar']);
|
|
||||||
// define ('MEMCACHED_ENABLED', $config['memcached']);
|
|
||||||
// define ('MEMCACHED_SERVER', $config['memcached_server']);
|
|
||||||
// define ('TIME_ZONE', $config['time_zone']);
|
|
||||||
|
|
||||||
$rootDir = PROCESSMAKER_PATH;
|
|
||||||
require $rootDir . "framework/src/Maveriks/Util/ClassLoader.php";
|
|
||||||
|
|
||||||
$loader = Maveriks\Util\ClassLoader::getInstance();
|
|
||||||
$loader->add($rootDir . 'framework/src/', "Maveriks");
|
|
||||||
$loader->add($rootDir . 'workflow/engine/src/', "ProcessMaker");
|
|
||||||
$loader->add($rootDir . 'workflow/engine/src/');
|
|
||||||
|
|
||||||
// add vendors to autoloader
|
|
||||||
$loader->add($rootDir . 'vendor/bshaffer/oauth2-server-php/src/', "OAuth2");
|
|
||||||
$loader->addClass("Bootstrap", $rootDir . 'gulliver/system/class.bootstrap.php');
|
|
||||||
|
|
||||||
$loader->addModelClassPath($rootDir . "workflow/engine/classes/model/");
|
|
||||||
|
|
||||||
$app = new Maveriks\WebApplication();
|
$app = new Maveriks\WebApplication();
|
||||||
$app->setRootDir($rootDir);
|
$app->setRootDir(PROCESSMAKER_PATH);
|
||||||
$app->loadEnvironment();
|
$app->loadEnvironment();
|
||||||
|
|
||||||
require PATH_THIRDPARTY . "pake" . PATH_SEP . "pakeFunction.php";
|
|
||||||
require PATH_THIRDPARTY . "pake" . PATH_SEP . "pakeGetopt.class.php";
|
|
||||||
|
|
||||||
// trap -V before pake
|
// trap -V before pake
|
||||||
if (in_array('-v', $argv) || in_array('-V', $argv) || in_array('--version', $argv))
|
if (in_array('-v', $argv) || in_array('-V', $argv) || in_array('--version', $argv)) {
|
||||||
{
|
printf("ProcessMaker version %s\n", pakeColor::colorize(trim(file_get_contents(PATH_GULLIVER . 'VERSION')), 'INFO'));
|
||||||
printf("ProcessMaker version %s\n", pakeColor::colorize(trim(file_get_contents( PATH_GULLIVER . 'VERSION')), 'INFO'));
|
exit(0);
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// register tasks
|
// register tasks
|
||||||
@@ -110,19 +17,20 @@ require PATH_THIRDPARTY . "pake" . PATH_SEP . "pakeGetopt.class.php";
|
|||||||
$directories = array(PATH_HOME . 'engine/bin/tasks');
|
$directories = array(PATH_HOME . 'engine/bin/tasks');
|
||||||
$pluginsDirectories = glob(PATH_PLUGINS . "*");
|
$pluginsDirectories = glob(PATH_PLUGINS . "*");
|
||||||
foreach ($pluginsDirectories as $dir) {
|
foreach ($pluginsDirectories as $dir) {
|
||||||
if (!is_dir($dir))
|
if (!is_dir($dir)) {
|
||||||
continue;
|
continue;
|
||||||
if (is_dir("$dir/bin/tasks"))
|
}
|
||||||
$directories[] = "$dir/bin/tasks";
|
if (is_dir("$dir/bin/tasks")) {
|
||||||
|
$directories[] = "$dir/bin/tasks";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($directories as $dir) {
|
foreach ($directories as $dir) {
|
||||||
foreach (glob("$dir/*.php") as $filename) {
|
foreach (glob("$dir/*.php") as $filename) {
|
||||||
include_once($filename);
|
include_once($filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLI::run();
|
CLI::run();
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ EOT;
|
|||||||
$short = "h" . $taskData['opt']['short'];
|
$short = "h" . $taskData['opt']['short'];
|
||||||
$long = array_merge( array ("help"
|
$long = array_merge( array ("help"
|
||||||
), $taskData['opt']['long'] );
|
), $taskData['opt']['long'] );
|
||||||
$getopt = Console_GetOpt::getopt2( $args, $short, $long );
|
$getopt = Console_Getopt::getopt2( $args, $short, $long );
|
||||||
if (! is_array( $getopt )) {
|
if (! is_array( $getopt )) {
|
||||||
echo self::error( "Invalid options (" . $getopt->getMessage() . ")" ) . "\n\n";
|
echo self::error( "Invalid options (" . $getopt->getMessage() . ")" ) . "\n\n";
|
||||||
self::help( $taskName );
|
self::help( $taskName );
|
||||||
|
|||||||
Reference in New Issue
Block a user