Skip to content

Commit

Permalink
update autoloader def per suggestion of feyzprod
Browse files Browse the repository at this point in the history
  • Loading branch information
PayLeaseBrian committed May 26, 2017
1 parent 0c2128d commit 3ec7274
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},

"autoload" : {
"psr-4" : { "Paysafe\\" : "source/paysafe" }
"files" : ["source/paysafe.php"]
},
"require-dev": {
"phpunit/phpunit": "^5.7"
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion source/paysafe.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@

function __PaysafeAutoloader($className)
{
$classPath = strtolower(str_replace("\\", DIRECTORY_SEPARATOR, $className));
// lc first will make the P in the Paysafe root namespace lower case
// the remainder of the path/file should match case of the namespace/class
$classPath = str_replace("\\", DIRECTORY_SEPARATOR, lcfirst($className));
if (($classFile = realpath(__DIR__ . DIRECTORY_SEPARATOR . $classPath . '.php'))) {
require_once( $classFile );
}
Expand Down

0 comments on commit 3ec7274

Please sign in to comment.