public static function findModule($uri) { foreach (self::$shemaList as $partUri => $uriConfig) { if (Lms_Text::pos($uri, $partUri) === $uriConfig['pos']) { return $uriConfig['name']; } } return self::$defaultModule; }
private function _getPlugin($file) { static $pluginsCache = array(); foreach ($this->plugins as $str => $plugin) { if (Lms_Text::pos($file, $str) === $plugin['pos']) { $module = $plugin['name']; if (!isset($pluginsCache[$module])) { if ($class_name = $this->loadModule($module)) { $pluginsCache[$module] = new $class_name(); } } return $pluginsCache[$module]; } } throw new Lms_Exception('Plugin for "' . $file . '" not found!'); return false; }
/** * Check whether a file is remote * * @param unknown_type $url * @return unknown */ private static function _isRemote($url) { return (bool) (Lms_Text::pos($url, "http://") !== false || Lms_Text::pos($url, "ftp://") !== false); }
private function _SplitToChunks($str, $chunksLimit) { $chunks = array(); while ($chunksLimit-- > 0 && ($pos = Lms_Text::pos($str, " ")) !== false) { $chunks[] = Lms_Text::substring($str, 0, $pos); $str = ltrim(Lms_Text::substring($str, $pos)); } $chunks[] = $str; return $chunks; }