public function getList() { $result = array(); $libsDir = Miao_Config::Main()->get('paths.libs'); $list = $this->_rglob('*Office/classes', GLOB_ONLYDIR, $libsDir); foreach ($list as $key => $value) { if (false !== strpos($value, 'tests/sources')) { unset($list[$key]); } if (false !== strpos($value, 'miao/')) { unset($list[$key]); } } $classesList = array(); foreach ($list as $path) { $tmp = $this->_rglob('*', 0, $path); foreach ($tmp as $item) { $isControl = false !== strpos($item, '/View/') || false !== strpos($item, '/ViewBlock/') || false !== strpos($item, '/Action/'); if (is_file($item) && $isControl) { $className = $this->_extractClassName($item); $classesList[] = $className; } } } $result = array_unique($classesList); return $result; }
protected function __construct(Miao_Office_DataHelper_Url $dhUrl, $dstFolder) { $this->_dataHelperUrl = $dhUrl; $this->_dstFolder = $dstFolder; $this->_buildTimestamp = Miao_Config::Main()->get('timestamp'); $this->_init(); }
public function getLog() { if (empty($this->_log)) { $logFilename = Miao_Config::Main()->get('paths.logs') . '/pdo_log'; $this->_log = Miao_Log::easyFactory($logFilename); } return $this->_log; }
protected function _makeLinks(array $fileList) { $result = array(); $search = $this->_dstFolder . DIRECTORY_SEPARATOR; $replace = ''; foreach ($fileList as $value) { $query = 't=' . Miao_Config::Main()->get('timestamp'); $result[] = $this->_dataHelperUrl->src(str_replace($search, $replace, $value), $query); } return $result; }
public function testMain() { $config = Miao_Config::Main(); $this->assertInstanceOf('Miao_Config_Base', $config); $this->assertTrue(is_array($config->get('paths'))); }
public function getDefaultConfig() { $dir = dirname(__FILE__); $dir = Miao_Config::Main()->get('paths.shared') . '/acs'; $dbFilename = $dir . '/db.sqlite'; $logFilename = Miao_Config::Main()->get('paths.logs') . '/acs_log'; $result = array('adapterClassName' => 'Miaox_Acs_Adapter_Db', 'log' => array('enabled' => true, 'filename' => $logFilename, 'verbose' => false), 'pdo' => array('dsn' => 'sqlite:' . $dbFilename, 'username' => '', 'password' => '', 'options' => array())); return $result; }
/** * Includes template with given filename, relative from DocumentRoot * directory, * and returns parsed content. * MUST be used inside templates in protected scope of TemplatesEngine * class. * * @param string $relativePath * @return string */ protected function _ssiVirtualInternal($relativePath) { $project_root = Miao_Config::Main()->get('paths.shared'); $absolutePath = $project_root . $relativePath; return $this->_returnParsedTemplate($absolutePath); }
public static function getTempPath() { $result = Miao_Config::Main()->get('/build/paths/tmp'); return $result; }