本文整理汇总了PHP中Process::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::exists方法的具体用法?PHP Process::exists怎么用?PHP Process::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::exists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPidFile
function checkPidFile($pidfile = null)
{
if ($pidfile == null) {
if ($this->_pidfile) {
$pidfile = $this->_pidfile;
} else {
$pidfile = $this->getName() . '.pid';
}
}
logger::debug('Checking pidfile: %s', $pidfile);
// Check if the process exist
if (file_exists($pidfile)) {
$pid = file_get_contents($pidfile);
$p = new Process($pid);
logger::debug(' - Inspecting pid %d', $pid);
if ($p->exists()) {
// Already running
return self::PROCESS_RUNNING;
}
unlink($pidfile);
$retval = self::PROCESS_STALE;
} else {
$retval = self::PROCESS_CLEAR;
}
$tp = new Process();
file_put_contents($pidfile, $tp->getPid());
$this->_pidfile = $pidfile;
return $retval;
}
示例2: isset
G::LoadClass('dynaformEditor');
G::LoadClass('toolBar');
G::LoadClass('dynaFormField');
//G::LoadClass('configuration');
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'processes';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_ID_SUB_MENU_SELECTED = 'FIELDS';
$PRO_UID = isset($_GET['PRO_UID']) ? $_GET['PRO_UID'] : '0';
$DYN_UID = isset($_GET['DYN_UID']) ? urldecode($_GET['DYN_UID']) : '0';
$_SESSION['PROCESS'] = $_GET['PRO_UID'];
if ($PRO_UID === '0') {
return;
}
$process = new Process();
if ($process->exists($PRO_UID)) {
$process->load($PRO_UID);
} else {
//TODO
print "{$PRO_UID} doesn't exist, continue? yes";
}
$dynaform = new dynaform();
if ($dynaform->exists($DYN_UID)) {
$dynaform->load($DYN_UID);
$_SESSION['CURRENT_DYN_UID'] = $DYN_UID;
} else {
/* New Dynaform
*
*/
$dynaform->create(array('PRO_UID' => $PRO_UID));
}
示例3: throwExceptionIfNotExistsProcess
/**
* Verify if doesn't exist the Process in table PROCESS
*
* @param string $processUid Unique id of Process
*
* return void Throw exception if doesn't exist the Process in table PROCESS
*/
public function throwExceptionIfNotExistsProcess($processUid)
{
$process = new \Process();
if (!$process->exists($processUid)) {
throw new \Exception(\G::LoadTranslation("ID_PROJECT_DOES_NOT_EXIST", array($this->arrayParamException["processUid"], $processUid)));
}
}
示例4: load
public function load($sProcessUID, $bView = false, $sApplicationUID = '', $iDelegation = 0, $sTask = '', $bCT = false)
{
try {
$oProcess = new Process();
$aRow = $oProcess->load($sProcessUID);
$oPM->title->label = strip_tags($aRow['PRO_TITLE']);
$oPM->title->position->x = $aRow['PRO_TITLE_X'];
$oPM->title->position->y = $aRow['PRO_TITLE_Y'];
$oPM->task = array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(TaskPeer::PRO_UID);
$oCriteria->addSelectColumn(TaskPeer::TAS_UID);
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
$oCriteria->addSelectColumn(TaskPeer::TAS_START);
$oCriteria->addSelectColumn(TaskPeer::TAS_POSX);
$oCriteria->addSelectColumn(TaskPeer::TAS_POSY);
$oCriteria->addSelectColumn(TaskPeer::TAS_COLOR);
$oCriteria->addSelectColumn(TaskPeer::TAS_TYPE);
$aConditions = array();
$aConditions[] = array(0 => TaskPeer::TAS_UID, 1 => ContentPeer::CON_ID);
$aConditions[] = array(0 => ContentPeer::CON_CATEGORY, 1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter());
$aConditions[] = array(0 => ContentPeer::CON_LANG, 1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN);
$oCriteria->add(TaskPeer::PRO_UID, $sProcessUID);
$oDataset = TaskPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow1 = $oDataset->getRow()) {
$oTask = null;
$oTask->uid = $aRow1['TAS_UID'];
$oTask->task_type = $aRow1['TAS_TYPE'];
if ($aRow1['TAS_TYPE'] == 'NORMAL') {
if ($aRow1['CON_VALUE'] == "") {
//There is no Label in Current SYS_LANG language so try to find in English - by default
$oTask1 = new Task();
$aFields1 = $oTask1->load($oTask->uid);
$aRow1['CON_VALUE'] = $oTask1->getTasTitle();
}
$oTask->label = strip_tags($aRow1['CON_VALUE']);
} else {
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$oCriteria->add(SubProcessPeer::PRO_PARENT, $aRow1['PRO_UID']);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $aRow1['TAS_UID']);
$oCriteria->addAsColumn('TAS_TITLE', 'C1.CON_VALUE');
$oCriteria->addAlias("C1", 'CONTENT');
$tasTitleConds = array();
$tasTitleConds[] = array(SubProcessPeer::TAS_PARENT, 'C1.CON_ID');
$tasTitleConds[] = array('C1.CON_CATEGORY', $del . 'TAS_TITLE' . $del);
$tasTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
$oCriteria->addJoinMC($tasTitleConds, Criteria::LEFT_JOIN);
$oDatasetX = SubProcessPeer::doSelectRS($oCriteria);
$oDatasetX->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDatasetX->next();
$aRowx = $oDatasetX->getRow();
if ($oProcess->exists($aRowx['PRO_UID'])) {
//$aRowy = $oProcess->load($aRowx['PRO_UID']);
//$oTask->label = $aRowy['PRO_TITLE'];
$oTask->label = $aRowx['TAS_TITLE'];
} else {
$oTask->label = strip_tags($aRow1['CON_VALUE']);
}
}
$oTask->taskINI = strtolower($aRow1['TAS_START']) == 'true' ? true : false;
$oTask->position->x = (int) $aRow1['TAS_POSX'];
$oTask->position->y = (int) $aRow1['TAS_POSY'];
$oTask->derivation = null;
$oTask->derivation->to = array();
$oCriteria = new Criteria('workflow');
$oCriteria->add(RoutePeer::PRO_UID, $sProcessUID);
$oCriteria->add(RoutePeer::TAS_UID, $aRow1['TAS_UID']);
$oDataset2 = RoutePeer::doSelectRS($oCriteria);
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset2->next();
while ($aRow2 = $oDataset2->getRow()) {
switch ($aRow2['ROU_TYPE']) {
case 'SEQUENTIAL':
$aRow2['ROU_TYPE'] = 0;
break;
case 'SELECT':
$aRow2['ROU_TYPE'] = 1;
break;
case 'EVALUATE':
$aRow2['ROU_TYPE'] = 2;
break;
case 'PARALLEL':
$aRow2['ROU_TYPE'] = 3;
break;
case 'PARALLEL-BY-EVALUATION':
$aRow2['ROU_TYPE'] = 4;
break;
case 'SEC-JOIN':
$aRow2['ROU_TYPE'] = 5;
break;
case 'DISCRIMINATOR':
$aRow2['ROU_TYPE'] = 8;
break;
}
$oTo = null;
$oTo->task = $aRow2['ROU_NEXT_TASK'];
//.........这里部分代码省略.........
示例5: proUid
/**
* Validate pro_uid
*
* @param string $pro_uid, Uid for process
* @param string $nameField . Name of field for message
*
* @access public
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return string
*/
public static function proUid($pro_uid, $nameField = 'pro_uid')
{
$pro_uid = trim($pro_uid);
if ($pro_uid == '') {
throw new \Exception(\G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, '')));
}
$oProcess = new \Process();
if (!$oProcess->exists($pro_uid)) {
throw new \Exception(\G::LoadTranslation("ID_PROCESS_NOT_EXIST", array($nameField, $pro_uid)));
}
return $pro_uid;
}