本文整理汇总了PHP中Dir::getFullPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::getFullPath方法的具体用法?PHP Dir::getFullPath怎么用?PHP Dir::getFullPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::getFullPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rename
function rename($new_name)
{
if (strstr($new_name, "/") !== false) {
throw new InvalidParameterException("Il nome contiene caratteri non ammessi ( / )!!");
}
$parent_dir = $this->getParentDir();
$target_path = $parent_dir->getPath() . "/" . $new_name;
$target_dir = new Dir($target_path);
if ($target_dir->exists()) {
return false;
}
return rename($this->__full_path, $target_dir->getFullPath());
}
示例2: expandArchive
public static function expandArchive($zip_file, $target_folder)
{
$zip_archive = new ZipArchive();
if ($zip_file instanceof File) {
$real_zip_file = $zip_file;
} else {
$real_zip_file = new File($zip_file);
}
if ($target_folder instanceof Dir) {
$target_dir = $target_folder;
} else {
$target_dir = new Dir($target_folder);
}
$zip_archive->open($real_zip_file->getFullPath());
$zip_archive->extractTo($target_dir->getFullPath());
$zip_archive->close();
}
示例3: rename
/**
*
* Renames this directory without moving it.
*
* @param string $new_name The new name to assign to this folder.
* @return boolean true if the operation was succesfull, false otherwise.
* @throws \Mbcraft\Piol\IOException if the name contains invalid characters (path components).
*
* @api
*/
public function rename($new_name)
{
FileSystemUtils::checkValidFilename($new_name);
$parent_dir = $this->getParentDir();
$target_path = $parent_dir->getPath() . "/" . $new_name;
$target_dir = new Dir($target_path);
if ($target_dir->exists()) {
return false;
}
return rename($this->__full_path, $target_dir->getFullPath());
}