diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-05-19 12:31:06 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-05-19 22:34:18 -0400 |
commit | f231590c7b39a8e8503bcc3a7c9db593dde339dd (patch) | |
tree | 645456ea7d77cd6e48a2a66f716e7b09b0ce35f1 /phpBB/includes/cron | |
parent | 52c4726b5b8bf762b56d0fa06b24e09003d74811 (diff) | |
download | forums-f231590c7b39a8e8503bcc3a7c9db593dde339dd.tar forums-f231590c7b39a8e8503bcc3a7c9db593dde339dd.tar.gz forums-f231590c7b39a8e8503bcc3a7c9db593dde339dd.tar.bz2 forums-f231590c7b39a8e8503bcc3a7c9db593dde339dd.tar.xz forums-f231590c7b39a8e8503bcc3a7c9db593dde339dd.zip |
[ticket/10156] Fix new cron on windows.
PHPBB3-10156
Diffstat (limited to 'phpBB/includes/cron')
-rw-r--r-- | phpBB/includes/cron/manager.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/phpBB/includes/cron/manager.php b/phpBB/includes/cron/manager.php index 21dcb91695..31be1a69cb 100644 --- a/phpBB/includes/cron/manager.php +++ b/phpBB/includes/cron/manager.php @@ -73,6 +73,14 @@ class phpbb_cron_manager */ public function __construct($task_path, $phpEx, phpbb_cache_driver_interface $cache = null) { + if (DIRECTORY_SEPARATOR != '/') + { + // Need this on some platforms since the code elsewhere uses / + // to separate directory components, but PHP iterators return + // paths with platform-specific directory separators. + $task_path = str_replace('/', DIRECTORY_SEPARATOR, $task_path); + } + $this->task_path = $task_path; $this->phpEx = $phpEx; $this->cache = $cache; @@ -116,9 +124,9 @@ class phpbb_cron_manager $file = preg_replace('#^' . preg_quote($this->task_path, '#') . '#', '', $fileinfo->getPathname()); // skip directories and files direclty in the task root path - if ($fileinfo->isFile() && strpos($file, '/') !== false) + if ($fileinfo->isFile() && strpos($file, DIRECTORY_SEPARATOR) !== false) { - $task_name = str_replace('/', '_', substr($file, 0, -$ext_length)); + $task_name = str_replace(DIRECTORY_SEPARATOR, '_', substr($file, 0, -$ext_length)); if (substr($file, -$ext_length) == $ext && $this->is_valid_name($task_name)) { $task_names[] = 'phpbb_cron_task_' . $task_name; |