Skip to content

Commit

Permalink
Consistently use DS
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Dec 20, 2014
1 parent d97e4b7 commit 6af1af1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Core/ClassLoader.php
Expand Up @@ -50,8 +50,8 @@ public function register() {
public function addNamespace($prefix, $baseDir, $prepend = false) {
$prefix = trim($prefix, '\\') . '\\';

$baseDir = rtrim($baseDir, '/') . DIRECTORY_SEPARATOR;
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/';
$baseDir = rtrim($baseDir, '/') . DS;
$baseDir = rtrim($baseDir, DS) . '/';

if (!isset($this->_prefixes[$prefix])) {
$this->_prefixes[$prefix] = [];
Expand Down Expand Up @@ -103,7 +103,7 @@ protected function _loadMappedFile($prefix, $relativeClass) {
}

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

if ($this->_requireFile($file)) {
return $file;
Expand Down
2 changes: 1 addition & 1 deletion src/Filesystem/File.php
Expand Up @@ -198,7 +198,7 @@ public function offset($offset = false, $seek = SEEK_SET) {
*/
public static function prepare($data, $forceWindows = false) {
$lineBreak = "\n";
if (DIRECTORY_SEPARATOR === '\\' || $forceWindows === true) {
if (DS === '\\' || $forceWindows === true) {
$lineBreak = "\r\n";
}
return strtr($data, array("\r\n" => $lineBreak, "\n" => $lineBreak, "\r" => $lineBreak));
Expand Down
2 changes: 1 addition & 1 deletion src/Shell/ServerShell.php
Expand Up @@ -92,7 +92,7 @@ public function startup() {
}

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

0 comments on commit 6af1af1

Please sign in to comment.