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


PHP Application::loadPlugins方法代碼示例

本文整理匯總了PHP中Alchemy\Phrasea\Application::loadPlugins方法的典型用法代碼示例。如果您正苦於以下問題:PHP Application::loadPlugins方法的具體用法?PHP Application::loadPlugins怎麽用?PHP Application::loadPlugins使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Alchemy\Phrasea\Application的用法示例。


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

示例1: call_user_func

use Alchemy\Phrasea\Application as PhraseaApplication;
use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Controller\Api\Oauth2;
use Alchemy\Phrasea\Controller\Api\V1;
use Alchemy\Phrasea\Core\Event\ApiLoadEndEvent;
use Alchemy\Phrasea\Core\Event\ApiLoadStartEvent;
use Alchemy\Phrasea\Core\Event\Subscriber\ApiOauth2ErrorsSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber;
use Monolog\Logger;
use Monolog\Processor\WebProcessor;
use Silex\Application as SilexApplication;
use Symfony\Component\HttpFoundation\Request;
return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
    $app = new PhraseaApplication($environment);
    $app->loadPlugins();
    $app['exception_handler'] = $app->share(function ($app) {
        return new ApiExceptionHandlerSubscriber($app);
    });
    $app['monolog'] = $app->share($app->extend('monolog', function (Logger $monolog) {
        $monolog->pushProcessor(new WebProcessor());
        return $monolog;
    }));
    $app->register(new \API_V1_Timer());
    $app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent());
    $app->get('/api/', function (Request $request, SilexApplication $app) {
        $apiAdapter = new \API_V1_adapter($app);
        $result = new \API_V1_result($app, $request, $apiAdapter);
        return $result->set_datas(['name' => $app['conf']->get(['registry', 'general', 'title']), 'type' => 'phraseanet', 'description' => $app['conf']->get(['registry', 'general', 'description']), 'documentation' => 'https://docs.phraseanet.com/Devel', 'versions' => ['1' => ['number' => $apiAdapter->get_version(), 'uri' => '/api/v1/', 'authenticationProtocol' => 'OAuth2', 'authenticationVersion' => 'draft#v9', 'authenticationEndPoints' => ['authorization_token' => '/api/oauthv2/authorize', 'access_token' => '/api/oauthv2/token']]]])->get_response();
    });
    $app->mount('/api/oauthv2', new Oauth2());
開發者ID:romainneutron,項目名稱:Phraseanet,代碼行數:30,代碼來源:Api.php

示例2: loadPlugins

 /**
  * {@inheritdoc}
  */
 public function loadPlugins()
 {
     parent::loadPlugins();
     call_user_func(function ($cli) {
         require $cli['plugins.directory'] . '/commands.php';
     }, $this);
 }
開發者ID:romainneutron,項目名稱:Phraseanet,代碼行數:10,代碼來源:CLI.php

示例3: loadPlugins

 /**
  * {@inheritdoc}
  */
 public function loadPlugins()
 {
     parent::loadPlugins();
     call_user_func(function ($cli) {
         if (file_exists($cli['plugin.path'] . '/commands.php')) {
             require $cli['plugin.path'] . '/commands.php';
         }
     }, $this);
 }
開發者ID:luisbrito,項目名稱:Phraseanet,代碼行數:12,代碼來源:CLI.php


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