コード例 #1
0
 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__ )');
 }
コード例 #2
0
 /**
  *	Function to get the full path of the directory.
  *
  *	@returns	String containing the full path of the directory.
  */
 function getPath()
 {
     return YDPath::getFullPath($this->_path);
 }
コード例 #3
0
 /**
  *	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;
 }
コード例 #4
0
 /**
  *  This function sets the target directory for the filesystem actions.
  *
  *  @param  $path  (optional) The target directory path. Default: YD_SELF_DIR.
  */
 function setTargetDirectory($path = YD_SELF_DIR)
 {
     $this->_target_dir = YDPath::getFullPath($path);
 }