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


PHP App::make方法代码示例

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


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

示例1: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $lrs_collection = (new Lrs())->get();
     // Remove all inactive statements.
     Statement::where('active', '=', false)->delete();
     // Migrates the statements for each LRS.
     foreach ($lrs_collection as $lrs) {
         Statement::where('lrs._id', $lrs->_id)->chunk(500, function ($statements) use($lrs) {
             $statements_array = [];
             // Sets `active` and `voided` properties.
             // Ensures that statement is an associative array.
             $statements = $statements->each(function ($statement) {
                 $statement->voided = isset($statement->voided) ? $statement->voided : false;
                 $statement->active = isset($statement->active) ? $statement->active : true;
                 $statement->save();
                 $statements_array[] = (array) json_decode($statement->toJSON());
             });
             // Uses the repository to migrate the statements.
             $repo = App::make('Locker\\Repository\\Statement\\EloquentVoider');
             $repo->updateReferences($statements_array, $lrs);
             $repo->voidStatements($statements_array, $lrs);
             // Outputs status.
             $statement_count = $statements->count();
             $this->info("Migrated {$statement_count} statements in `{$lrs->title}`.");
         });
     }
     $this->info('All statements migrated.');
 }
开发者ID:scmc,项目名称:learninglocker,代码行数:33,代码来源:StatementMigrateCommand.php

示例2: handle

 /**
  * Execute the job.
  * @return void
  */
 public function handle()
 {
     $s3 = \App::make('aws');
     $s3->createClient('s3')->putObject(['Bucket' => 'transcoderinput435983', 'Key' => $this->key_input, 'SourceFile' => storage_path() . '/app/' . $this->key_input]);
     $s3->createClient('ElasticTranscoder')->createJob(['PipelineId' => env('PIPLINE_ID'), 'Input' => ['Key' => $this->key_input, 'FrameRate' => 'auto', 'Resolution' => 'auto', 'AspectRatio' => 'auto', 'Interlaced' => 'auto', 'Container' => 'auto'], 'Output' => ['Key' => $this->key_output, 'ThumbnailPattern' => $this->time . '_thumb{count}', 'Rotate' => 'auto', 'PresetId' => '1452215960232-me3asn']]);
     \File::delete(storage_path() . '/app/' . $this->key_input);
 }
开发者ID:jwdeitch,项目名称:aws-video-transcoder,代码行数:11,代码来源:awsWorker.php

示例3: save

 /**
  * Saves all datamodels in all services to the database.
  */
 public function save()
 {
     $data = $this->getData();
     $repo = \App::make(YoutubeRepository::class);
     call_user_func([$repo, 'save' . ucfirst(str_plural($this->_params->get('resource')['name']))], $data);
     event(new PackageSaved($this));
 }
开发者ID:Gamespectre,项目名称:spectator-api,代码行数:10,代码来源:YoutubePackage.php

示例4: __construct

 /**
  * Create a new command instance.
  *
  * @return void
  */
 function __construct()
 {
     parent::__construct();
     $this->prod_delete_req_repo = App::make('Giftertipster\\Repository\\ProductDeleteRequest\\ProductDeleteRequestRepositoryInterface');
     $this->prod_suite_repo = App::make('Giftertipster\\Repository\\ProductSuite\\ProductSuiteRepositoryInterface');
     $this->cache_refresher = App::make('Giftertipster\\Service\\Cache\\CacheRefresherInterface');
 }
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:12,代码来源:DeleteProducts.php

示例5: __construct

 public function __construct($name, $payload = null)
 {
     $this->name = $name;
     $this->aggregate_hash = \App::make('guid.aggregate_hash');
     $this->payload = new EventPayload($payload);
     $this->logger = new EventLogger($this);
 }
开发者ID:gxela,项目名称:leback-event,代码行数:7,代码来源:LebackEvent.php

示例6: __construct

 public function __construct()
 {
     $dashboard = App::make('Lib\\Repositories\\Dashboard\\DashboardRepositoryInterface');
     $validator = App::make('Lib\\Services\\Validation\\DashboardValidator');
     $scraper = App::make('Lib\\Services\\Scraping\\Scraper');
     parent::__construct($dashboard, $validator, $scraper);
 }
开发者ID:onlystar1991,项目名称:mtdb,代码行数:7,代码来源:StreamingDashboardController.php

示例7: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('djbarnes/l4-ldap-auth');
     \Auth::extend('l4-ldap-auth', function () {
         return new Guard(new L4LdapAuthUserProvider(\Config::get('l4-ldap-auth::ldapserver'), \Config::get('l4-ldap-auth::ldapadmindn'), \Config::get('l4-ldap-auth::ldapadminpw'), \Config::get('l4-ldap-auth::searchbase'), \Config::get('l4-ldap-auth::searchfield')), \App::make('session'));
     });
 }
开发者ID:p-tricky,项目名称:l4-ldap-auth,代码行数:12,代码来源:L4LdapAuthServiceProvider.php

示例8: testToGenerateService

 public function testToGenerateService(UnitTester $I)
 {
     $client = \App::make('Stigma\\Nagios\\Client');
     $data = [];
     $response = $client->generateService($data);
     $I->assertEquals('200', $response);
 }
开发者ID:jaeheeship,项目名称:stigma2-dev,代码行数:7,代码来源:ClientCest.php

示例9: __construct

 public function __construct(array $attributes = [])
 {
     parent::__construct($attributes);
     $this->errors = new \Illuminate\Support\MessageBag();
     $this->validator = \App::make('validator');
     $this->manejaConcurrencia = true;
 }
开发者ID:richarrieta,项目名称:miequipo,代码行数:7,代码来源:BaseModel.php

示例10: sitemap

 public function sitemap()
 {
     // create new sitemap object
     $sitemap = \App::make('sitemap');
     $date = new \DateTime();
     // set cache key (string), duration in minutes (Carbon|Datetime|int), turn on/off (boolean)
     // by default cache is disabled
     $sitemap->setCache('laravel.sitemap', 60);
     // check if there is cached sitemap and build new only if is not
     if (!$sitemap->isCached()) {
         // add item with translations (url, date, priority, freq, images, title, translations)
         $translations = [['language' => 'en', 'url' => \URL::to('/en')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK')]];
         $sitemap->add(\URL::to('/'), $date->format('Y-m-d') . 'T00:00:00+08:00', '1', 'weekly', [], null, $translations);
         $translations = [['language' => 'en', 'url' => \URL::to('/en/portfolio')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN/作品集')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK/作品集')]];
         $sitemap->add(\URL::to('/作品集'), $date->format('Y-m-d') . 'T00:00:00+08:00', '0.9', 'weekly', [], null, $translations);
         $translations = [['language' => 'en', 'url' => \URL::to('/en/freelance-HK')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN/香港freelance')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK/香港freelance')]];
         $sitemap->add(\URL::to('/香港freelance'), $date->format('Y-m-d') . 'T00:00:00+08:00', '0.9', 'weekly', [], null, $translations);
         $translations = [['language' => 'en', 'url' => \URL::to('/en/web-design-host-seo')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN/网页设计-寄存-SEO')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK/網頁設計-寄存-SEO')]];
         $sitemap->add(\URL::to('/網頁設計-寄存-SEO'), $date->format('Y-m-d') . 'T00:00:00+08:00', '0.9', 'weekly', [], null, $translations);
         $translations = [['language' => 'en', 'url' => \URL::to('/en/choose-online-partner')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN/网站顾问')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK/網站顧問')]];
         $sitemap->add(\URL::to('/網站顧問'), $date->format('Y-m-d') . 'T00:00:00+08:00', '0.9', 'weekly', [], null, $translations);
         $translations = [['language' => 'en', 'url' => \URL::to('/en/contact-freelance')], ['language' => 'zh-CN', 'url' => \URL::to('/zh-CN/联络freelance')], ['language' => 'zh-HK', 'url' => \URL::to('/zh-HK/聯絡freelance')]];
         $sitemap->add(\URL::to('/聯絡freelance'), $date->format('Y-m-d') . 'T00:00:00+08:00', '0.9', 'weekly', [], null, $translations);
     }
     // show your sitemap (options: 'xml' (default), 'html', 'txt', 'ror-rss', 'ror-rdf')
     return $sitemap->render('xml');
 }
开发者ID:Keepney,项目名称:keepney,代码行数:27,代码来源:HomeController.php

示例11: slim

 /**
  * Get the available container instance.
  *
  * @param  string  $key
  * @return mixed|\Slim\Slim
  */
 function slim($key = '')
 {
     if (is_null($key)) {
         return App::container;
     }
     return App::make($key);
 }
开发者ID:cssailing,项目名称:rest-api,代码行数:13,代码来源:helpers.php

示例12: test_it_persists_a_todolist_for_a_given_user

 public function test_it_persists_a_todolist_for_a_given_user()
 {
     $user = \Laracasts\TestDummy\Factory::create(App\Umbrella\User\User::class);
     $todolistRepo = App::make('App\\Umbrella\\Todo\\Repository\\TodolistRepositoryInterface');
     $todolist = $todolistRepo->create('Private', $user);
     $this->seeInDatabase('todolist', ['name' => 'Private']);
 }
开发者ID:burimshala,项目名称:todoapp,代码行数:7,代码来源:TodolistRepositoryTest.php

示例13: setUp

 public function setUp()
 {
     parent::setUp();
     \App::bind("App\\Repositories\\RecipeRepositoryInterface", "App\\Tests\\StubRepositories\\RecipeRepository");
     \App::bind("App\\Presenter\\FeedInterface", "App\\Presenter\\Feed");
     $this->controller = new FeedController(\App::make("App\\Presenter\\FeedInterface"), \App::make("App\\Repositories\\RecipeRepositoryInterface"));
 }
开发者ID:k-kurikuri,项目名称:Laravel.JpRecipe,代码行数:7,代码来源:FeedControllerTest.php

示例14: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $asset = \App::make('asset');
     $asset->styles();
     $asset->scripts();
     $this->line('Generated and published assets');
 }
开发者ID:lightgear,项目名称:asset,代码行数:12,代码来源:Generate.php

示例15: setUp

 public function setUp()
 {
     // During the parent's setup, both a 'es' 'Spanish' and 'en' 'English' languages are inserted into the database.
     parent::setUp();
     $this->languageRepository = \App::make(LanguageRepository::class);
     $this->translationRepository = \App::make(TranslationRepository::class);
 }
开发者ID:MarkRedeman,项目名称:translation,代码行数:7,代码来源:TranslationRepositoryTest.php


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