Skip to content
Snippets Groups Projects
Verified Commit 28b29f46 authored by Damien's avatar Damien
Browse files

FEAT #13671 TIME 0:45 add control

parent 733717fd
No related branches found
No related tags found
No related merge requests found
......@@ -253,19 +253,21 @@ class DocserverController
];
}
public static function createPathOnDocServer(array $aArgs)
public static function createPathOnDocServer(array $args)
{
ValidatorModel::notEmpty($aArgs, ['path']);
ValidatorModel::stringType($aArgs, ['path']);
ValidatorModel::notEmpty($args, ['path']);
ValidatorModel::stringType($args, ['path']);
if (!is_dir($aArgs['path'])) {
return ['errors' => '[createPathOnDocServer] Path does not exist ' . $aArgs['path']];
if (!is_dir($args['path'])) {
return ['errors' => '[createPathOnDocServer] Path does not exist : ' . $args['path']];
} elseif (!is_readable($args['path']) || !is_writable($args['path'])) {
return ['errors' => '[createPathOnDocServer] Path is not readable or writable : ' . $args['path']];
}
error_reporting(0);
umask(0022);
$yearPath = $aArgs['path'] . date('Y') . '/';
$yearPath = $args['path'] . date('Y') . '/';
if (!is_dir($yearPath)) {
mkdir($yearPath, 0770);
if (DIRECTORY_SEPARATOR == '/' && !empty($GLOBALS['apacheUserAndGroup'])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment