/** * Add a directory where JModuleHelper should search for module. You may * either pass a string or an array of directories. * * @param string $path A path to search. * * @return array An array with directory elements * * @since 11.1 */ public static function addIncludePath($path = '') { // Force path to array settype($path, 'array'); // Loop through the path directories foreach ($path as $dir) { if (!empty($dir) && !in_array($dir, self::$includePaths)) { jimport('joomla.filesystem.path'); array_unshift(self::$includePaths, JPath::clean($dir)); //fix to override include path priority self::$includePaths = array_reverse(self::$includePaths); } } return self::$includePaths; }