function _outputTypeFile($matches) { $file = $matches[3]; $platform = Kurogo::deviceClassifier()->getPlatform(); $pagetype = Kurogo::deviceClassifier()->getPagetype(); $testDirs = array( THEME_DIR.'/'.$matches[1].$matches[2], SITE_DIR.'/'.$matches[1].$matches[2], APP_DIR.'/'.$matches[1].$matches[2], ); $testFiles = array( "$pagetype-$platform/$file", "$pagetype/$file", "$file", ); foreach ($testDirs as $dir) { foreach ($testFiles as $file) { if ($file = realpath_exists("$dir/$file")) { _outputFile($file); } } } _404(); }
function _outputFileLoaderFile($matches) { _outputFile(FileLoader::load($matches[1])); }