本文整理汇总了PHP中Folder::getPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getPath方法的具体用法?PHP Folder::getPath怎么用?PHP Folder::getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::getPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: moveTo
/**
* @param Folder $folder The Folder into which it should be moved
*
* @return Folder The domain object for further usage
*
* @author Nicolas Pecher
* @version Version 0.1, 01.05.2012
*/
public function moveTo(Folder $folder)
{
$newFolder = new Folder();
$newFolder->create($folder->getPath() . '/' . $this->getName());
$children = $this->getContent();
foreach ($children as $child) {
$child->moveTo($newFolder);
}
$this->delete();
$this->basePath = $folder->getPath();
return $this;
}
示例2: printFolderOptions
/** Print folder options in select box */
function printFolderOptions($id = 0)
{
global $dbi;
if ($id == 0) {
echo "<option value=\"0\">/</option>";
}
// Get subsections
$result = $dbi->query("SELECT id FROM " . folderTableName . " WHERE parentId=" . $dbi->quote($id) . " ORDER BY name");
if ($result->rows()) {
for ($i = 0; list($id) = $result->fetchrow_array(); $i++) {
$folder = new Folder($id);
echo "<option value=\"" . $folder->id . "\"" . ($this->id == $folder->id ? " selected=\"selected\"" : "") . ">";
echo $folder->getPath() . "/</option>";
$this->printFolderOptions($folder->id);
}
}
}
示例3: doUploadFile
/**
* Dateiupload-Vorgang ausfÃÂÃÂÃÂühren
*/
function doUploadFile()
{
//Relative Pfadangabe fÃÂÃÂÃÂür Upload-Verzeichniss ermitteln
$f = dirname($_SERVER['SCRIPT_NAME']);
if (strlen(str_ireplace("/", "", $f)) == 0) {
$f = "";
} else {
//wenn vorhanden ersten slash abschneiden
if (substr($f, 0, 1) == "/" && strlen($f) > 0) {
$f = substr($f, 1);
}
//wenn nicht vorhanden letzten slash anhängen
if (substr($f, strlen($f) - 1 && strlen($f) > 0) != "/") {
$f = $f . "/";
}
}
//Verzeichniss erzeugen
$folder = new Folder($_SERVER['DOCUMENT_ROOT'] . $this->getTargetPath());
$newFileName = $folder->doUploadFile($_FILES['probe'], substr($folder->getPath(), strlen($_SERVER['DOCUMENT_ROOT'])), $this->getFilePrefix(), $this->TARGETFILENAME);
$t = new Text("Datei " . $_FILES['probe']['name'] . " wurde hochgeladen.\n\n");
$t->show();
$this->insertIntoDbIfNeeded(substr($newFileName, strlen($_SERVER['DOCUMENT_ROOT'])));
$this->doPostUpload();
}