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


PHP Support\Fluent類代碼示例

本文整理匯總了PHP中Illuminate\Support\Fluent的典型用法代碼示例。如果您正苦於以下問題:PHP Fluent類的具體用法?PHP Fluent怎麽用?PHP Fluent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: migrate

 /**
  * Update/migrate an extension.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Migrator  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function migrate(Listener $listener, Fluent $extension)
 {
     if (!$this->factory->started($extension->get('name'))) {
         return $listener->abortWhenRequirementMismatched();
     }
     return $this->execute($listener, 'migration', $extension, $this->getMigrationClosure());
 }
開發者ID:jitheshgopan,項目名稱:extension,代碼行數:15,代碼來源:Migrator.php

示例2: update

 /**
  * Update setting.
  *
  * @param  \Orchestra\Contracts\Foundation\Listener\SettingUpdater  $listener
  * @param  array  $input
  *
  * @return mixed
  */
 public function update(SettingUpdateListener $listener, array $input)
 {
     $input = new Fluent($input);
     $driver = $this->getValue($input['email_driver'], 'mail.driver');
     $validation = $this->validator->on($driver)->with($input->toArray());
     if ($validation->fails()) {
         return $listener->settingFailedValidation($validation->getMessageBag());
     }
     $memory = $this->memory;
     $memory->put('site.name', $input['site_name']);
     $memory->put('site.description', $input['site_description']);
     $memory->put('site.registrable', $input['site_registrable'] === 'yes');
     $memory->put('email.driver', $driver);
     $memory->put('email.from', ['address' => $this->getValue($input['email_address'], 'mail.from.address'), 'name' => $input['site_name']]);
     if (empty($input['email_password']) && $input['enable_change_password'] === 'no') {
         $input['email_password'] = $memory->get('email.password');
     }
     if (empty($input['email_secret']) && $input['enable_change_secret'] === 'no') {
         $input['email_secret'] = $memory->get('email.secret');
     }
     $memory->put('email.host', $this->getValue($input['email_host'], 'mail.host'));
     $memory->put('email.port', $this->getValue($input['email_port'], 'mail.port'));
     $memory->put('email.username', $this->getValue($input['email_username'], 'mail.username'));
     $memory->put('email.password', $this->getValue($input['email_password'], 'mail.password'));
     $memory->put('email.encryption', $this->getValue($input['email_encryption'], 'mail.encryption'));
     $memory->put('email.sendmail', $this->getValue($input['email_sendmail'], 'mail.sendmail'));
     $memory->put('email.queue', $input['email_queue'] === 'yes');
     $memory->put('email.key', $this->getValue($input['email_key'], "services.{$driver}.key"));
     $memory->put('email.secret', $this->getValue($input['email_secret'], "services.{$driver}.secret"));
     $memory->put('email.domain', $this->getValue($input['email_domain'], "services.{$driver}.domain"));
     $memory->put('email.region', $this->getValue($input['email_region'], "services.{$driver}.region"));
     Event::fire('orchestra.saved: settings', [$memory, $input]);
     return $listener->settingHasUpdated();
 }
開發者ID:stevebauman,項目名稱:foundation,代碼行數:42,代碼來源:Setting.php

示例3: deactivate

 /**
  * Deactivate an extension.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Deactivator  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function deactivate(Listener $listener, Fluent $extension)
 {
     if (!$this->factory->started($extension->get('name')) && !$this->factory->activated($extension->get('name'))) {
         return $listener->abortWhenRequirementMismatched();
     }
     $this->factory->deactivate($extension->get('name'));
     return $listener->deactivationHasSucceed($extension);
 }
開發者ID:jitheshgopan,項目名稱:extension,代碼行數:16,代碼來源:Deactivator.php

示例4: verifyExpression

 /**
  * Vaildate if expression contains the reserve keys
  *
  * @param  array $expression
  * @return boolean
  * @throws  \Elepunk\Evaluator\Exceptions\MissingKeyException
  */
 protected function verifyExpression(Fluent $expression)
 {
     foreach ($this->reservedKeys as $key) {
         if (is_null($expression->get($key))) {
             throw new MissingKeyException("Expression is missing {$key}");
         }
     }
     return true;
 }
開發者ID:elepunk,項目名稱:evaluator,代碼行數:16,代碼來源:ExpressionCheckerTrait.php

示例5: execute

 /**
  * Execute extension processing.
  *
  * @param  object  $listener
  * @param  string  $type
  * @param  \Illuminate\Support\Fluent  $extension
  * @param  \Closure  $callback
  *
  * @return mixed
  */
 protected function execute($listener, $type, Fluent $extension, Closure $callback)
 {
     $name = $extension->get('name');
     try {
         // Check if folder is writable via the web instance, this would
         // avoid issue running Orchestra Platform with debug as true where
         // creating/copying the directory would throw an ErrorException.
         if (!$this->factory->permission($name)) {
             throw new FilePermissionException("[{$name}] is not writable.");
         }
         call_user_func($callback, $this->factory, $name);
     } catch (FilePermissionException $e) {
         return call_user_func([$listener, "{$type}HasFailed"], $extension, ['error' => $e->getMessage()]);
     }
     return call_user_func([$listener, "{$type}HasSucceed"], $extension);
 }
開發者ID:jitheshgopan,項目名稱:extension,代碼行數:26,代碼來源:Processor.php

示例6: __construct

 /**
  * FluentParameters constructor.
  *
  * @param array|object $attributes
  */
 public function __construct($attributes)
 {
     parent::__construct($attributes);
     if (isset($attributes['templates']) && is_array($attributes['templates'])) {
         $templates = new Collection();
         foreach ($attributes['templates'] as $template) {
             $templates->push(new Fluent($template));
         }
         $this->templates = $templates;
     }
 }
開發者ID:yajra,項目名稱:cms-core,代碼行數:16,代碼來源:FluentParameters.php

示例7: update

 /**
  * Update an extension configuration.
  *
  * @param  \Orchestra\Contracts\Extension\Listener\Configure  $listener
  * @param  \Illuminate\Support\Fluent  $extension
  * @param  array  $input
  *
  * @return mixed
  */
 public function update(Listener $listener, Fluent $extension, array $input)
 {
     if (!Extension::started($extension->get('name'))) {
         return $listener->suspend(404);
     }
     $validation = $this->validator->with($input, ["orchestra.validate: extension.{$extension->get('name')}"]);
     if ($validation->fails()) {
         return $listener->updateConfigurationFailedValidation($validation->getMessageBag(), $extension->uid);
     }
     $memory = Foundation::memory();
     $config = (array) $memory->get("extension.active.{$extension->get('name')}.config", []);
     $input = new Fluent(array_merge($config, $input));
     unset($input['_token']);
     Event::fire("orchestra.saving: extension.{$extension->get('name')}", [&$input]);
     $memory->put("extensions.active.{$extension->get('name')}.config", $input->getAttributes());
     $memory->put("extension_{$extension->get('name')}", $input->getAttributes());
     Event::fire("orchestra.saved: extension.{$extension->get('name')}", [$input]);
     return $listener->configurationUpdated($extension);
 }
開發者ID:stevebauman,項目名稱:foundation,代碼行數:28,代碼來源:Configure.php

示例8: deactivationHasSucceed

 /**
  * Response when extension deactivation has succeed.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 public function deactivationHasSucceed(Fluent $extension)
 {
     $this->refreshRouteCache();
     $this->info("Extension [{$extension->get('name')}] deactivated.");
 }
開發者ID:jitheshgopan,項目名稱:extension,代碼行數:12,代碼來源:DeactivateCommand.php

示例9: compilePrimary

 /**
  * Compile a primary key command.
  *
  * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
  * @param  \Illuminate\Support\Fluent  $command
  * @return string
  */
 public function compilePrimary(Blueprint $blueprint, Fluent $command)
 {
     $command->name(null);
     return $this->compileKey($blueprint, $command, 'primary key');
 }
開發者ID:pin-cnx,項目名稱:orientdb-laravel-5,代碼行數:12,代碼來源:OrientdbGrammar.php

示例10: queueToPublisher

 /**
  * Queue publishing asset to publisher.
  *
  * @param  \Illuminate\Support\Fluent  $extension
  *
  * @return mixed
  */
 protected function queueToPublisher(Fluent $extension)
 {
     Publisher::queue($extension->get('name'));
     return $this->redirect(handles('orchestra::publisher'));
 }
開發者ID:stevebauman,項目名稱:foundation,代碼行數:12,代碼來源:ActionController.php

示例11: isEmptyDir

 /**
  * Determing if it is just an empty directory
  *
  * @return bool
  */
 public function isEmptyDir()
 {
     $emptyDir = $this->ingredient->get('empty-dir');
     if (is_null($emptyDir)) {
         return false;
     }
     return $emptyDir;
 }
開發者ID:elepunk,項目名稱:oven,代碼行數:13,代碼來源:Ingredient.php

示例12: sendAuthorization

 /**
  * Send the request after setting authorization params
  * @return Illuminate\Http\Response
  */
 public function sendAuthorization()
 {
     $this->request->merge($this->params->toArray());
     $this->oauth->getIssuer()->setRequest($this->request);
     $token = $this->oauth->issueAccessToken();
     if (auth()->check()) {
         $token['user'] = auth()->user();
     }
     return response()->json($token);
 }
開發者ID:ruysu,項目名稱:laravel-core,代碼行數:14,代碼來源:AuthController.php

示例13: get

 public function get($key, $default = null)
 {
     if ($key === 'date') {
         return $this->dateTime();
     }
     return parent::get($key, $default);
 }
開發者ID:lud,項目名稱:press,代碼行數:7,代碼來源:MetaWrapper.php

示例14: __get

 /**
  * Magic method to get items by key.
  *
  * @param  string  $key
  *
  * @return mixed
  */
 public function __get($key)
 {
     if (!isset($this->items->{$key})) {
         return;
     }
     return $this->items->get($key);
 }
開發者ID:wendel841,項目名稱:view,代碼行數:14,代碼來源:Manifest.php

示例15: __construct

 public function __construct($fileinfo)
 {
     if ($fileinfo instanceof SplFileInfo === false) {
         $fileinfo = new SplFileInfo($fileinfo);
     }
     parent::__construct($this->parseFileInfo($fileinfo));
     $this->fileinfo = $fileinfo;
 }
開發者ID:recca0120,項目名稱:laravel-support,代碼行數:8,代碼來源:Fluent.php


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