Beispiel #1
0
 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;
 }
Beispiel #2
0
 protected function __construct(Miao_Office_DataHelper_Url $dhUrl, $dstFolder)
 {
     $this->_dataHelperUrl = $dhUrl;
     $this->_dstFolder = $dstFolder;
     $this->_buildTimestamp = Miao_Config::Main()->get('timestamp');
     $this->_init();
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 public function testMain()
 {
     $config = Miao_Config::Main();
     $this->assertInstanceOf('Miao_Config_Base', $config);
     $this->assertTrue(is_array($config->get('paths')));
 }
Beispiel #6
0
 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;
 }
Beispiel #7
0
 /**
  * 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);
 }
Beispiel #8
0
 public static function getTempPath()
 {
     $result = Miao_Config::Main()->get('/build/paths/tmp');
     return $result;
 }