Skip to content

Commit 6af1af1

Browse files
author
euromark
committed
Consistently use DS
1 parent d97e4b7 commit 6af1af1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Core/ClassLoader.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function register() {
5050
public function addNamespace($prefix, $baseDir, $prepend = false) {
5151
$prefix = trim($prefix, '\\') . '\\';
5252

53-
$baseDir = rtrim($baseDir, '/') . DIRECTORY_SEPARATOR;
54-
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/';
53+
$baseDir = rtrim($baseDir, '/') . DS;
54+
$baseDir = rtrim($baseDir, DS) . '/';
5555

5656
if (!isset($this->_prefixes[$prefix])) {
5757
$this->_prefixes[$prefix] = [];
@@ -103,7 +103,7 @@ protected function _loadMappedFile($prefix, $relativeClass) {
103103
}
104104

105105
foreach ($this->_prefixes[$prefix] as $baseDir) {
106-
$file = $baseDir . str_replace('\\', DIRECTORY_SEPARATOR, $relativeClass) . '.php';
106+
$file = $baseDir . str_replace('\\', DS, $relativeClass) . '.php';
107107

108108
if ($this->_requireFile($file)) {
109109
return $file;

src/Filesystem/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public function offset($offset = false, $seek = SEEK_SET) {
198198
*/
199199
public static function prepare($data, $forceWindows = false) {
200200
$lineBreak = "\n";
201-
if (DIRECTORY_SEPARATOR === '\\' || $forceWindows === true) {
201+
if (DS === '\\' || $forceWindows === true) {
202202
$lineBreak = "\r\n";
203203
}
204204
return strtr($data, array("\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak));

src/Shell/ServerShell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function startup() {
9292
}
9393

9494
// for windows
95-
if (substr($this->_documentRoot, -1, 1) === DIRECTORY_SEPARATOR) {
95+
if (substr($this->_documentRoot, -1, 1) === DS) {
9696
$this->_documentRoot = substr($this->_documentRoot, 0, strlen($this->_documentRoot) - 1);
9797
}
9898
if (preg_match("/^([a-z]:)[\\\]+(.+)$/i", $this->_documentRoot, $m)) {

0 commit comments

Comments
 (0)