当前位置: 首页>>代码示例>>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;未经允许,请勿转载。