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