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


PHP Filesystem::delete方法代碼示例

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


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

示例1: destroy

 /**
  * @param \Exolnet\Image\Imageable $image
  * @return bool
  */
 public function destroy(Imageable $image)
 {
     if ($this->filesystem->exists($image->getImagePath())) {
         return $this->filesystem->delete($image->getImagePath());
     }
     return true;
 }
開發者ID:eXolnet,項目名稱:laravel-image,代碼行數:11,代碼來源:FilesystemRepository.php

示例2: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     foreach ($this->files->files(storage_path() . '/views') as $file) {
         $this->files->delete($file);
     }
     $this->info('Views deleted from cache');
 }
開發者ID:sohelrana820,項目名稱:mario-gomez,代碼行數:12,代碼來源:ViewsCommand.php

示例3: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->cache->flush();
     $this->files->delete($this->laravel['config']['app.manifest'] . '/services.json');
     $this->laravel['events']->fire('cache:cleared');
     $this->info('Application cache cleared!');
 }
開發者ID:arifmahmudrana,項目名稱:angularjs-laravel-boilerplate,代碼行數:12,代碼來源:ClearCommand.php

示例4: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     foreach ($this->files->files(storage_path() . '/framework/sessions') as $file) {
         $this->files->delete($file);
     }
     $this->info('Session files deleted from storage');
 }
開發者ID:nmfzone,項目名稱:donor-darah-pmi,代碼行數:12,代碼來源:StorageSessionClear.php

示例5: removeFiles

 /**
  * @param string $dir
  */
 protected function removeFiles($dir)
 {
     $files = $this->filesystem->glob($dir . '/*');
     foreach ($files as $file) {
         $this->filesystem->delete($file);
     }
 }
開發者ID:ytake,項目名稱:laravel-aspect,代碼行數:10,代碼來源:ClearCacheCommand.php

示例6: gc

 /**
  * {@inheritDoc}
  */
 public function gc($lifetime)
 {
     $files = Finder::create()->in($this->path)->files()->ignoreDotFiles(true)->date('<= now - ' . $lifetime . ' seconds');
     foreach ($files as $file) {
         $this->files->delete($file->getRealPath());
     }
 }
開發者ID:kartx22,項目名稱:Otoru-Dice,代碼行數:10,代碼來源:FileSessionHandler.php

示例7: save

 public function save($item, $value, $environment, $group, $namespace = null)
 {
     $path = DIR_APPLICATION . '/config/generated_overrides';
     if (!$this->files->exists($path)) {
         $this->files->makeDirectory($path, 0777);
     } elseif (!$this->files->isDirectory($path)) {
         $this->files->delete($path);
         $this->files->makeDirectory($path, 0777);
     }
     if ($namespace) {
         $path = "{$path}/{$namespace}";
         if (!$this->files->exists($path)) {
             $this->files->makeDirectory($path, 0777);
         } elseif (!$this->files->isDirectory($path)) {
             $this->files->delete($path);
             $this->files->makeDirectory($path, 0777);
         }
     }
     $file = "{$path}/{$group}.php";
     $current = array();
     if ($this->files->exists($file)) {
         $current = $this->files->getRequire($file);
     }
     array_set($current, $item, $value);
     $renderer = new Renderer($current);
     return $this->files->put($file, $renderer->render()) !== false;
 }
開發者ID:meixelsberger,項目名稱:concrete5-5.7.0,代碼行數:27,代碼來源:FileSaver.php

示例8: it_should_create_a_file

 /** @test */
 public function it_should_create_a_file()
 {
     if ($this->finder->isFile("{$this->mediaPath}google-map_smallThumb.png")) {
         $this->finder->delete("{$this->mediaPath}google-map_smallThumb.png");
     }
     $this->imagy->get("/google-map.png", 'smallThumb', true);
     $this->assertTrue($this->finder->isFile("{$this->testbenchPublicPath}google-map_smallThumb.png"));
 }
開發者ID:Houbsi,項目名稱:Media,代碼行數:9,代碼來源:ImagyTest.php

示例9: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $views = $this->files->glob($this->laravel['config']['view.compiled'] . '/*');
     foreach ($views as $view) {
         $this->files->delete($view);
     }
     $this->info('Compiled views cleared!');
 }
開發者ID:saj696,項目名稱:pipe,代碼行數:13,代碼來源:ViewClearCommand.php

示例10: handle

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     $files = new Filesystem();
     $files->deleteDirectory(app_path('Http/Controllers/Auth'));
     $files->delete(base_path('database/migrations/2014_10_12_000000_create_users_table.php'));
     $files->delete(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php'));
     $this->info('Original Auth removed! Enjoy your fresh start.');
 }
開發者ID:billwaddyjr,項目名稱:dashboard,代碼行數:13,代碼來源:FreshCommand.php

示例11: deleteFilesOlderThanMinutes

 /**
  * @param int $minutes
  *
  * @return \Illuminate\Support\Collection
  */
 public function deleteFilesOlderThanMinutes(int $minutes) : Collection
 {
     $timeInPast = Carbon::now()->subMinutes($minutes);
     return collect($this->filesystem->files($this->directory))->filter(function ($file) use($timeInPast) {
         return Carbon::createFromTimestamp(filemtime($file))->lt($timeInPast);
     })->each(function ($file) {
         $this->filesystem->delete($file);
     });
 }
開發者ID:spatie,項目名稱:laravel-directory-cleanup,代碼行數:14,代碼來源:DirectoryCleaner.php

示例12: testSave

 public function testSave()
 {
     $group = md5(uniqid());
     $item = 'test.item';
     $key = "{$group}.{$item}";
     $this->repository->save($key, $group);
     $this->assertEquals($group, $this->repository->get($key, false));
     $this->files->delete(DIR_APPLICATION . "/config/generated_overrides/{$group}.php");
 }
開發者ID:masteramuk,項目名稱:concrete5,代碼行數:9,代碼來源:FileRepositoryTest.php

示例13: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->info("Starting to clear cache...");
     if ($this->files->exists($path = EloquentCacheCommand::getCachedEloquentPath())) {
         $this->files->delete($path);
         $this->info("Cache cleared.");
     } else {
         $this->comment("No cache to clear.");
     }
 }
開發者ID:reshadman,項目名稱:eloquent-faster,代碼行數:15,代碼來源:EloquentCacheClearCommand.php

示例14: handle

 /**
  * Handle the command.
  *
  * @param GenerateEntryModel $command
  */
 public function handle(GenerateEntryModel $command)
 {
     $stream = $command->getStream();
     $data = $this->getTemplateData($stream);
     $template = file_get_contents(__DIR__ . '/../../../resources/stubs/models/entry.stub');
     $file = $this->getFilePath($stream);
     $this->files->makeDirectory(dirname($file), 0777, true, true);
     $this->files->delete($file);
     $this->files->put($file, $this->parser->parse($template, $data));
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:15,代碼來源:GenerateEntryModelHandler.php

示例15: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     if (!$this->confirmToProceed()) {
         return;
     }
     $files = new Filesystem();
     $files->deleteDirectory(app_path('Http/Controllers/Auth'));
     $files->delete(base_path('database/migrations/2014_10_12_000000_create_users_table.php'));
     $files->delete(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php'));
     $this->info('Auth removed! Enjoy your fresh start.');
 }
開發者ID:remyjox,項目名稱:My_meetic,代碼行數:16,代碼來源:FreshCommand.php


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