Configure::__list() fix for undefined variable

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5578 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-08-24 17:00:32 +00:00
parent 1326d20792
commit 2e60a4d2f1

View file

@ -150,6 +150,7 @@ class Configure extends Object {
if(!class_exists('folder')) { if(!class_exists('folder')) {
uses('folder'); uses('folder');
} }
$items = array();
$Folder =& new Folder($path); $Folder =& new Folder($path);
$contents = $Folder->read(false, true); $contents = $Folder->read(false, true);
if(is_array($contents)) { if(is_array($contents)) {
@ -158,13 +159,12 @@ class Configure extends Object {
} else { } else {
foreach($contents[1] as $item) { foreach($contents[1] as $item) {
if (substr($item, -strlen($suffix)) == $suffix) { if (substr($item, -strlen($suffix)) == $suffix) {
$item = substr($item, 0, strlen($item) - strlen($suffix)); $items[] = substr($item, 0, strlen($item) - strlen($suffix));
$items[] = $item;
} }
} }
return $items;
} }
} }
return $items;
} }
/** /**
* Used to write a dynamic var in the Configure instance. * Used to write a dynamic var in the Configure instance.