function actionDefault() { YDDebugUtil::dump(YDPath::getDirectorySeparator(), 'getDirectorySeparator()'); YDDebugUtil::dump(YDPath::getPathSeparator(), 'getPathSeparator()'); YDDebugUtil::dump(YDPath::getVolumeSeparator(), 'getVolumeSeparator()'); YDDebugUtil::dump(YDPath::changeExtension(__FILE__, '.tpl'), 'changeExtension( __FILE__, ".tpl" )'); YDDebugUtil::dump(YDPath::getDirectoryName(__FILE__), 'getDirectoryName( __FILE__ )'); YDDebugUtil::dump(YDPath::getExtension(__FILE__), 'getExtension( __FILE__ )'); YDDebugUtil::dump(YDPath::getFileName(__FILE__), 'getFileName( __FILE__ )'); YDDebugUtil::dump(YDPath::getFileNameWithoutExtension(__FILE__), 'getFileNameWithoutExtension( __FILE__ )'); YDDebugUtil::dump(YDPath::getFilePath(__FILE__), 'getFilePath( __FILE__ )'); YDDebugUtil::dump(YDPath::getFilePathWithoutExtension(__FILE__), 'getFilePathWithoutExtension( __FILE__ )'); YDDebugUtil::dump(YDPath::getFullPath(__FILE__), 'getFullPath( __FILE__ )'); YDDebugUtil::dump(YDPath::getTempFileName(), 'getTempFileName()'); YDDebugUtil::dump(YDPath::getTempPath(), 'getTempPath()'); YDDebugUtil::dump(YDPath::hasExtension(__FILE__), 'hasExtension( __FILE__ )'); YDDebugUtil::dump(YDPath::hasExtension(YDPath::getFileNameWithoutExtension(__FILE__)), 'hasExtension( YDPath::getFileNameWithoutExtension( __FILE__ ) )'); YDDebugUtil::dump(YDPath::isAbsolute(__FILE__), 'isAbsolute( __FILE__ )'); YDDebugUtil::dump(YDPath::isAbsolute(YDPath::getFileName(__FILE__)), 'isAbsolute( getFileName( __FILE__ ) )'); YDDebugUtil::dump(YDPath::join(__FILE__), 'join( __FILE__ )'); YDDebugUtil::dump(YDPath::join(YDPath::getTempPath(), YDPath::getFileName(__FILE__)), 'join( getTempPath(), getFileName( __FILE__ ) )'); YDDebugUtil::dump(YDPath::join(YDPath::getTempPath(), __FILE__), 'join( getTempPath(), __FILE__ )'); }
/** * @param $path Path of the file or directory. * * @returns The file path of the specified path string without the extension * * @static */ function getFilePathWithoutExtension($path) { return YDPath::getDirectoryName($path) . YDPath::getDirectorySeparator() . YDPath::getFileNameWithoutExtension($path); }
function installDbUpdate($file) { $update_name = YDPath::getFileNameWithoutExtension($file); YDUpdateLog::info('Performing database update: ' . $update_name); YDInclude(YDUpdateTools::realPath($file)); $db = YDDatabaseTools::getConnection(); $update_inst = new $update_name($db); $update_inst->update(); }
/** * This function will get the name of the template. * * @internal */ function _getTemplateName($file = '') { if (file_exists($file)) { if ('.' . YDPath::getExtension($file) != YD_TPL_EXT) { trigger_error('The specified file ' . $file . ' is not a valid template file (wrong file extension)', YD_ERROR); } return realpath($file); } $this->template_dir = YDPath::getFullPath($this->template_dir); if (empty($file)) { $file = YDPath::getFileNameWithoutExtension(YD_SELF_FILE); } if (is_file(YDPath::join($this->template_dir, $file . YD_TPL_EXT))) { $tplName = $file . YD_TPL_EXT; } else { $tplName = $file; } if (!is_file(YDPath::join($this->template_dir, $tplName))) { trigger_error('Template not found: ' . $tplName, YD_ERROR); } return $tplName; }