/** * Get path * @return string */ public function getPath() { $cur_path = $this->m_data['path']; if (0 === strpos($cur_path, WWW_DIR)) { return $cur_path; } return WWW_DIR . WidgetManager::ExtPath() . $this->m_data['path']; }
/** * @param string array $path */ public function __construct($path) { $this->realpath = realpath($path); if ($this->realpath === FALSE || !is_file($this->realpath)) { throw new InvalidArgumentException("File '$this->path' not found."); } $filter = realpath(WWW_DIR . WidgetManager::ExtPath()) . DIR_SEP; $this->path = str_replace($filter, '', $this->realpath); }
/** * Get path * @return string */ public function getPath() { $cur_path = $this->m_data['path']; if (0 === strpos($cur_path, WWW_DIR)) { return $cur_path; } foreach (WidgetManager::ExtPath() as $path) { if (file_exists($file = WWW_DIR . $path . $this->m_data['path'])) { return $file; } } }