當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。