public function __construct() { G::LoadClass('memcached'); $this->memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : ''); define('ERROR_EXCEPTION', 1); define('INFO_EXCEPTION', 3); define('WARNING_EXCEPTION', 2); //$this->setDebug(true); }
$result->fileError = true; print(G::json_encode($result)); die; } */ } else { $aData['USR_UID'] = $form['USR_UID']; $aData['USR_USERNAME'] = $form['USR_USERNAME']; if (isset($form['USR_PASSWORD'])) { if ($form['USR_PASSWORD'] != '') { $aData['USR_PASSWORD'] = $form['USR_PASSWORD']; require_once 'classes/model/UsersProperties.php'; $oUserProperty = new UsersProperties(); $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(md5($form['USR_PASSWORD']))))); $memKey = 'rbacSession' . session_id(); $memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : ''); if (($RBAC->aUserInfo = $memcache->get($memKey)) === false) { $RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']); $memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS); } if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') { $aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s'); $aUserProperty['USR_LOGGED_NEXT_TIME'] = 1; $oUserProperty->update($aUserProperty); } $aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0); if (count($aErrors) > 0) { $sDescription = G::LoadTranslation('ID_POLICY_ALERT') . ':,'; foreach ($aErrors as $sError) { switch ($sError) { case 'ID_PPP_MINIMUN_LENGTH':
} else { // classic sysLogin interface require_once PATH_METHODS . "login/sysLogin.php"; die; } } if (DEBUG_TIME_LOG) { G::logTimeByPage(); } //log this page die; } } // create memcached singleton G::LoadClass('memcached'); $memcache =& PMmemcached::getSingleton(SYS_SYS); // PM Paths DATA define('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/'); define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/'); define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/'); define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/'); define('PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/'); define('PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/'); define('PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE . 'usersFiles' . PATH_SEP); define('PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE . 'usersPhotographies' . PATH_SEP); define('SERVER_NAME', $_SERVER['SERVER_NAME']); define('SERVER_PORT', $_SERVER['SERVER_PORT']); // load Plugins base class G::LoadClass('plugin'); //here we are loading all plugins registered //the singleton has a list of enabled plugins
public function memcachedDelete() { //Limit defined in processmaker/workflow/engine/templates/processes/main.js $limit = 25; $start = 0; $memcache = PMmemcached::getSingleton(SYS_SYS); for ($start = 0; $start <= 50 - 1; $start++) { $memkey = "processList-allProcesses-" . $start * $limit . "-" . $limit; $memkeyTotal = $memkey . "-total"; $r = $memcache->delete($memkey); $r = $memcache->delete($memkeyTotal); } }
/** * listExtNoProcessesUser for Extjs * * @param string $sProcessUID * @return array(aAvailableUser) $aAvailableUser */ public function listExtNoProcessesUser($sProcessUID) { G::LoadSystem('rbac'); $memcache =& PMmemcached::getSingleton(SYS_SYS); $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(ProcessUserPeer::USR_UID); $oCriteria->add(ProcessUserPeer::PRO_UID, $sProcessUID); $oCriteria->add(ProcessUserPeer::PU_TYPE, 'SUPERVISOR'); $oDataset = ProcessUserPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aUIDS = array(); while ($aRow = $oDataset->getRow()) { $aUIDS[] = $aRow['USR_UID']; $oDataset->next(); } $sDelimiter = DBAdapter::getStringDelimiter(); $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->add(UsersPeer::USR_UID, $aUIDS, Criteria::NOT_IN); $oDataset = UsersPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aUIDS = array(); $oRBAC = RBAC::getSingleton(); while ($aRow = $oDataset->getRow()) { $memKey = 'rbacSession' . session_id(); if (($oRBAC->aUserInfo = $memcache->get($memKey)) === false) { $oRBAC->loadUserRolePermission($oRBAC->sSystem, $aRow['USR_UID']); $memcache->set($memKey, $oRBAC->aUserInfo, PMmemcached::EIGHT_HOURS); } $aPermissions = $oRBAC->aUserInfo[$oRBAC->sSystem]['PERMISSIONS']; $bInclude = false; foreach ($aPermissions as $aPermission) { if ($aPermission['PER_CODE'] == 'PM_SUPERVISOR') { $bInclude = true; } } if ($bInclude) { $aUIDS[] = $aRow['USR_UID']; } $oDataset->next(); } $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(UsersPeer::USR_UID); $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME); $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME); $oCriteria->add(UsersPeer::USR_UID, $aUIDS, Criteria::IN); $oDataset = UsersPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); $aAvailableUser = ''; while ($aRow = $oDataset->getRow()) { $aAvailableUser[] = array('USR_UID' => $aRow['USR_UID'], 'USR_FIRSTNAME' => $aRow['USR_FIRSTNAME'], 'USR_LASTNAME' => $aRow['USR_LASTNAME']); $oDataset->next(); } return $aAvailableUser; }
/** * Search records in specified application delegation data * * @param string $AppUID * application identifier * @throws ApplicationWithoutDelegationRecordsException * @return array array of arrays with the following information( * $documentInformation, * $dynaformFieldTypes, * $lastUpdateDate, * $maxPriority, * $assignedUsers, * $assignedUsersRead, * $assignedUsersUnread, * $draftUser, * $participatedUsers, * $participatedUsersStartedByUser, * $participatedUsersCompletedByUser, * $unassignedUsers, * $unassignedGroups */ public function getApplicationIndexData($AppUID) { G::LoadClass('memcached'); // get all the application data $allAppDbData = $this->getApplicationDelegationData($AppUID); // check if the application record was found // this case occurs when the application doesn't have related delegation // records. if (empty($allAppDbData) || !isset($allAppDbData[0])) { throw new ApplicationWithoutDelegationRecordsException("Application without delegation records. APP_UID: " . $AppUID); } // copy the application information $documentInformation = $allAppDbData[0]; // get the last delegate date using the del_delegate_date $index = $this->aaGetMaximun($allAppDbData, 'DEL_DELEGATE_DATE', 'DATE'); $lastUpdateDate = $allAppDbData[$index]['DEL_DELEGATE_DATE']; // get the delegate with max priority => minimun value $index2 = $this->aaGetMinimun($allAppDbData, 'DEL_PRIORITY', 'NUMBER', 'DEL_THREAD_STATUS', 'OPEN'); if ($index2 == null) { // get the last priority $maxPriority = $allAppDbData[$index]['DEL_PRIORITY']; } else { $maxPriority = $allAppDbData[$index2]['DEL_PRIORITY']; } $assignedUsers = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('DEL_THREAD_STATUS' => 'OPEN', 'DEL_FINISH_DATE' => 'NULL', 'APP_STATUS' => 'TO_DO', 'APP_THREAD_STATUS' => 'OPEN')); foreach ($indexes as $index) { $assignedUsers[] = array('USR_UID' => $allAppDbData[$index]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$index]['DEL_INDEX']); } $assignedUsersRead = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('DEL_THREAD_STATUS' => 'OPEN', 'DEL_FINISH_DATE' => 'NULL', 'APP_STATUS' => 'TO_DO', 'APP_THREAD_STATUS' => 'OPEN', 'DEL_INIT_DATE' => 'NOTNULL')); foreach ($indexes as $index) { $assignedUsersRead[] = array('USR_UID' => $allAppDbData[$index]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$index]['DEL_INDEX']); } $assignedUsersUnread = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('DEL_THREAD_STATUS' => 'OPEN', 'DEL_FINISH_DATE' => 'NULL', 'APP_STATUS' => 'TO_DO', 'APP_THREAD_STATUS' => 'OPEN', 'DEL_INIT_DATE' => 'NULL')); foreach ($indexes as $index) { $assignedUsersUnread[] = array('USR_UID' => $allAppDbData[$index]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$index]['DEL_INDEX']); } $draftUser = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('DEL_THREAD_STATUS' => 'OPEN', 'DEL_FINISH_DATE' => 'NULL', 'APP_STATUS' => 'DRAFT', 'APP_THREAD_STATUS' => 'OPEN')); if (!empty($indexes)) { $draftUser = array('USR_UID' => $allAppDbData[$indexes[0]]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$indexes[0]]['DEL_INDEX']); } $participatedUsers = array(); foreach ($allAppDbData as $row) { $participatedUsers[] = array('USR_UID' => $row['USR_UID'], 'DEL_INDEX' => $row['DEL_INDEX']); } $participatedUsersStartedByUser = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('DEL_INDEX' => '1')); foreach ($indexes as $index) { $participatedUsersStartedByUser[] = array('USR_UID' => $allAppDbData[$index]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$index]['DEL_INDEX']); } $participatedUsersCompletedByUser = array(); $indexes = $this->aaSearchRecords($allAppDbData, array('APP_STATUS' => 'COMPLETED')); foreach ($indexes as $index) { $participatedUsersCompletedByUser[] = array('USR_UID' => $allAppDbData[$index]['USR_UID'], 'DEL_INDEX' => $allAppDbData[$index]['DEL_INDEX']); } // search information of unassigned users // the unassigned users are the self service users and groups. // the self service users are defined in the TASKs of the PROCESS. foreach ($allAppDbData as $row) { $unassignedUsersGroups = array(); // use cache $oMemcache = PMmemcached::getSingleton($this->_solrInstance); $unassignedUsersGroups = $oMemcache->get($row['PRO_UID'] . "_" . $row['TAS_UID']); if (!$unassignedUsersGroups) { $unassignedUsersGroups = $this->getTaskUnassignedUsersGroupsData($row['PRO_UID'], $row['TAS_UID']); // add del_index foreach ($unassignedUsersGroups as $i => $newRow) { $unassignedUsersGroups[$i]['DEL_INDEX'] = $row['DEL_INDEX']; } // store in cache $oMemcache->set($row['PRO_UID'] . "_" . $row['TAS_UID'], $unassignedUsersGroups); } // copy list of unassigned users and groups $unassignedUsers = array(); $unassignedGroups = array(); foreach ($unassignedUsersGroups as $unassignedUserGroup) { if ($unassignedUserGroup['TU_RELATION'] == 1) { $unassignedUsers[] = array('USR_UID' => $unassignedUserGroup['USR_UID'], 'DEL_INDEX' => $unassignedUserGroup['DEL_INDEX']); } elseif ($unassignedUserGroup['TU_RELATION'] == 2) { $unassignedGroups[] = array('USR_UID' => $unassignedUserGroup['USR_UID'], 'DEL_INDEX' => $unassignedUserGroup['DEL_INDEX']); } } } // Get DataTypes of dynaforms // use cache array to store the dynaform variables per process // use memory array to store information of Datatypes of Dynaforms // All the datatypes of the process => all variables in all dynaforms in the // process $dynaformFieldTypes = array(); // get cache instance $oMemcache = PMmemcached::getSingleton($this->_solrInstance); $dynaformFieldTypes = $oMemcache->get($documentInformation['PRO_UID']); if (!$dynaformFieldTypes) { G::LoadClass('dynaformhandler'); $dynaformFileNames = $this->getProcessDynaformFileNames($documentInformation['PRO_UID']); $dynaformFields = array(); foreach ($dynaformFileNames as $dynaformFileName) { if (file_exists(PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName['DYN_FILENAME'] . '.xml')) { $dyn = new dynaFormHandler(PATH_DATA . '/sites/workflow/xmlForms/' . $dynaformFileName['DYN_FILENAME'] . '.xml'); $dynaformFields[] = $dyn->getFields(); } } foreach ($dynaformFields as $aDynFormFields) { foreach ($aDynFormFields as $field) { // create array of fields and types if ($field->getAttribute('validate') == 'Int') { $dynaformFieldTypes[$field->nodeName] = 'Int'; } elseif ($field->getAttribute('validate') == 'Real') { $dynaformFieldTypes[$field->nodeName] = 'Real'; } else { $dynaformFieldTypes[$field->nodeName] = $field->getAttribute('type'); } } } // create cache of dynaformfields $oMemcache->set($documentInformation['PRO_UID'], $dynaformFieldTypes); } // return result values $result = array($documentInformation, $dynaformFieldTypes, $lastUpdateDate, $maxPriority, $assignedUsers, $assignedUsersRead, $assignedUsersUnread, $draftUser, $participatedUsers, $participatedUsersStartedByUser, $participatedUsersCompletedByUser, $unassignedUsers, $unassignedGroups); return $result; }
/** * Update User * * @param string $userUid Unique id of User * @param array $arrayData Data * @param string $userUidLogged Unique id of User logged * * return array Return data of the User updated */ public function update($userUid, array $arrayData, $userUidLogged) { try { \G::LoadSystem("rbac"); //Verify data $process = new \ProcessMaker\BusinessModel\Process(); $validator = new \ProcessMaker\BusinessModel\Validator(); $validator->throwExceptionIfDataIsNotArray($arrayData, "\$arrayData"); $validator->throwExceptionIfDataIsEmpty($arrayData, "\$arrayData"); //Set data $arrayData = array_change_key_case($arrayData, CASE_UPPER); $arrayDataBackup = $arrayData; //Verify data $this->throwExceptionIfNotExistsUser($userUid, $this->arrayFieldNameForException["usrUid"]); $this->throwExceptionIfDataIsInvalid($userUid, $arrayData); //Permission Admin $countPermission = 0; $permission = $this->loadUserRolePermission("PROCESSMAKER", $userUidLogged); foreach ($permission as $key => $value) { if ($value["PER_CODE"] == "PM_USERS") { $countPermission = $countPermission + 1; } } if ($countPermission != 1) { throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUidLogged))); } //Update $cnn = \Propel::getConnection("workflow"); try { $rbac = new \RBAC(); $user = new \Users(); $rbac->initRBAC(); if (isset($arrayData["USR_NEW_PASS"])) { $arrayData["USR_PASSWORD"] = \Bootstrap::hashPassword($arrayData["USR_NEW_PASS"]); } $arrayData["USR_UID"] = $userUid; $arrayData["USR_LOGGED_NEXT_TIME"] = (isset($arrayData["USR_LOGGED_NEXT_TIME"]))? $arrayData["USR_LOGGED_NEXT_TIME"] : 0; $arrayData["USR_UPDATE_DATE"] = date("Y-m-d H:i:s"); $flagUserLoggedNextTime = false; if (isset($arrayData["USR_PASSWORD"])) { if ($arrayData["USR_PASSWORD"] != "") { //require_once 'classes/model/UsersProperties.php'; $userProperty = new \UsersProperties(); $aUserProperty = $userProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array(\Bootstrap::hashPassword($arrayData["USR_PASSWORD"]))))); $memKey = "rbacSession" . session_id(); $memcache = & \PMmemcached::getSingleton(defined("SYS_SYS")? SYS_SYS : ""); if (($rbac->aUserInfo = $memcache->get($memKey)) == false) { $rbac->loadUserRolePermission("PROCESSMAKER", $userUidLogged); $memcache->set($memKey, $rbac->aUserInfo, \PMmemcached::EIGHT_HOURS); } if ($rbac->aUserInfo["PROCESSMAKER"]["ROLE"]["ROL_CODE"] == "PROCESSMAKER_ADMIN") { $aUserProperty["USR_LAST_UPDATE_DATE"] = date("Y-m-d H:i:s"); $aUserProperty["USR_LOGGED_NEXT_TIME"] = $arrayData["USR_LOGGED_NEXT_TIME"]; $userProperty->update($aUserProperty); } $aHistory = unserialize($aUserProperty["USR_PASSWORD_HISTORY"]); if (!is_array($aHistory)) { $aHistory = array(); } if (!defined("PPP_PASSWORD_HISTORY")) { define("PPP_PASSWORD_HISTORY", 0); } if (PPP_PASSWORD_HISTORY > 0) { //it's looking a password igual into aHistory array that was send for post in md5 way $c = 0; $sw = 1; while (count($aHistory) >= 1 && count($aHistory) > $c && $sw) { if (strcmp(trim($aHistory[$c]), trim($arrayData['USR_PASSWORD'])) == 0) { $sw = 0; } $c++; } if ($sw == 0) { $sDescription = G::LoadTranslation("ID_POLICY_ALERT") . ":\n\n"; $sDescription = $sDescription . " - " . G::LoadTranslation("PASSWORD_HISTORY") . ": " . PPP_PASSWORD_HISTORY . "\n"; $sDescription = $sDescription . "\n" . G::LoadTranslation("ID_PLEASE_CHANGE_PASSWORD_POLICY") . ""; throw new \Exception($this->arrayFieldNameForException["usrNewPass"] . ": " . $sDescription); } if (count($aHistory) >= PPP_PASSWORD_HISTORY) { $sLastPassw = array_shift($aHistory); } $aHistory[] = $arrayData["USR_PASSWORD"]; } $aUserProperty["USR_LAST_UPDATE_DATE"] = date("Y-m-d H:i:s"); $aUserProperty["USR_LOGGED_NEXT_TIME"] = $arrayData["USR_LOGGED_NEXT_TIME"]; $aUserProperty["USR_PASSWORD_HISTORY"] = serialize($aHistory); $userProperty->update($aUserProperty); } else { $flagUserLoggedNextTime = true; } } else { $flagUserLoggedNextTime = true; } if ($flagUserLoggedNextTime) { //require_once "classes/model/Users.php"; $oUser = new \Users(); $aUser = $oUser->load($userUid); //require_once "classes/model/UsersProperties.php"; $oUserProperty = new \UsersProperties(); $aUserProperty = $oUserProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array($aUser["USR_PASSWORD"])))); $aUserProperty["USR_LOGGED_NEXT_TIME"] = $arrayData["USR_LOGGED_NEXT_TIME"]; $oUserProperty->update($aUserProperty); } //Update in rbac if (isset($arrayData["USR_ROLE"])) { $rbac->updateUser($arrayData, $arrayData["USR_ROLE"]); } else { $rbac->updateUser($arrayData); } //Update in workflow $result = $user->update($arrayData); //Save Calendar assigment if (isset($arrayData["USR_CALENDAR"])) { //Save Calendar ID for this user \G::LoadClass("calendar"); $calendar = new \Calendar(); $calendar->assignCalendarTo($userUid, $arrayData["USR_CALENDAR"], "USER"); } //Return $arrayData = $arrayDataBackup; if (!$this->formatFieldNameInUppercase) { $arrayData = array_change_key_case($arrayData, CASE_LOWER); } return $arrayData; } catch (\Exception $e) { $cnn->rollback(); throw $e; } } catch (\Exception $e) { throw $e; } }
/** * lista de usuarios a reasignar */ public function getUsersToReassign($usr_uid, $task_uid) { //G::LoadClass( 'tasks' ); G::LoadSystem( 'rbac' ); G::LoadClass( 'memcached' ); $memcache = \PMmemcached::getSingleton( SYS_SYS ); $RBAC = \RBAC::getSingleton( PATH_DATA, session_id() ); $RBAC->sSystem = 'PROCESSMAKER'; $RBAC->initRBAC(); $memKey = 'rbacSession' . session_id(); if (($RBAC->aUserInfo = $memcache->get( $memKey )) === false) { $RBAC->loadUserRolePermission( $RBAC->sSystem, $usr_uid ); $memcache->set( $memKey, $RBAC->aUserInfo, \PMmemcached::EIGHT_HOURS ); } $GLOBALS['RBAC'] = $RBAC; $task = new \Task(); $tasks = $task->load($task_uid); $case = new \Cases(); $result = new \stdclass(); $result->data = $case->getUsersToReassign($task_uid, $usr_uid, $tasks['PRO_UID']); return $result; }
function getCasesCountInAllProcesses() { /*SELECT PRO_UID, APP_STATUS, COUNT( * ) FROM APPLICATION GROUP BY PRO_UID, APP_STATUS*/ require_once 'classes/model/Application.php'; $memcache =& PMmemcached::getSingleton(SYS_SYS); $memkey = 'getCasesCountInAllProcesses'; if (($aProcesses = $memcache->get($memkey)) === false) { $oCriteria = new Criteria('workflow'); $oCriteria->addSelectColumn(ApplicationPeer::PRO_UID); $oCriteria->addSelectColumn(ApplicationPeer::APP_STATUS); $oCriteria->addSelectColumn('COUNT(*) AS CNT'); $oCriteria->addGroupByColumn(ApplicationPeer::PRO_UID); $oCriteria->addGroupByColumn(ApplicationPeer::APP_STATUS); $oDataset = ProcessPeer::doSelectRS($oCriteria); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $aProcesses = array(); while ($oDataset->next()) { $row = $oDataset->getRow(); $aProcesses[$row['PRO_UID']][$row['APP_STATUS']] = $row['CNT']; } $memcache->set($memkey, $aProcesses, PMmemcached::ONE_HOUR); } return $aProcesses; }
/** * Load all Process * * @param array $arrayFilterData * @param int $start * @param int $limit * * return array Return data array with the Process * * @access public */ public function loadAllProcess($arrayFilterData = array(), $start = 0, $limit = 25) { //Copy of processmaker/workflow/engine/methods/processes/processesList.php $process = new \Process(); $memcache = &\PMmemcached::getSingleton(SYS_SYS); $memkey = "no memcache"; $memcacheUsed = "not used"; $totalCount = 0; if (isset($arrayFilterData["category"]) && $arrayFilterData["category"] !== "<reset>") { if (isset($arrayFilterData["processName"])) { $proData = $process->getAllProcesses($start, $limit, $arrayFilterData["category"], $arrayFilterData["processName"]); } else { $proData = $process->getAllProcesses($start, $limit, $arrayFilterData["category"]); } } else { if (isset($arrayFilterData["processName"])) { $memkey = "processList-" . $start . "-" . $limit . "-" . $arrayFilterData["processName"]; $memcacheUsed = "yes"; if (($proData = $memcache->get($memkey)) === false) { $proData = $process->getAllProcesses($start, $limit, null, $arrayFilterData["processName"]); $memcache->set($memkey, $proData, \PMmemcached::ONE_HOUR); $memcacheUsed = "no"; } } else { $memkey = "processList-allProcesses-" . $start . "-" . $limit; $memkeyTotal = $memkey . "-total"; $memcacheUsed = "yes"; if (($proData = $memcache->get($memkey)) === false || ($totalCount = $memcache->get($memkeyTotal)) === false) { $proData = $process->getAllProcesses($start, $limit); $totalCount = $process->getAllProcessesCount(); $memcache->set($memkey, $proData, \PMmemcached::ONE_HOUR); $memcache->set($memkeyTotal, $totalCount, \PMmemcached::ONE_HOUR); $memcacheUsed = "no"; } } } $arrayData = array( "memkey" => $memkey, "memcache" => $memcacheUsed, "data" => $proData, "totalCount" => $totalCount ); return $arrayData; }