*/
public $template_engine_instance = array();
public $process_id;
+ public $queue;
private $ldelim = array(
'internal' => '',
'smarty3' => '{{'
$this->hostname = Config::get('config', 'hostname');
}
- if (!isset($this->hostname) OR ( $this->hostname == '')) {
+ if (!isset($this->hostname) || ( $this->hostname == '')) {
$this->hostname = $hostname;
}
}
*
* @return string
*/
- function callstack() {
- $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 6);
+ function callstack($depth = 4) {
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $depth + 2);
// We remove the first two items from the list since they contain data that we don't need.
array_shift($trace);
* @return bool Is the limit reached?
*/
function max_processes_reached() {
+ // Deactivated, needs more investigating if this check really makes sense
+ return false;
if ($this->is_backend()) {
$process = 'backend';
$meminfo[$key] = (int) ($meminfo[$key] / 1024);
}
- if (!isset($meminfo['MemAvailable']) OR ! isset($meminfo['MemFree'])) {
+ if (!isset($meminfo['MemAvailable']) || ! isset($meminfo['MemFree'])) {
return false;
}
return;
}
- // If the last worker fork was less than 10 seconds before then don't fork another one.
+ // If the last worker fork was less than 2 seconds before then don't fork another one.
// This should prevent the forking of masses of workers.
$cachekey = 'app:proc_run:started';
$result = Cache::get($cachekey);
- if (!is_null($result) AND ( time() - $result) < 10) {
+ if (!is_null($result) && ( time() - $result) < 2) {
return;
}
* @return string system username
*/
static function systemuser() {
- if (!function_exists('posix_getpwuid') OR ! function_exists('posix_geteuid')) {
+ if (!function_exists('posix_getpwuid') || ! function_exists('posix_geteuid')) {
return '';
}
logger('Path "' . $directory . '" is not a directory for user ' . self::systemuser(), LOGGER_DEBUG);
return false;
}
- if ($check_writable AND !is_writable($directory)) {
+ if ($check_writable && !is_writable($directory)) {
logger('Path "' . $directory . '" is not writable for user ' . self::systemuser(), LOGGER_DEBUG);
return false;
}