22 $path = rtrim(strtr(
$path,
'/\\', $ds . $ds), $ds);
23 if (strpos($ds .
$path,
"{$ds}.") ===
false && strpos(
$path,
"{$ds}{$ds}") ===
false) {
27 return $this->realpath($ds,
$path);
37 private function realpath($ds,
$path)
40 foreach (explode($ds,
$path) as $part) {
41 if ($part ===
'..' && !empty($parts) && end($parts) !==
'..') {
43 }
elseif ($part ===
'.' || $part ===
'' && !empty($parts)) {
50 $path = implode($ds, $parts);
69 $parentDir = dirname(
$path);
71 if ($recursive && !
is_dir($parentDir) && $parentDir !==
$path) {
79 }
catch (\Exception $e) {
81 throw new \Exception(
"Failed to create directory \"$path\"");
87 }
catch (\Exception $e) {
88 throw new \Exception(
"Failed to change permissions for directory \"$path\"");
elseif(isset( $params[ 'redirect_parent']))
normalizePath($path, $ds=DIRECTORY_SEPARATOR)
if($exist=($block->getProductCollection() && $block->getProductCollection() ->getSize())) $mode
mkdir($pathname, $mode=0777, $recursive=false, $context=null)
createFile($filename, $content)
createDirectory($path, $mode=0775, $recursive=true)