當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helper::deleteDirectory方法代碼示例

本文整理匯總了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);
     }
 }
開發者ID:arbi,項目名稱:MyCode,代碼行數:10,代碼來源:ExpenseTicket.php

示例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;
     }
 }
開發者ID:arbi,項目名稱:MyCode,代碼行數:23,代碼來源:Location.php

示例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']);
                             }
開發者ID:arbi,項目名稱:MyCode,代碼行數:67,代碼來源:FeedbackController.php

示例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;
 }
開發者ID:arbi,項目名稱:MyCode,代碼行數:7,代碼來源:Blog.php


注:本文中的Library\Utility\Helper::deleteDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。