Skip to content

Commit

Permalink
Fix for Windows environments
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Jun 17, 2016
1 parent ad21ce7 commit f8f087e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controller/jobs/src/Controller/Jobs/Factory.php
Expand Up @@ -84,17 +84,17 @@ static public function createController( \Aimeos\MShop\Context\Item\Iface $conte
static public function getControllers( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, array $cntlPaths )
{
$cntlList = array();
$subFolder = trim( str_replace( '\\', DIRECTORY_SEPARATOR, self::$prefix ), DIRECTORY_SEPARATOR );
$subFolder = trim( str_replace( '\\', '/', self::$prefix ), '/' );

if( strncmp( $subFolder, 'Aimeos' . DIRECTORY_SEPARATOR, 7 ) === 0 ) {
if( strncmp( $subFolder, 'Aimeos' . '/', 7 ) === 0 ) {
$subFolder = substr( $subFolder, 7 );
}

foreach( $cntlPaths as $path => $list )
{
foreach( $list as $relpath )
{
$path .= DIRECTORY_SEPARATOR . $relpath . DIRECTORY_SEPARATOR . $subFolder;
$path .= DIRECTORY_SEPARATOR . str_replace( '/', DIRECTORY_SEPARATOR, $relpath . '/' . $subFolder );

if( is_dir( $path ) )
{
Expand Down Expand Up @@ -132,7 +132,7 @@ static protected function createControllers( \DirectoryIterator $dir, \Aimeos\MS
{
$name = strtolower( $entry->getBaseName() );
$it = new \DirectoryIterator( $entry->getPathName() );
$pref = ( $prefix !== '' ? $prefix . DIRECTORY_SEPARATOR : '' ) . $name;
$pref = ( $prefix !== '' ? $prefix . '/' : '' ) . $name;
$subList = self::createControllers( $it, $context, $aimeos, $pref );

$list = array_merge( $list, $subList );
Expand Down

0 comments on commit f8f087e

Please sign in to comment.