1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-19 15:17:16 +01:00

[feature/plupload/cron] Namespacification

PHPBB3-10929
This commit is contained in:
Andreas Fischer 2013-10-11 15:51:33 +02:00
parent 67530d132a
commit beda12c055
2 changed files with 9 additions and 7 deletions

View File

@ -66,7 +66,7 @@ services:
- { name: cron.task }
cron.task.core.tidy_plupload:
class: phpbb_cron_task_core_tidy_plupload
class: phpbb\cron\task\core\tidy_plupload
arguments:
- %core.root_path%
- @config

View File

@ -7,6 +7,8 @@
*
*/
namespace phpbb\cron\task\core;
/**
* @ignore
*/
@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
class phpbb_cron_task_core_tidy_plupload extends phpbb_cron_task_base
class tidy_plupload extends \phpbb\cron\task\base
{
/**
* How old a file must be (in seconds) before it is deleted.
@ -42,7 +44,7 @@ class phpbb_cron_task_core_tidy_plupload extends phpbb_cron_task_base
/**
* Config object
* @var phpbb_config
* @var \phpbb\config\config
*/
protected $config;
@ -56,9 +58,9 @@ class phpbb_cron_task_core_tidy_plupload extends phpbb_cron_task_base
* Constructor.
*
* @param string $phpbb_root_path The root path
* @param phpbb_config $config The config
* @param \phpbb\config\config $config The config
*/
public function __construct($phpbb_root_path, phpbb_config $config)
public function __construct($phpbb_root_path, \phpbb\config\config $config)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->config = $config;
@ -75,7 +77,7 @@ class phpbb_cron_task_core_tidy_plupload extends phpbb_cron_task_base
$last_valid_timestamp = time() - $this->max_file_age;
try
{
$iterator = new DirectoryIterator($this->plupload_upload_path);
$iterator = new \DirectoryIterator($this->plupload_upload_path);
foreach ($iterator as $file)
{
if (strpos($file->getBasename(), $this->config['plupload_salt']) !== 0)
@ -90,7 +92,7 @@ class phpbb_cron_task_core_tidy_plupload extends phpbb_cron_task_base
}
}
}
catch (UnexpectedValueException $e)
catch (\UnexpectedValueException $e)
{
add_log(
'critical',