本文整理汇总了PHP中Library\Utility\Helper::deleteDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::deleteDirectory方法的具体用法?PHP Helper::deleteDirectory怎么用?PHP Helper::deleteDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library\Utility\Helper
的用法示例。
在下文中一共展示了Helper::deleteDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeItemFile
/**
* @param int $itemId
*/
private function removeItemFile($itemId)
{
$path = "/ginosi/uploads/expense/items_tmp/{$itemId}";
if (is_readable($path)) {
\Library\Utility\Helper::deleteDirectory($path);
}
}
示例2: deleteLocation
/**
* Remove specific location
*
* @param int $id
* @param int $locationType
* @param int $detailsID
* @return boolean
*/
function deleteLocation($id, $locationType, $detailsID)
{
$locationDao = $this->getLocationDaoByType($locationType);
if ($locationDao !== null) {
// remove directory
Helper::deleteDirectory('/ginosi/images/locations/' . $detailsID);
$locationDetailsDao = $this->getLocationDetailsDao();
$locationDetailsDao->deleteWhere(array('id' => $detailsID));
$locationDao->deleteWhere(array('id' => $id));
return true;
} else {
// unknown location type
return false;
}
}
示例3: saveAction
//.........这里部分代码省略.........
break;
case Feedback::FEEDBACK_TYPE_CONTENT_IDEA_VALUE:
$projectId = $asanaFeedbackConfig['project_id_content'];
$taskTitle = $request->getPost('feedback-title');
$notes .= $request->getPost('feedback-description');
break;
}
$notBOInfo = '';
if (Feedback::FEEDBACK_APPLICATION_TYPE_BACKOFFICE == $request->getPost('feedback-application-types')) {
$notBOInfo = "\nScreen Size: {$prop['screen_size']}\nURL: {$prop['url']}";
}
$notes .= PHP_EOL . "\n--------------------------------------------------------------\nSystem Parameters\n{$notBOInfo}\nUser: {$identity->firstname} {$identity->lastname} (#{$identity->id})\nEmail: {$identity->email}\nTimezone: {$identity->timezone}\n--------------------------------------------------------------";
if ($identity->asana_id) {
array_push($followers, $identity->asana_id);
}
$resultAsana = $asana->createTask(array_merge(['workspace' => $asanaFeedbackConfig['workspace_id'], 'name' => $taskTitle, 'notes' => $notes, 'projects' => [$projectId], 'followers' => $followers]), $additionalParams);
if (!in_array($asana->responseCode, ['200', '201']) || is_null($resultAsana)) {
$result['msg'] = "Error while trying to connect to Asana, response code: {$asana->responseCode}";
} else {
$resultJson = json_decode($resultAsana);
$taskId = $resultJson->data->id;
// attaching attachments to the task
$targetPath = $this->getAttachmentsDirectory() . '/' . (int) $request->getPost('key');
if (is_readable($targetPath)) {
$files = glob($targetPath . '/*');
if (count($files)) {
foreach ($files as $file) {
$asana->addAttachmentToTask($taskId, ['file' => $file]);
if (in_array($asana->responseCode, ['200', '201'])) {
unlink($file);
}
}
}
Helper::deleteDirectory($targetPath);
}
//doing post task create actions for specific types (subtasks, tags)
switch ($selectedType) {
case Feedback::FEEDBACK_TYPE_SOFTWARE_FEEDBACK_VALUE:
if ((int) $request->getPost('feedback-is-bug') == 1) {
//add bug tag
$asana->addTagToTask($taskId, $asanaFeedbackConfig['bug_tag_id']);
}
break;
case Feedback::FEEDBACK_TYPE_ACCOUNT_MANAGEMENT_VALUE:
$logger = $this->getServiceLocator()->get('ActionLogger');
switch ($request->getPost('feedback-account-management-type')) {
case Feedback::FEEDBACK_SUBTYPE_ACCOUNT_MANAGEMENT_CREATE_ACCOUNT_VALUE:
//add subtasks
if ((int) $request->getPost('feedback-subscribe-google-groups') == 1) {
$asana->createSubTask($taskId, ['name' => 'Subscribe to department mailing list']);
}
if (strlen($request->getPost('feedback-other-account')) > 1) {
$feedbackOtherAccount = trim($request->getPost('feedback-other-account'));
if (sizeof(explode(',', $feedbackOtherAccount)) > 1) {
$separator = ' accounts';
} else {
$separator = ' account';
}
$asana->createSubTask($taskId, ['name' => 'Create ' . $feedbackOtherAccount . $separator]);
}
if ((int) $request->getPost('feedback-lastpass-account') == 1) {
$asana->createSubTask($taskId, ['name' => 'Create LastPass account']);
}
if ((int) $request->getPost('feedback-bo-account') == 1) {
$asana->createSubTask($taskId, ['name' => 'Create BO account']);
}
示例4: deleteBlog
function deleteBlog($id)
{
Helper::deleteDirectory(DirectoryStructure::FS_GINOSI_ROOT . DirectoryStructure::FS_IMAGES_ROOT . DirectoryStructure::FS_IMAGES_BLOG_PATH . $id);
$blogDao = $this->getBlogDao();
$blogDao->deleteWhere(array('id' => $id));
return true;
}