本文整理汇总了PHP中PublicFileManager::rmtree方法的典型用法代码示例。如果您正苦于以下问题:PHP PublicFileManager::rmtree方法的具体用法?PHP PublicFileManager::rmtree怎么用?PHP PublicFileManager::rmtree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PublicFileManager
的用法示例。
在下文中一共展示了PublicFileManager::rmtree方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteSchedConf
/**
* Delete a scheduled conference.
* @param $args array first parameter is the ID of the scheduled conference to delete
*/
function deleteSchedConf($args)
{
$this->validate();
$schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
if (isset($args) && !empty($args) && !empty($args[0])) {
$schedConfId = $args[0];
$schedConf =& $schedConfDao->getSchedConf($schedConfId);
// Look up the scheduled conference path before we delete the scheduled conference.
import('file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$schedConfFilesPath = $publicFileManager->getSchedConfFilesPath($schedConfId);
if ($schedConfDao->deleteSchedConfById($schedConfId)) {
// Delete scheduled conference file tree
// FIXME move this somewhere better.
import('file.FileManager');
$fileManager = new FileManager();
$schedConfPath = Config::getVar('files', 'files_dir') . '/conferences/' . $schedConf->getConferenceId() . '/schedConfs/' . $schedConfId;
$fileManager->rmtree($schedConfPath);
$publicFileManager->rmtree($schedConfFilesPath);
}
}
Request::redirect(null, null, null, 'schedConfs');
}
示例2: deleteJournal
/**
* Delete a journal.
* @param $args array first parameter is the ID of the journal to delete
* @param $request object
*/
function deleteJournal($args, &$request)
{
$this->validate();
$journalDao =& DAORegistry::getDAO('JournalDAO');
if (isset($args) && !empty($args) && !empty($args[0])) {
$journalId = $args[0];
if ($journalDao->deleteJournalById($journalId)) {
// Delete journal file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
$journalPath = Config::getVar('files', 'files_dir') . '/journals/' . $journalId;
$fileManager->rmtree($journalPath);
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getJournalFilesPath($journalId));
}
}
$request->redirect(null, null, 'journals');
}
示例3: deleteConference
/**
* Delete a conference.
* @param $args array first parameter is the ID of the conference to delete
*/
function deleteConference($args, &$request)
{
$this->validate();
$conferenceDao =& DAORegistry::getDAO('ConferenceDAO');
if (isset($args) && !empty($args) && !empty($args[0])) {
$conferenceId = $args[0];
if ($conferenceDao->deleteConferenceById($conferenceId)) {
// Delete conference file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
$conferencePath = Config::getVar('files', 'files_dir') . '/conferences/' . $conferenceId;
$fileManager->rmtree($conferencePath);
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getConferenceFilesPath($conferenceId));
}
}
$request->redirect(null, null, null, 'conferences');
}
示例4: deleteContext
/**
* Delete a journal.
* @param $args array
* @param $request PKPRequest
* @return JSONMessage JSON object
*/
function deleteContext($args, $request)
{
// Identify the journal Id.
$journalId = $request->getUserVar('rowId');
$journalDao = DAORegistry::getDAO('JournalDAO');
$journal = $journalDao->getById($journalId);
if ($journal) {
$journalDao->deleteById($journalId);
// Delete journal file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager($journalId);
$journalPath = Config::getVar('files', 'files_dir') . '/journals/' . $journalId;
$fileManager->rmtree($journalPath);
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getJournalFilesPath($journalId));
return DAO::getDataChangedEvent($journalId);
}
return new JSONMessage(false);
}
示例5: deletePress
/**
* Delete a press.
* @param $args array first parameter is the ID of the press to delete
*/
function deletePress($args)
{
$this->validate();
$pressDao =& DAORegistry::getDAO('PressDAO');
if (isset($args) && !empty($args) && !empty($args[0])) {
$pressId = $args[0];
if ($pressDao->deletePressById($pressId)) {
// Delete press file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager();
$pressPath = Config::getVar('files', 'files_dir') . '/presses/' . $pressId;
$fileManager->rmtree($pressPath);
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getPressFilesPath($pressId));
}
}
Request::redirect(null, null, 'presses');
}
示例6: deleteContext
/**
* Delete a press.
* @param $args array
* @param $request PKPRequest
* @return string Serialized JSON object
*/
function deleteContext($args, $request)
{
// Identify the current context.
$context = $request->getContext();
// Identify the press Id.
$pressId = $request->getUserVar('rowId');
$pressDao = DAORegistry::getDAO('PressDAO');
$press = $pressDao->getById($pressId);
if ($pressId) {
$pressDao->deleteById($pressId);
// Add publication formats tombstones for all press published monographs.
import('classes.publicationFormat.PublicationFormatTombstoneManager');
$publicationFormatTombstoneMgr = new PublicationFormatTombstoneManager();
$publicationFormatTombstoneMgr->insertTombstonesByPress($press);
// Delete press file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.ContextFileManager');
$pressFileManager = new ContextFileManager($pressId);
$pressFileManager->rmtree($pressFileManager->getBasePath());
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getPressFilesPath($pressId));
// If user is deleting the same press where he is...
if ($context && $context->getId() == $pressId) {
// return a redirect js event to index handler.
$dispatcher = $request->getDispatcher();
$url = $dispatcher->url($request, ROUTE_PAGE, null, 'index');
return $request->redirectUrlJson($url);
}
return DAO::getDataChangedEvent($pressId);
}
return new JSONMessage();
}
示例7: deleteContext
/**
* Delete a conference.
* @param $args array
* @param $request PKPRequest
* @return string Serialized JSON object
*/
function deleteContext($args, &$request)
{
// Identify the current context.
$context =& $request->getContext();
// Identify the conference Id.
$conferenceId = $request->getUserVar('rowId');
$conferenceDao = DAORegistry::getDAO('ConferenceDAO');
$conference =& $conferenceDao->getById($conferenceId);
if ($conference) {
$conferenceDao->deleteById($conferenceId);
// Delete conference file tree
// FIXME move this somewhere better.
import('lib.pkp.classes.file.FileManager');
$fileManager = new FileManager($conferenceId);
$conferencePath = Config::getVar('files', 'files_dir') . '/conferences/' . $conferenceId;
$fileManager->rmtree($conferencePath);
import('classes.file.PublicFileManager');
$publicFileManager = new PublicFileManager();
$publicFileManager->rmtree($publicFileManager->getConferenceFilesPath($conferenceId));
return DAO::getDataChangedEvent($conferenceId);
}
$json = new JSONMessage(false);
return $json->getString();
}