Skip to content

Commit

Permalink
Change limits of recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHolbrook committed Mar 21, 2017
1 parent 5c8d54c commit 0ea8cb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Automatically and recursively require_once all php files in a given directory.",
"type": "library",
"license": "UNLICENSE",
"version": "2.0.3",
"version": "2.0.4",
"authors": [
{
"name": "A7",
Expand Down
6 changes: 3 additions & 3 deletions src/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ function autoload( $directory, $recurse = false ) {
$recurse_depth++;
}

if ( $recurse_depth > 5 ) {
trigger_error( 'Using autoload for more than 5 directories is not recommended', E_USER_WARNING );
if ( $recurse_depth > 10 ) {
trigger_error( 'Using autoload for more than 10 directories is not recommended', E_USER_WARNING );
}

if ( $recurse_depth > 7 ) {
if ( $recurse_depth > 15 ) {
throw new \Exception( 'Maximum recurse depth reached for autoload.' );
}

Expand Down

0 comments on commit 0ea8cb6

Please sign in to comment.