Skip to content

Commit

Permalink
Use DIRECTORY_SEPARATOR instead of assuming unix
Browse files Browse the repository at this point in the history
  • Loading branch information
reynolek committed Jun 2, 2017
1 parent 6632c58 commit 840ee3f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/autoload.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

function atws_autoload($class) {
$dirSep = DIRECTORY_SEPARATOR;
$namespaceParts = explode('\\', $class);
$className = array_pop($namespaceParts);

array_shift($namespaceParts);
require_once __DIR__ . '/' . implode('/', $namespaceParts) . "/{$className}.php";
require_once __DIR__ . $dirSep . implode($dirSep, $namespaceParts) . "{$className}.php";
}

spl_autoload_register('atws_autoload');

0 comments on commit 840ee3f

Please sign in to comment.