From 381ccff14634a87106991549c705660b78690adf Mon Sep 17 00:00:00 2001 From: nate Date: Tue, 8 Aug 2006 21:17:20 +0000 Subject: [PATCH] Fixing loader loops git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3388 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/basics.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index 94e93edbd..5a5ea8d36 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -456,9 +456,10 @@ */ function uses() { $args = array_reverse(func_get_args()); - $i = func_num_args() - 1; - while ($i >= 0) { - require_once(LIBS . strtolower($args[$i--]) . '.php'); + $c = func_num_args(); + + for ($i = 0; $i < $c; $i++) { + require_once(LIBS . strtolower($args[$i]) . '.php'); } } /** @@ -469,9 +470,10 @@ */ function vendor($name) { $args = array_reverse(func_get_args()); - $i = func_num_args() - 1; - while ($i >= 0) { - $arg = $args[--$i]; + $c = func_num_args(); + + for ($i = 0; $i < $c; $i++) { + $arg = $args[$i]; if (file_exists(APP . 'vendors' . DS . $arg . '.php')) { require_once(APP . 'vendors' . DS . $arg . '.php'); } else {