本文整理汇总了PHP中eprintln函数的典型用法代码示例。如果您正苦于以下问题:PHP eprintln函数的具体用法?PHP eprintln怎么用?PHP eprintln使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eprintln函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: caseSchedulerCron
public function caseSchedulerCron ($date, &$log = array(), $cron = 0)
{
try {
require_once("classes" . PATH_SEP . "model" . PATH_SEP . "LogCasesScheduler.php");
//Set variables
$port = "";
if (isset($_SERVER["SERVER_PORT"])) {
$port = ($_SERVER["SERVER_PORT"] . "" != "80")? ":" . $_SERVER["SERVER_PORT"] : "";
} else {
if (defined("SERVER_PORT")) {
$port = (SERVER_PORT . "" != "80")? ":" . SERVER_PORT : "";
}
}
$wsdl = "http://" . SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
$timeDate = strtotime($date);
$dateHour = date("H", $timeDate);
$dateMinutes = date("i", $timeDate);
$dateCurrentIni = date("Y-m-d", $timeDate) . " 00:00:00";
$dateCurrentEnd = date("Y-m-d", $timeDate) . " 23:59:59";
//Query
$criteria = $this->getAllCriteria();
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_STATE, "INACTIVE", Criteria::NOT_EQUAL)->addAnd(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_STATE, "PROCESSED", Criteria::NOT_EQUAL))
);
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentIni, Criteria::GREATER_EQUAL)->addAnd(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentEnd, Criteria::LESS_EQUAL))->addOr(
//$criteria->getNewCriterion(CaseSchedulerPeer::SCH_OPTION, 5, Criteria::GREATER_EQUAL))->addOr(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentIni, Criteria::LESS_THAN))
);
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_END_DATE, null, Criteria::EQUAL)->addOr(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_END_DATE, $dateCurrentIni, Criteria::GREATER_EQUAL))
);
$rsCriteria = CaseSchedulerPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
if ($cron == 1) {
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
$arrayCron["processcTimeStart"] = time();
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
}
$caseSchedulerUid = $row["SCH_UID"];
$caseSchedulerOption = (int)($row["SCH_OPTION"]);
$caseSchedulerTimeNextRun = $row["SCH_TIME_NEXT_RUN"];
//Create the new case
$flagNewCase = false;
$caseSchedulerTimeNextRunNew = "";
if (strtotime($caseSchedulerTimeNextRun) < strtotime($dateCurrentIni)) {
//Generate new date for old SCH_TIME_NEXT_RUN
$flagNewCase = true; //Create the old case
$caseSchedulerTimeNextRunNew = $this->getTimeNextRunByDate($row, $date, false);
} else {
$caseSchedulerTimeNextRunHour = date("H", strtotime($row["SCH_TIME_NEXT_RUN"]));
$caseSchedulerTimeNextRunMinutes = date("i", strtotime($row["SCH_TIME_NEXT_RUN"]));
if ((int)($dateHour . $dateMinutes) <= (int)($caseSchedulerTimeNextRunHour . $caseSchedulerTimeNextRunMinutes)) {
$flagNewCase = $caseSchedulerTimeNextRunHour == $dateHour && $caseSchedulerTimeNextRunMinutes == $dateMinutes;
} else {
$flagNewCase = true; //Create the old case
}
}
if ($flagNewCase) {
println(" CASE SCHEDULER: " . $row["SCH_NAME"]);
println(" - Connecting webservice: $wsdl");
$user = $row["SCH_DEL_USER_NAME"];
$pass = $row["SCH_DEL_USER_PASS"];
$processId = $row["PRO_UID"];
$taskId = $row["TAS_UID"];
$client = new SoapClient($wsdl);
$result = $client->__SoapCall("login",
array(
array("userid" => $user, "password" => Bootstrap::getPasswordHashType() . ":" . $pass)
)
);
eprintln(" - Logging as user \"$user\"...");
$paramsLog = array(
"PRO_UID" => $processId,
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:CaseScheduler.php
示例2: println
/**
* println
*
* @param string $s
*
* @return eprintln($s)
*/
function println($s)
{
return eprintln($s);
}
开发者ID:nhenderson,项目名称:processmaker,代码行数:11,代码来源:class.g.php
示例3: checkMafeRequirements
public function checkMafeRequirements ($workspace,$lang) {
$this->initPropel(true);
$pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client');
if (empty($pmRestClient)) {
if (!is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
$_CSERVER = $_SERVER;
unset($_CSERVER['REQUEST_TIME']);
unset($_CSERVER['REMOTE_PORT']);
$cput = serialize($_CSERVER);
file_put_contents(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info', $cput);
}
if (is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
$SERVER_INFO = file_get_contents(PATH_DATA . 'sites/' . $workspace . '/'.'.server_info');
$SERVER_INFO = unserialize($SERVER_INFO);
$envFile = PATH_CONFIG . 'env.ini';
$skin ='neoclassic';
if (file_exists($envFile) ) {
$sysConf = System::getSystemConfiguration($envFile);
$lang = $sysConf['default_lang'];
$skin = $sysConf['default_skin'];
}
$endpoint = sprintf(
'%s/sys%s/%s/%s/oauth2/grant',
isset($SERVER_INFO['HTTP_ORIGIN']) ? $SERVER_INFO['HTTP_ORIGIN'] : '',
$workspace,
$lang,
$skin
);
$oauthClients = new OauthClients();
$oauthClients->setClientId('x-pm-local-client');
$oauthClients->setClientSecret('179ad45c6ce2cb97cf1029e212046e81');
$oauthClients->setClientName('PM Web Designer');
$oauthClients->setClientDescription('ProcessMaker Web Designer App');
$oauthClients->setClientWebsite('www.processmaker.com');
$oauthClients->setRedirectUri($endpoint);
$oauthClients->save();
} else {
eprintln("WARNING! No server info found!", 'red');
}
}
}
开发者ID:rrsc,项目名称:processmaker,代码行数:87,代码来源:class.wsTools.php
示例4: setExecutionResultMessage
function setExecutionResultMessage($m, $t = '')
{
$c = 'green';
if ($t == 'error') {
$c = 'red';
}
if ($t == 'info') {
$c = 'yellow';
}
eprintln("[{$m}]", $c);
}
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:11,代码来源:reindex_solr.php
示例5: Exception
}
}
} else {
if (!is_dir(PATH_DB . $workspace) || !file_exists(PATH_DB . $workspace . PATH_SEP . "db.php")) {
throw new Exception("Error: The workspace \"$workspace\" does not exist");
}
$countw++;
passthru("php -f \"$messageEventCronSinglePath\" $workspace \"" . base64_encode(PATH_HOME) . "\" \"" . base64_encode(PATH_TRUNK) . "\" \"" . base64_encode(PATH_OUTTRUNK) . "\"");
}
eprintln("Finished $countw workspaces processed");
} catch (Exception $e) {
throw $e;
}
//End CRON
$arrayCron = array("flagIsRunning" => "0", "lastExecution" => date("Y-m-d H:i:s"));
file_put_contents(PATH_DATA . "timereventcron", serialize($arrayCron));
} else {
eprintln("The Timer-Event CRON is running, please wait for it to finish\nStarted in $lastExecution");
eprintln("If do you want force the execution use the option \"" . $arrayCommandOption["force"] . "\", example: php -f timereventcron.php +wworkflow " . $arrayCommandOption["force"] ,"green");
}
echo "Done!\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
开发者ID:rrsc,项目名称:processmaker,代码行数:29,代码来源:timereventcron.php
示例6: caseSchedulerCron
public function caseSchedulerCron($date, &$log = array(), $cron = 0)
{
G::LoadClass('dates');
require_once 'classes/model/LogCasesScheduler.php';
$oDates = new dates();
$nTime = strtotime($date);
$dCurrentDate = date('Y-m-d', $nTime) . ' 00:00:00';
$dNextDay = date('Y-m-d', strtotime("{$dCurrentDate}")) . ' 23:59:59';
$oCriteria = $this->getAllCriteria();
$oCriteria->addAnd(CaseSchedulerPeer::SCH_STATE, 'INACTIVE', Criteria::NOT_EQUAL);
$oCriteria->addAnd(CaseSchedulerPeer::SCH_STATE, 'PROCESSED', Criteria::NOT_EQUAL);
$oCriteria->add($oCriteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dCurrentDate, Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dNextDay, Criteria::LESS_EQUAL))->addOr($oCriteria->getNewCriterion(CaseSchedulerPeer::SCH_OPTION, '5', Criteria::GREATER_EQUAL)));
$oCriteria->add(CaseSchedulerPeer::SCH_END_DATE, null, Criteria::EQUAL);
$oCriteria->addOr(CaseSchedulerPeer::SCH_END_DATE, $dCurrentDate, Criteria::GREATER_EQUAL);
$oDataset = CaseSchedulerPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$sValue = '';
$sActualTime = '';
$sDaysPerformTask = '';
$sWeeks = '';
$sStartDay = '';
$sMonths = '';
while ($aRow = $oDataset->getRow()) {
if ($cron == 1) {
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
$arrayCron["processcTimeStart"] = time();
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
}
$sSchedulerUid = $aRow['SCH_UID'];
$sOption = $aRow['SCH_OPTION'];
switch ($sOption) {
case '1':
$sDaysPerformTask = $aRow['SCH_DAYS_PERFORM_TASK'];
$aDaysPerformTask = explode('|', $sDaysPerformTask);
$sValue = $aDaysPerformTask[0];
if ($sValue != 1) {
$sDaysPerformTask = $aDaysPerformTask[1];
}
break;
case '2':
$sDaysPerformTask = $aRow['SCH_EVERY_DAYS'];
$sWeeks = $aRow['SCH_WEEK_DAYS'];
break;
case '3':
$sStartDay = $aRow['SCH_START_DAY'];
$sMonths = $aRow['SCH_MONTHS'];
$aStartDay = explode('|', $sStartDay);
$sValue = $aStartDay[0];
break;
case '4':
$aRow['SCH_STATE'] = 'PROCESSED';
break;
case '5':
break;
}
$sActualTime = $aRow['SCH_TIME_NEXT_RUN'];
$sActualDataHour = date('H', strtotime($aRow['SCH_TIME_NEXT_RUN']));
$sActualDataMinutes = date('i', strtotime($aRow['SCH_TIME_NEXT_RUN']));
$dActualSysHour = date('H', $nTime);
$dActualSysHour = $dActualSysHour == '00' ? '24' : $dActualSysHour;
$dActualSysMinutes = date('i', $nTime);
$sActualDataTime = strtotime($aRow['SCH_TIME_NEXT_RUN']);
$sActualSysTime = strtotime($nTime);
// note added consider the posibility to encapsulate some in functionality in a class method or some funtions
if ($sActualDataHour < $dActualSysHour) {
$_PORT = SERVER_PORT != '80' ? ':' . SERVER_PORT : '';
$defaultEndpoint = 'http://' . SERVER_NAME . $_PORT . '/sys' . SYS_SYS . '/' . SYS_LANG . '/classic/services/wsdl2';
println(" - Connecting webservice: {$defaultEndpoint}");
$user = $aRow["SCH_DEL_USER_NAME"];
$pass = $aRow["SCH_DEL_USER_PASS"];
$processId = $aRow["PRO_UID"];
$taskId = $aRow["TAS_UID"];
$client = new SoapClient($defaultEndpoint);
$params = array('userid' => $user, 'password' => 'md5:' . $pass);
$result = $client->__SoapCall('login', array($params));
eprint(" - Logging as user {$user}.............");
if ($result->status_code == 0) {
eprintln("OK+", 'green');
$sessionId = $result->message;
$newCaseLog = new LogCasesScheduler();
$newRouteLog = new LogCasesScheduler();
$variables = array();
$params = array('sessionId' => $sessionId, 'processId' => $processId, 'taskId' => $taskId, 'variables' => $variables);
$paramsLog = array('PRO_UID' => $processId, 'TAS_UID' => $taskId, 'SCH_UID' => $sSchedulerUid, 'USR_NAME' => $user, 'RESULT' => '', 'EXEC_DATE' => date('Y-m-d'), 'EXEC_HOUR' => date('H:i:s'), 'WS_CREATE_CASE_STATUS' => '', 'WS_ROUTE_CASE_STATUS' => '');
$sw_transfer_control_plugin = false;
//This SW will be true only if a plugin is allowed to continue the action
//If this Job was was registered to be performed by a plugin
if (isset($aRow['CASE_SH_PLUGIN_UID']) && $aRow['CASE_SH_PLUGIN_UID'] != "") {
//Check if the plugin is active
$pluginParts = explode("--", $aRow['CASE_SH_PLUGIN_UID']);
if (count($pluginParts) == 2) {
//***************** Plugins **************************
G::LoadClass('plugin');
//here we are loading all plugins registered
//the singleton has a list of enabled plugins
$sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
$oPluginRegistry =& PMPluginRegistry::getSingleton();
if (file_exists($sSerializedFile)) {
$oPluginRegistry->unSerializeInstance(file_get_contents($sSerializedFile));
//.........这里部分代码省略.........
开发者ID:bqevin,项目名称:processmaker,代码行数:101,代码来源:CaseScheduler.php
示例7: system
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $sObject \"$sDate\" \"$dateSystem\" $argsx", $retval);
}
}
}
}
} else {
if (!is_dir(PATH_DB . $ws) || !file_exists(PATH_DB . $ws . PATH_SEP . "db.php")) {
throw new Exception("Error: The workspace \"$ws\" does not exist");
}
$cws = 1;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" $ws \"$sDate\" \"$dateSystem\" $argsx", $retval);
}
eprintln("Finished $cws workspaces processed.");
} catch (Exception $e) {
eprintln("Has produced the following error:", "red");
eprintln("* " . $e->getMessage());
eprintln("[DONE]", "green");
}
//End cron
$arrayCron = array("bCronIsRunning" => "0", "sLastExecution" => date("Y-m-d H:i:s"));
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
} else {
eprintln("The cron is running, please wait for it to finish.\nStarted in $sLastExecution");
eprintln("If do you want force the execution use the option '+force', example: php -f +wworkflow +force" ,"green");
}
开发者ID:nhenderson,项目名称:processmaker,代码行数:29,代码来源:cron.php
示例8: passthru
if ($entry != '' && $entry != '.' && $entry != '..') {
if (is_dir(PATH_DB . $entry)) {
if (file_exists(PATH_DB . $entry . PATH_SEP . 'db.php')) {
$counterw++;
passthru('php -f "' . $cronSinglePath . '" "' . base64_encode(PATH_HOME) . '" "' . base64_encode(PATH_TRUNK) . '" "' . base64_encode(PATH_OUTTRUNK) . '" ' . $cronName . ' ' . $entry . ' "' . $dateSystem . '" "' . $date . '" ' . $argvx);
}
}
}
}
} else {
if (!is_dir(PATH_DB . $workspace) || !file_exists(PATH_DB . $workspace . PATH_SEP . 'db.php')) {
throw new Exception('Error: The workspace "' . $workspace . '" does not exist');
}
$counterw++;
passthru('php -f "' . $cronSinglePath . '" "' . base64_encode(PATH_HOME) . '" "' . base64_encode(PATH_TRUNK) . '" "' . base64_encode(PATH_OUTTRUNK) . '" ' . $cronName . ' ' . $workspace . ' "' . $dateSystem . '" "' . $date . '" ' . $argvx);
}
eprintln('Finished ' . $counterw . ' workspaces processed');
} catch (Exception $e) {
throw $e;
}
//End CRON
$arrayCron = ['flagIsRunning' => '0', 'lastExecution' => date('Y-m-d H:i:s')];
file_put_contents(PATH_DATA . $cronName, serialize($arrayCron));
} else {
eprintln('The ' . $arrayCronConfig[$cronName]['title'] . ' is running, please wait for it to finish' . "\n" . 'Started in ' . $lastExecution);
eprintln('If do you want force the execution use the option "' . $arrayCommandOption['force'] . '", example: php -f ' . $cronName . '.php +wworkflow ' . $arrayCommandOption['force'], 'green');
}
echo 'Done!' . "\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:cron.php
示例9: eprintln
}
//If $sDate is not set, so take the system time
if ($sDate != null) {
eprintln("[Applying date filter: {$sDate}]");
} else {
$sDate = $dateSystem;
}
if ($ws == null) {
$oDirectory = dir(PATH_DB);
$cws = 0;
while ($sObject = $oDirectory->read()) {
if ($sObject != "." && $sObject != "..") {
if (is_dir(PATH_DB . $sObject)) {
if (file_exists(PATH_DB . $sObject . PATH_SEP . "db.php")) {
$cws = $cws + 1;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" {$sObject} \"{$sDate}\" \"{$dateSystem}\" {$argsx}", $retval);
}
}
}
}
} else {
$cws = 1;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" {$ws} \"{$sDate}\" \"{$dateSystem}\" {$argsx}", $retval);
}
//End cron
$arrayCron = array("bCronIsRunning" => "0", "sLastExecution" => date("Y-m-d H:i:s"));
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
eprintln("Finished {$cws} workspaces processed.");
} else {
eprintln("The cron is running, please wait for it to finish.\nStarted in {$sLastExecution}");
}
开发者ID:ralpheav,项目名称:processmaker,代码行数:31,代码来源:cron.php
示例10: fopen
$pro["datasources"]["rp"]["adapter"] = $DB_ADAPTER;
//$pro["datasources"]["dbarray"]["connection"] = "dbarray://user:pass@localhost/pm_os";
//$pro["datasources"]["dbarray"]["adapter"] = "dbarray";
$oFile = fopen(PATH_CORE . "config" . PATH_SEP . "_databases_.php", "w");
fwrite($oFile, "<?php global \$pro; return \$pro; ?>");
fclose($oFile);
Propel::init(PATH_CORE . "config" . PATH_SEP . "_databases_.php");
//Creole::registerDriver("dbarray", "creole.contrib.DBArrayConnection");
//Enable RBAC
Bootstrap::LoadSystem("rbac");
$rbac =& RBAC::getSingleton(PATH_DATA, session_id());
$rbac->sSystem = "PROCESSMAKER";
if (!defined("DB_ADAPTER")) {
define("DB_ADAPTER", $DB_ADAPTER);
}
eprintln("Processing workspace: " . $workflow, "green");
try {
$timerEvent = new \ProcessMaker\BusinessModel\TimerEvent();
$timerEvent->startContinueCaseByTimerEvent(date("Y-m-d H:i:s"), true);
} catch (Exception $e) {
echo $e->getMessage() . "\n";
eprintln("Problem in workspace: " . $workflow . " it was omitted.", "red");
}
eprintln();
}
if (file_exists(PATH_CORE . "config" . PATH_SEP . "_databases_.php")) {
unlink(PATH_CORE . "config" . PATH_SEP . "_databases_.php");
}
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:timereventcron_single.php
示例11: substr
$WS = substr($argv[$i], 2);
} else {
$argsx .= ' ' . $argv[$i];
}
}
}
//if $sDate is not set, so take the system time
if ($sDate != '') {
eprintln("[Applying date filter: {$sDate}]");
} else {
$sDate = date('Y-m-d H:i:s');
}
if ($WS == '') {
$oDirectory = dir(PATH_DB);
$cws = 0;
while ($sObject = $oDirectory->read()) {
if ($sObject != '.' && $sObject != '..') {
if (is_dir(PATH_DB . $sObject)) {
if (file_exists(PATH_DB . $sObject . PATH_SEP . 'db.php')) {
$cws++;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" {$sObject} \"{$sDate}\" {$argsx}", $retval);
}
}
}
}
} else {
$cws = 1;
system("php -f \"" . dirname(__FILE__) . PATH_SEP . "cron_single.php\" {$WS} \"{$sDate}\" {$argsx}", $retval);
}
eprintln("Finished {$cws} workspaces processed.");
开发者ID:nshong,项目名称:processmaker,代码行数:30,代码来源:cron.php
注:本文中的eprintln函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论