Beispiel #1
0
 public static function registerAll()
 {
     $dirs = Ajde_FS_Find::findFiles(MODULE_DIR, '*/model');
     foreach ($dirs as $dir) {
         Ajde_Core_Autoloader::addDir($dir . '/');
     }
 }
Beispiel #2
0
 private static function _getFileInfo($base, $action, $format = 'html')
 {
     // go see what templates are available
     $fileNamePatterns = array($action . '.' . $format, $action);
     $fileTypes = array('phtml' => 'Phtml', 'xhtml' => 'Xhtml');
     $fileName = null;
     foreach ($fileNamePatterns as $fileNamePattern) {
         foreach ($fileTypes as $fileType => $parserType) {
             $filePattern = $fileNamePattern . '.' . $fileType;
             if ($fileMatch = Ajde_FS_Find::findFile($base . TEMPLATE_DIR, $filePattern)) {
                 return array('filename' => $fileMatch, 'parser' => $parserType);
             }
         }
     }
     return false;
 }
Beispiel #3
0
 protected function getAvailable()
 {
     $langs = Ajde_FS_Find::findFiles(LANG_DIR, '*');
     $return = array();
     foreach ($langs as $lang) {
         $return[] = basename($lang);
     }
     return $return;
 }
 public function getCacheStatus()
 {
     $hash = $this->getHash();
     $fileTimePattern = $hash['fileName'] . '.' . $hash['fileTime'] . '.' . $this->getType();
     if ($fileName = Ajde_FS_Find::findFile($this->getBase(), $fileTimePattern)) {
         return array('status' => self::CACHE_STATUS_EXIST, 'fileName' => $fileName);
     }
     $fileNamePattern = $hash['fileName'] . '.*.' . $this->getType();
     if ($fileName = Ajde_FS_Find::findFile($this->getBase(), $fileNamePattern)) {
         return array('status' => self::CACHE_STATUS_UPDATE, 'fileName' => $fileName);
     }
     return array('status' => self::CACHE_STATUS_NOT_EXIST, 'fileName' => '');
 }