Skip to content
This repository was archived by the owner on Aug 11, 2018. It is now read-only.

Find autoload #7

Merged
merged 3 commits into from
Nov 17, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Put default location back
  • Loading branch information
veger committed Nov 16, 2016
commit df88f8cb72b22303c6356e0d5f356c3d4a548e5a
3 changes: 2 additions & 1 deletion php/getfilepath.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
$foundAutoLoader = false;

// First try default location
$autoloader = $rootpath . '/vendor/autoload.php';
if(is_readable($autoloader)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,

I have a question where did this $autoloader is assigned ? Did you missed / accidentally removed https://github.com/harikt/php-hyperclick/pull/7/files#diff-5ef8e23f048e9259d4783d28d2407b5dL5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, you are right!

The default location should be used here, but was deleted by accident.

I have updated the PR

$foundAutoLoader = true;
if(getFilePath($rootpath . '/vendor/autoload.php', $class, $file)) {
exit(0);
}
}

// Try to find autoloader.php elsewhere in $rootpath
// Try to find autoload.php elsewhere in $rootpath
$dirIterator = new RecursiveDirectoryIterator($rootpath);
$reqIterator = new RecursiveIteratorIterator($dirIterator);
$regexIterator = new RegexIterator($reqIterator, '#/vendor/autoload.php$#i');
Expand Down