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


PHP File::deleteDirectory方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\File::deleteDirectory方法的典型用法代碼示例。如果您正苦於以下問題:PHP File::deleteDirectory方法的具體用法?PHP File::deleteDirectory怎麽用?PHP File::deleteDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\File的用法示例。


在下文中一共展示了File::deleteDirectory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: folderDelete

 /**
  * Delete the folder with the given path
  *
  * @param string $folder
  *
  * @return boolean
  * @throws DirectoryDoesNotExists
  */
 public function folderDelete($folder)
 {
     if (!File::isDirectory($this->getPath($folder))) {
         throw new DirectoryDoesNotExists();
     }
     return File::deleteDirectory($this->getPath($folder));
 }
開發者ID:spescina,項目名稱:mediabrowser,代碼行數:15,代碼來源:Filesystem.php

示例2: getSubmissionVerdict

 public function getSubmissionVerdict($srcContent, $srcExt)
 {
     assert($srcExt == "cpp" || $srcExt == "java" || $srcExt == "py", "'Source code language must be C++, Java or Python'");
     $judgingBaseFolder = '../judging/';
     $submissionFolderName = uniqid();
     $submissionFolder = "{$judgingBaseFolder}{$submissionFolderName}/";
     // Write the source code file
     $srcFpath = "{$submissionFolder}main.{$srcExt}";
     File::makeDirectory($submissionFolder);
     File::put($srcFpath, $srcContent);
     // Create the required test case files
     $caseNo = 1;
     $testcases = $this->testcases()->get();
     foreach ($testcases as $tc) {
         $inFname = "test{$caseNo}.in";
         $outFname = "test{$caseNo}.ans";
         $inFpath = $submissionFolder . $inFname;
         $outFpath = $submissionFolder . $outFname;
         File::put($inFpath, $tc->input);
         File::put($outFpath, $tc->output);
         $caseNo += 1;
     }
     // Judge!
     $judgingScript = "python \"{$judgingBaseFolder}judge.py\"";
     $judgingArguments = sprintf('"%s" "%s" %d', $srcFpath, $submissionFolder, $this['time_limit']);
     $judgeCommand = "{$judgingScript} {$judgingArguments}";
     $verdict = shell_exec($judgeCommand);
     // Clean-up the submission directory
     File::deleteDirectory($submissionFolder);
     return $verdict;
 }
開發者ID:alexpizarroj,項目名稱:orange,代碼行數:31,代碼來源:Problem.php

示例3: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     Schema::drop('pictures');
     //delete everything inside the images directory
     $path = public_path() . '/content/images/';
     File::deleteDirectory($path, true);
 }
開發者ID:elvinmakhmudov,項目名稱:shopping.app,代碼行數:12,代碼來源:2015_09_13_162125_create_pictures_table.php

示例4: delete

 /**
  * @param $id
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function delete($id)
 {
     $news = News::find($id);
     $deleteDir = File::deleteDirectory(base_path() . '/public/' . 'img/news/' . $news->id);
     $news->delete();
     Flash::success('Notícia deletada!');
     return redirect(route('news.index'));
 }
開發者ID:Digital-Serra,項目名稱:news-laravel,代碼行數:12,代碼來源:NewsController.php

示例5: deletePhotosByUser

 public static function deletePhotosByUser($userId)
 {
     $directory = "assets/images/_upload/fotos/" . $userId;
     File::deleteDirectory($directory);
     $finalists = Finalists::where('category', 'fotos')->get();
     foreach ($finalists as $finalist) {
         self::where('photosId', '=', $finalist->idCategory)->where('usersId', '=', $userId)->delete();
     }
     return self::where('usersId', $userId)->delete();
 }
開發者ID:brunomartins-com,項目名稱:hipodermeomega,代碼行數:10,代碼來源:Photos.php

示例6: boot

 public static function boot()
 {
     parent::boot();
     static::deleted(function ($project) {
         $path = public_path('files/projects/' . $project->id);
         if (File::exists($path)) {
             File::deleteDirectory($path);
         }
     });
 }
開發者ID:rasparac,項目名稱:diplomski,代碼行數:10,代碼來源:Project.php

示例7: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $this->info('Start housekeeping.');
     $maxBuilds = intval($this->option('max-builds'));
     $targetBuilds = $this->build->byGeneration($maxBuilds);
     foreach ($targetBuilds as $targetBuild) {
         $this->build->deleteById($targetBuild->id);
         File::deleteDirectory(public_path($targetBuild->artifact));
     }
     $this->info('Finish housekeeping.');
 }
開發者ID:ngmy,項目名稱:stand-ci,代碼行數:16,代碼來源:HousekeepCommand.php

示例8: removeRtmpServer

 public static function removeRtmpServer($key)
 {
     $channel_records_path = $_ENV['CHANNEL_RECORDS_PATH'];
     $app_conf_path = $_ENV['RTMP_APPS_CONF_PATH'];
     if (is_dir($channel_records_path . $key)) {
         File::deleteDirectory($channel_records_path . $key);
     }
     if (File::exists($app_conf_path . $key . '.conf')) {
         File::delete($app_conf_path . $key . '.conf');
     }
 }
開發者ID:Arsen007,項目名稱:broadcast,代碼行數:11,代碼來源:Channels.php

示例9: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param CategoryRequest $request
  * @param $categoryId
  * @return \Illuminate\Http\Response
  */
 public function destroy(CategoryRequest $request, $categoryId)
 {
     $category = Category::findOrFail($categoryId);
     $children = $category->getChildren();
     foreach ($children as $child) {
         File::deleteDirectory(public_path('images/categories/' . $child->id));
     }
     File::deleteDirectory(public_path('images/categories/' . $category->id));
     $category->deleteSubtree(true);
     return $this->response->noContent();
 }
開發者ID:Virgeto,項目名稱:GG-enginering-backend,代碼行數:18,代碼來源:CategoriesController.php

示例10: boot

 /**
  * Event to delete files in public/html folder
  *
  * @return void
  */
 public static function boot()
 {
     parent::boot();
     if (config('typicms.html_cache')) {
         static::saved(function ($model) {
             File::deleteDirectory(public_path() . '/html');
         });
         static::deleted(function ($model) {
             File::deleteDirectory(public_path() . '/html');
         });
     }
 }
開發者ID:vizo,項目名稱:Core,代碼行數:17,代碼來源:HtmlCacheEvents.php

示例11: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     switch ($this->argument('mode')) {
         case 'build':
             App::make('script-auto-compiler-l4')->build();
             break;
         case 'clear':
             File::deleteDirectory(Config::get('script-auto-compiler-l4::config.tmp'));
             break;
         default:
             break;
     }
 }
開發者ID:na-apri,項目名稱:sandbox,代碼行數:18,代碼來源:ScriptAutoCompilerL4Command.php

示例12: clean

 /**
  * Delete published assets
  *
  * @return void
  */
 public function clean()
 {
     $assetsDir = public_path() . '/' . $this->config->get('asset::public_dir');
     foreach (array_keys($this->processed) as $typeDir) {
         File::deleteDirectory($assetsDir . '/' . $typeDir);
     }
     foreach ($this->getGroupNames('styles') as $group) {
         Cache::forget('asset.styles.groups.' . $group);
     }
     foreach ($this->getGroupNames('scripts') as $group) {
         Cache::forget('asset.scripts.groups.' . $group);
     }
 }
開發者ID:lightgear,項目名稱:asset,代碼行數:18,代碼來源:Asset.php

示例13: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('users')->delete();
     User::create(array('firstname' => 'User', 'lastname' => 'Name', 'username' => 'username1', 'email' => 'user1@msn.com', 'password' => 'usernameone'));
     // create directories //
     // check to see if directory is created //
     if (File::exists(public_path() . '/../storage/uploads')) {
         File::deleteDirectory(public_path() . '/../storage/uploads');
     }
     File::makeDirectory(public_path() . '/../storage/uploads');
     File::makeDirectory(public_path() . '/../storage/uploads/username1');
     // chmod directory //
     chmod("/../storage/uploads/username1", 777);
 }
開發者ID:jmathis2014,項目名稱:p4,代碼行數:19,代碼來源:UsersTableSeeder.php

示例14: performConversions

 /**
  * Perform the given conversions for the given media.
  *
  * @param \Spatie\MediaLibrary\Conversion\ConversionCollection $conversions
  * @param \Spatie\MediaLibrary\Media                           $media
  */
 public function performConversions(ConversionCollection $conversions, Media $media)
 {
     $tempDirectory = $this->createTempDirectory();
     $copiedOriginalFile = $tempDirectory . '/' . str_random(16) . '.' . $media->extension;
     app(Filesystem::class)->copyFromMediaLibrary($media, $copiedOriginalFile);
     if ($media->type == Media::TYPE_PDF) {
         $copiedOriginalFile = $this->convertToImage($copiedOriginalFile);
     }
     foreach ($conversions as $conversion) {
         $conversionResult = $this->performConversion($media, $conversion, $copiedOriginalFile);
         $renamedFile = MediaLibraryFileHelper::renameInDirectory($conversionResult, $conversion->getName() . '.' . $conversion->getResultExtension(pathinfo($copiedOriginalFile, PATHINFO_EXTENSION)));
         app(Filesystem::class)->copyToMediaLibrary($renamedFile, $media, 'conversions');
     }
     File::deleteDirectory($tempDirectory);
 }
開發者ID:RetinaInc,項目名稱:laravel-medialibrary,代碼行數:21,代碼來源:FileManipulator.php

示例15: generateDocs

 public static function generateDocs()
 {
     $appDir = config('swagger-lume.paths.annotations');
     $docDir = config('swagger-lume.paths.docs');
     if (!File::exists($docDir) || is_writable($docDir)) {
         // delete all existing documentation
         if (File::exists($docDir)) {
             File::deleteDirectory($docDir);
         }
         File::makeDirectory($docDir);
         $excludeDirs = config('swagger-lume.paths.excludes');
         $swagger = \Swagger\scan($appDir, $excludeDirs);
         $filename = $docDir . '/api-docs.json';
         $swagger->saveAs($filename);
     }
 }
開發者ID:jfoliveira,項目名稱:SwaggerLume,代碼行數:16,代碼來源:Generator.php


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