Skip to content

Commit e8d6894

Browse files
authored
Merge pull request #305 from Geolim4/final
Fixed standalone autoload issue
2 parents c691a4e + 2a9fd90 commit e8d6894

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/autoload.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
define('PFC_PHP_EXT', 'php');
16-
define('PFC_BIN_DIR', __DIR__ . '../bin/legacy/');
16+
define('PFC_BIN_DIR', __DIR__ . '/../bin/');
1717

1818
/**
1919
* Register Autoload
@@ -27,15 +27,14 @@
2727
*/
2828
return;
2929
} else if (strpos($entity, 'Psr\Cache') === 0) {
30-
$entity = str_replace('\\', '/', $entity);
31-
$path = PFC_BIN_DIR . $entity . '.' . PFC_PHP_EXT;
30+
$path = PFC_BIN_DIR . 'legacy/Psr/Cache/src/' . substr(strrchr($entity, '\\'), 1) . '.' . PFC_PHP_EXT;
3231

3332
if (is_readable($path)) {
3433
require_once $path;
3534
}else{
3635
trigger_error('Cannot locate the Psr/Cache files', E_USER_ERROR);
37-
return;
3836
}
37+
return;
3938
}
4039

4140
$entity = str_replace('\\', '/', $entity);

0 commit comments

Comments
 (0)