From 12acf6ab9fd30267d7571f2bf680e4e995e98c09 Mon Sep 17 00:00:00 2001 From: phpnut Date: Tue, 11 Mar 2008 23:53:37 +0000 Subject: [PATCH] "Adding vendors path to corePaths to be used when cake core is placed outside of normal install paths" git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6560 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/configure.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index ed8edd91b..91f80ec1d 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -499,6 +499,9 @@ class Configure extends Object { $paths['cake'][] = $path . DS . 'cake' . DS; $paths['class'][] = $path . DS . 'cake' . DS; } + if (is_dir($path . DS . 'vendors')) { + $paths['vendor'][] = $path . DS . 'vendors' . DS; + } $used[] = $path; } Cache::write('core_paths', array_filter($paths), '_cake_core_'); @@ -596,9 +599,11 @@ class Configure extends Object { $_this->{$pathsVar} = $default; if (isset($paths[$pathsVar]) && !empty($paths[$pathsVar])) { - $_this->{$pathsVar} = array_merge($_this->{$pathsVar}, (array)$paths[$pathsVar], $merge); + $path = array_flip(array_flip((array_merge($_this->{$pathsVar}, (array)$paths[$pathsVar], $merge)))); + $_this->{$pathsVar} = $path; } else { - $_this->{$pathsVar} = array_merge($_this->{$pathsVar}, $merge); + $path = array_flip(array_flip((array_merge($_this->{$pathsVar}, $merge)))); + $_this->{$pathsVar} = $path; } } }