AAAAhome/academiac/www/administrator/components/com_csvi/helpers/com_redshop_config.php000060400000003036151453151210025054 0ustar00_redshopcfgfile = JPATH_ADMINISTRATOR.'/components/com_redshop/helpers/redshop.cfg.php'; $this->_redshopcfg = file($this->_redshopcfgfile); } /** * Finds a given redSHOP setting * @var string $setting The config value to find * @return string the value of the config setting */ public function get($setting) { $key = $this->array_find($setting, $this->_redshopcfg); if ($key) { $find_setting = explode('\', \'', $this->_redshopcfg[$key]); return substr(trim($find_setting[1]), 0, -3); } else return false; } /** * Searched the array for a partial value * @return mixed Array key if found otherwise false */ private function array_find($needle, $haystack) { foreach ($haystack as $key => $item) { if (stripos($item, $needle) !== FALSE) { return $key; break; } } // Nothing found return false return false; } } ?>