本文整理匯總了PHP中dmOs::getFileWithoutExtension方法的典型用法代碼示例。如果您正苦於以下問題:PHP dmOs::getFileWithoutExtension方法的具體用法?PHP dmOs::getFileWithoutExtension怎麽用?PHP dmOs::getFileWithoutExtension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dmOs
的用法示例。
在下文中一共展示了dmOs::getFileWithoutExtension方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: executeSave
public function executeSave(dmWebRequest $request)
{
$file = dmProject::rootify($request->getParameter('file'));
$this->forward404Unless(file_exists($file), $file . ' does not exists');
try {
@$this->getService('file_backup')->save($file);
} catch (dmException $e) {
return $this->renderJson(array('type' => 'error', 'message' => 'backup failed : ' . $e->getMessage()));
}
@file_put_contents($file, $request->getParameter('code'));
if (dmOs::getFileExtension($file, false) == 'css') {
$return = array('type' => 'css', 'path' => $this->getHelper()->getStylesheetWebPath(dmOs::getFileWithoutExtension($file)));
} else {
$this->getService('cache_cleaner')->clearTemplate();
$return = array('type' => 'php', 'widgets' => $this->getWidgetInnersForFile($file));
}
$return['message'] = $this->getI18n()->__('Your modifications have been saved');
return $this->renderJson($return);
}
示例2: destroyThumbnails
public function destroyThumbnails()
{
if (!$this->isImage() || !$this->getService('filesystem')) {
return true;
}
$thumbs = sfFinder::type('file')->name(dmOs::getFileWithoutExtension($this->get('file')) . '*')->maxdepth(0)->in(dmOs::join($this->Folder->getFullPath(), '.thumbs'));
return $this->getServiceContainer()->getService('filesystem')->unlink($thumbs);
}