mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Fix #990 : add check on posix support for pcntl
This commit is contained in:
@@ -39,6 +39,7 @@ class setup
|
|||||||
, 'pcntl'
|
, 'pcntl'
|
||||||
, "PDO"
|
, "PDO"
|
||||||
, "phrasea2"
|
, "phrasea2"
|
||||||
|
, 'posix'
|
||||||
, "SimpleXML"
|
, "SimpleXML"
|
||||||
, "sockets"
|
, "sockets"
|
||||||
, "xml"
|
, "xml"
|
||||||
@@ -375,7 +376,7 @@ class setup
|
|||||||
$constraints = array();
|
$constraints = array();
|
||||||
foreach (self::$PHP_EXT as $ext) {
|
foreach (self::$PHP_EXT as $ext) {
|
||||||
|
|
||||||
if ('pcntl' === $ext && 0 === stripos(strtolower(PHP_OS), 'win')) {
|
if (in_array($ext, array('pcntl', 'posix')) && defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,10 +65,9 @@ class task_Scheduler
|
|||||||
$nullfile = 'NUL';
|
$nullfile = 'NUL';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists('pcntl_fork')) {
|
if (\task_manager::isPosixPcntlSupported()) {
|
||||||
// avoid <defunct> php when a task ends
|
// avoid <defunct> php when a task ends
|
||||||
pcntl_signal(SIGCHLD, SIG_IGN);
|
pcntl_signal(SIGCHLD, SIG_IGN);
|
||||||
|
|
||||||
$this->method = self::METHOD_FORK;
|
$this->method = self::METHOD_FORK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -193,6 +193,16 @@ class task_manager
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if Pcntl posix supported is enabled, false otherwise
|
||||||
|
*
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
public static function isPosixPcntlSupported()
|
||||||
|
{
|
||||||
|
return extension_loaded('pcntl') && extension_loaded('posix');
|
||||||
|
}
|
||||||
|
|
||||||
public static function getAvailableTasks()
|
public static function getAvailableTasks()
|
||||||
{
|
{
|
||||||
$taskdir = array(
|
$taskdir = array(
|
||||||
|
Reference in New Issue
Block a user