Files
Phraseanet/lib/Alchemy/Phrasea/Setup/Requirements/FilesystemRequirements.php
Aina Sitraka 59a60ba8ac PHRAS-3796 bin/setup check:system - download , lazaret, wrong repo is checked (#4349)
* fix directory check

* fix test

* PHRAS-3882 change filter order
2023-07-26 20:48:06 +02:00

50 lines
1.5 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Setup\Requirements;
use Alchemy\Phrasea\Core\Configuration\PropertyAccess;
use Alchemy\Phrasea\Setup\RequirementCollection;
class FilesystemRequirements extends RequirementCollection implements RequirementInterface
{
public function __construct(PropertyAccess $conf)
{
$baseDir = realpath(__DIR__ . '/../../../../../');
$this->setName('Filesystem');
$paths = [
$baseDir . '/config',
$baseDir . '/config/stamp',
$baseDir . '/config/status',
$baseDir . '/config/minilogos',
$baseDir . '/config/wm',
$conf->get(['main', 'storage', 'log']),
$baseDir . '/tmp',
$baseDir . '/tmp/locks',
$conf->get(['main', 'storage', 'caption']),
$conf->get(['main', 'storage', 'lazaret']),
$conf->get(['main', 'storage', 'download']),
$conf->get(['main', 'storage', 'cache']),
$baseDir . '/www/custom',
];
foreach ($paths as $path) {
$this->addRequirement(
is_writable($path),
"$path directory must be writable",
"Change the permissions of the \"<strong>$path</strong>\" directory so that the web server can write into it."
);
}
}
}