当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::requireOnce方法代码示例

本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::requireOnce方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::requireOnce方法的具体用法?PHP Filesystem::requireOnce怎么用?PHP Filesystem::requireOnce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Filesystem\Filesystem的用法示例。


在下文中一共展示了Filesystem::requireOnce方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: map

 /**
  * Map additional routes.
  *
  * @param Filesystem  $files
  * @param Application $application
  */
 public function map(Filesystem $files, Application $application)
 {
     // Include public routes.
     if ($files->exists($routes = $application->getStoragePath('posts/routes.php'))) {
         $files->requireOnce($routes);
     } else {
         $files->requireOnce(__DIR__ . '/../resources/routes.php');
     }
 }
开发者ID:bloveless,项目名称:posts-module,代码行数:15,代码来源:PostsModuleServiceProvider.php

示例2: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     \DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     foreach ($this->filesystem->files(__DIR__ . "/../../../../database/migrations") as $file) {
         $this->filesystem->requireOnce($file);
         $migrationClass = $this->classFinder->findClass($file);
         $migration = new $migrationClass();
         $migration->down();
         $migration->up();
     }
     $this->info("Merx tables migrated.");
     \DB::statement('SET FOREIGN_KEY_CHECKS=1;');
 }
开发者ID:RemiCollin,项目名称:merx,代码行数:18,代码来源:MigrateDb.php

示例3: migrate

 /**
  * run package database migrations
  *
  * @return void
  */
 public function migrate()
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files(__DIR__ . "/migrations") as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->up();
     }
     foreach ($fileSystem->files(__DIR__ . "/seeds") as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->run();
     }
 }
开发者ID:chalcedonyt,项目名称:laravel-cos-processor,代码行数:20,代码来源:TestFileGenerator.php

示例4: setUp

 /**
  * Pull in composer and register service provider
  */
 public function setUp()
 {
     $filesystem = new Filesystem();
     $filesystem->requireOnce(__DIR__ . "/vendor/autoload.php");
     $list = new ProviderList(\Core::getFacadeApplication());
     $list->registerProvider("\\Concrete\\DocumentationGenerator\\ServiceProvider");
 }
开发者ID:concrete5,项目名称:documentation_generator,代码行数:10,代码来源:controller.php

示例5: loadAutoloader

 /**
  * Require composer's autoload file the packages.
  *
  * @return void
  **/
 protected function loadAutoloader($path)
 {
     $finder = new Finder();
     $files = new Filesystem();
     $autoloads = $finder->in($path)->files()->name('autoload.php')->depth('<= 3')->followLinks();
     foreach ($autoloads as $file) {
         $files->requireOnce($file->getRealPath());
     }
 }
开发者ID:VerticalHorizon,项目名称:sretenie,代码行数:14,代码来源:ReactiveAdminServiceProvider.php

示例6: register

 public function register()
 {
     $vendorPath = base_path('packages/*/vendor');
     $autoloads = static::findAutoloadFiles($vendorPath);
     $files = new Filesystem();
     foreach ($autoloads as $file) {
         /** @var SplFileInfo $file */
         $files->requireOnce($file->getRealPath());
     }
 }
开发者ID:jeroennoten,项目名称:laravel-psp,代码行数:10,代码来源:ServiceProvider.php

示例7: migrate

 /**
  * run package database migrations
  *
  * @return void
  */
 public function migrate()
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files(__DIR__ . "/../src/Commands") as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->fire();
     }
 }
开发者ID:soap,项目名称:thailand-provinces,代码行数:15,代码来源:DbTestCase.php

示例8: migrateDatabaseFromPath

 /**
  * Run all database migrations from the specified path
  * 
  * @param  string $path
  * @return void
  */
 protected function migrateDatabaseFromPath($path)
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files($path) as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->up();
     }
 }
开发者ID:analogueorm,项目名称:factory,代码行数:16,代码来源:FactoryTestCase.php

示例9: migrate

 /**
  * run package database migrations.
  */
 public function migrate()
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files(__DIR__ . '/../../../../tests/NilPortugues/App/Migrations') as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->down();
         (new $migrationClass())->up();
     }
 }
开发者ID:marcogrueter,项目名称:laravel5-jsonapi-transformer,代码行数:14,代码来源:LaravelTestCase.php

示例10: getMigrations

 protected function getMigrations()
 {
     $migrations = [];
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files(__DIR__ . '/../migrations') as $file) {
         $fileSystem->requireOnce($file);
         $migrations[] = $classFinder->findClass($file);
     }
     return $migrations;
 }
开发者ID:z-song,项目名称:laravel-admin,代码行数:11,代码来源:TestCase.php

示例11: migrate

 /**
  * Run package database migrations.
  */
 public function migrate()
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     foreach ($fileSystem->files(__DIR__ . '/App/database/migrations') as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->down();
         (new $migrationClass())->up();
     }
 }
开发者ID:askedio,项目名称:laravel-item-paginate,代码行数:14,代码来源:BaseTestCase.php

示例12: boot

 /**
  * Bootstrap any application services.
  *
  * @param Filesystem $filesystem
  */
 public function boot(Filesystem $filesystem)
 {
     foreach ($filesystem->files(app_path('Libraries/Macros')) as $file) {
         $filesystem->requireOnce($file);
     }
     if ($this->app->environment(['local'])) {
         $this->app->register(\Barryvdh\Debugbar\ServiceProvider::class);
         $this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
         $this->app->register(\Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class);
     }
 }
开发者ID:BePsvPT,项目名称:CCU,代码行数:16,代码来源:AppServiceProvider.php

示例13: requireBootstrap

 /**
  *
  */
 protected function requireBootstrap()
 {
     if (!$this->filesystem->isDirectory($this->bootstrapDirectory)) {
         return;
     }
     $files = $this->finder->create()->files()->name('/^[^_].+\\.php$/')->in($this->bootstrapDirectory);
     $files->sort(function ($a) {
         return $a->getFilename() !== static::BOOTSRAP_FILE;
     });
     foreach ($files as $file) {
         $this->filesystem->requireOnce($file);
     }
 }
开发者ID:stevenklar,项目名称:admin,代码行数:16,代码来源:Admin.php

示例14: migrate

 /**
  * Run package database migrations.
  * Thanks http://stackoverflow.com/questions/27759301/setting-up-integration-tests-in-a-laravel-package
  *
  * @return void
  */
 public function migrate()
 {
     $fileSystem = new Filesystem();
     $classFinder = new ClassFinder();
     $packageMigrations = $fileSystem->files(__DIR__ . "/../../src/Migrations");
     $laravelMigrations = $fileSystem->files(__DIR__ . "/../../vendor/laravel/laravel/database/migrations");
     $migrationFiles = array_merge($laravelMigrations, $packageMigrations);
     foreach ($migrationFiles as $file) {
         $fileSystem->requireOnce($file);
         $migrationClass = $classFinder->findClass($file);
         (new $migrationClass())->up();
     }
 }
开发者ID:PYuen1029,项目名称:friendly,代码行数:19,代码来源:DatabaseTestCase.php

示例15: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->disableForeignKeyChecks();
     $migrationCount = 0;
     foreach ($this->filesystem->files(__DIR__ . "/../../../../database/migrations") as $file) {
         $this->filesystem->requireOnce($file);
         $migrationClass = $this->classFinder->findClass($file);
         $migration = new $migrationClass();
         if ($this->option("refresh")) {
             $migration->down();
         }
         try {
             $migration->up();
             $migrationCount++;
         } catch (QueryException $ex) {
             if (!$this->isTableAlreadyExistError($ex)) {
                 throw $ex;
             }
         }
     }
     $this->enableForeignKeyChecks();
     $this->info("{$migrationCount} table(s) migrated.");
 }
开发者ID:dvlpp,项目名称:merx,代码行数:28,代码来源:MigrateDb.php


注:本文中的Illuminate\Filesystem\Filesystem::requireOnce方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。