satanasov /
phpbbgallery
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * phpBB Gallery - Core Extension |
||
| 4 | * |
||
| 5 | * @package phpbbgallery/core |
||
| 6 | * @author nickvergessen |
||
| 7 | * @author satanasov |
||
| 8 | * @author Leinad4Mind |
||
| 9 | * @author DreadDendy |
||
| 10 | * @copyright 2018- Leinad4Mind, 2022 DreadDendy |
||
| 11 | * @license GPL-2.0-only |
||
| 12 | */ |
||
| 13 | |||
| 14 | namespace phpbbgallery\core\cron; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * phpbbgallery cron task. |
||
| 18 | */ |
||
| 19 | class cron_cleaner extends \phpbb\cron\task\base |
||
|
0 ignored issues
–
show
|
|||
| 20 | { |
||
| 21 | /** @var \phpbbgallery\core\config */ |
||
| 22 | protected $gallery_config; |
||
| 23 | |||
| 24 | /** @var \phpbbgallery\core\upload */ |
||
| 25 | protected $gallery_upload; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Constructor |
||
| 29 | * |
||
| 30 | * @param \phpbbgallery\core\config $gallery_config |
||
| 31 | * @param \phpbbgallery\core\upload $gallery_upload |
||
| 32 | * @access public |
||
| 33 | */ |
||
| 34 | public function __construct(\phpbbgallery\core\config $gallery_config, \phpbbgallery\core\upload $gallery_upload) |
||
| 35 | { |
||
| 36 | $this->gallery_config = $gallery_config; |
||
| 37 | $this->gallery_upload = $gallery_upload; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritDoc} |
||
| 42 | */ |
||
| 43 | public function run() |
||
| 44 | { |
||
| 45 | $this->gallery_upload->prune_orphan(); |
||
| 46 | $this->gallery_config->set('prune_orphan_time', time()); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * {@inheritDoc} |
||
| 51 | */ |
||
| 52 | public function should_run() |
||
| 53 | { |
||
| 54 | return $this->gallery_config->get('prune_orphan_time') < strtotime('24 hours ago'); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * {@inheritDoc} |
||
| 59 | */ |
||
| 60 | public function is_runnable() |
||
| 61 | { |
||
| 62 | return true; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths