|
|
@@ -495,8 +495,8 @@ class View implements EventDispatcherInterface
|
|
|
|
|
|
if (empty($options['ignoreMissing'])) {
|
|
|
list ($plugin, $name) = pluginSplit($name, true);
|
|
|
- $name = str_replace('/', DS, $name);
|
|
|
- $file = $plugin . 'Element' . DS . $name . $this->_ext;
|
|
|
+ $name = str_replace('/', DIRECTORY_SEPARATOR, $name);
|
|
|
+ $file = $plugin . 'Element' . DIRECTORY_SEPARATOR . $name . $this->_ext;
|
|
|
throw new Exception\MissingElementException($file);
|
|
|
}
|
|
|
}
|
|
|
@@ -815,7 +815,7 @@ class View implements EventDispatcherInterface
|
|
|
if (!$parent) {
|
|
|
list($plugin, $name) = $this->pluginSplit($name);
|
|
|
$paths = $this->_paths($plugin);
|
|
|
- $defaultPath = $paths[0] . 'Element' . DS;
|
|
|
+ $defaultPath = $paths[0] . 'Element' . DIRECTORY_SEPARATOR;
|
|
|
throw new LogicException(sprintf(
|
|
|
'You cannot extend an element which does not exist (%s).',
|
|
|
$defaultPath . $name . $this->_ext
|
|
|
@@ -1039,10 +1039,10 @@ class View implements EventDispatcherInterface
|
|
|
$templatePath = $subDir = '';
|
|
|
|
|
|
if ($this->subDir !== null) {
|
|
|
- $subDir = $this->subDir . DS;
|
|
|
+ $subDir = $this->subDir . DIRECTORY_SEPARATOR;
|
|
|
}
|
|
|
if ($this->templatePath) {
|
|
|
- $templatePath = $this->templatePath . DS;
|
|
|
+ $templatePath = $this->templatePath . DIRECTORY_SEPARATOR;
|
|
|
}
|
|
|
|
|
|
if ($name === null) {
|
|
|
@@ -1050,17 +1050,17 @@ class View implements EventDispatcherInterface
|
|
|
}
|
|
|
|
|
|
list($plugin, $name) = $this->pluginSplit($name);
|
|
|
- $name = str_replace('/', DS, $name);
|
|
|
+ $name = str_replace('/', DIRECTORY_SEPARATOR, $name);
|
|
|
|
|
|
- if (strpos($name, DS) === false && $name[0] !== '.') {
|
|
|
+ if (strpos($name, DIRECTORY_SEPARATOR) === false && $name[0] !== '.') {
|
|
|
$name = $templatePath . $subDir . $this->_inflectViewFileName($name);
|
|
|
- } elseif (strpos($name, DS) !== false) {
|
|
|
- if ($name[0] === DS || $name[1] === ':') {
|
|
|
- $name = trim($name, DS);
|
|
|
+ } elseif (strpos($name, DIRECTORY_SEPARATOR) !== false) {
|
|
|
+ if ($name[0] === DIRECTORY_SEPARATOR || $name[1] === ':') {
|
|
|
+ $name = trim($name, DIRECTORY_SEPARATOR);
|
|
|
} elseif (!$plugin || $this->templatePath !== $this->name) {
|
|
|
$name = $templatePath . $subDir . $name;
|
|
|
} else {
|
|
|
- $name = DS . $subDir . $name;
|
|
|
+ $name = DIRECTORY_SEPARATOR . $subDir . $name;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1147,11 +1147,11 @@ class View implements EventDispatcherInterface
|
|
|
$subDir = null;
|
|
|
|
|
|
if ($this->layoutPath) {
|
|
|
- $subDir = $this->layoutPath . DS;
|
|
|
+ $subDir = $this->layoutPath . DIRECTORY_SEPARATOR;
|
|
|
}
|
|
|
list($plugin, $name) = $this->pluginSplit($name);
|
|
|
|
|
|
- $layoutPaths = $this->_getSubPaths('Layout' . DS . $subDir);
|
|
|
+ $layoutPaths = $this->_getSubPaths('Layout' . DIRECTORY_SEPARATOR . $subDir);
|
|
|
|
|
|
foreach ($this->_paths($plugin) as $path) {
|
|
|
foreach ($layoutPaths as $layoutPath) {
|
|
|
@@ -1181,8 +1181,8 @@ class View implements EventDispatcherInterface
|
|
|
|
|
|
foreach ($paths as $path) {
|
|
|
foreach ($elementPaths as $elementPath) {
|
|
|
- if (file_exists($path . $elementPath . DS . $name . $this->_ext)) {
|
|
|
- return $path . $elementPath . DS . $name . $this->_ext;
|
|
|
+ if (file_exists($path . $elementPath . DIRECTORY_SEPARATOR . $name . $this->_ext)) {
|
|
|
+ return $path . $elementPath . DIRECTORY_SEPARATOR . $name . $this->_ext;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1207,7 +1207,7 @@ class View implements EventDispatcherInterface
|
|
|
$prefixPath = explode('/', $this->request->params['prefix']);
|
|
|
$path = '';
|
|
|
foreach ($prefixPath as $prefixPart) {
|
|
|
- $path .= Inflector::camelize($prefixPart) . DS;
|
|
|
+ $path .= Inflector::camelize($prefixPart) . DIRECTORY_SEPARATOR;
|
|
|
|
|
|
array_unshift(
|
|
|
$paths,
|
|
|
@@ -1240,7 +1240,7 @@ class View implements EventDispatcherInterface
|
|
|
$pluginPaths = $themePaths = [];
|
|
|
if (!empty($plugin)) {
|
|
|
for ($i = 0, $count = count($templatePaths); $i < $count; $i++) {
|
|
|
- $pluginPaths[] = $templatePaths[$i] . 'Plugin' . DS . $plugin . DS;
|
|
|
+ $pluginPaths[] = $templatePaths[$i] . 'Plugin' . DIRECTORY_SEPARATOR . $plugin . DIRECTORY_SEPARATOR;
|
|
|
}
|
|
|
$pluginPaths = array_merge($pluginPaths, App::path('Template', $plugin));
|
|
|
}
|
|
|
@@ -1250,7 +1250,7 @@ class View implements EventDispatcherInterface
|
|
|
|
|
|
if ($plugin) {
|
|
|
for ($i = 0, $count = count($themePaths); $i < $count; $i++) {
|
|
|
- array_unshift($themePaths, $themePaths[$i] . 'Plugin' . DS . $plugin . DS);
|
|
|
+ array_unshift($themePaths, $themePaths[$i] . 'Plugin' . DIRECTORY_SEPARATOR . $plugin . DIRECTORY_SEPARATOR);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -1259,7 +1259,7 @@ class View implements EventDispatcherInterface
|
|
|
$themePaths,
|
|
|
$pluginPaths,
|
|
|
$templatePaths,
|
|
|
- [dirname(__DIR__) . DS . 'Template' . DS]
|
|
|
+ [dirname(__DIR__) . DIRECTORY_SEPARATOR . 'Template' . DIRECTORY_SEPARATOR]
|
|
|
);
|
|
|
|
|
|
if ($plugin !== null) {
|