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


PHP App::getContainer方法代碼示例

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


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

示例1: postDeleteUser

 public static function postDeleteUser($parameters)
 {
     $app = new App('sipgate');
     $container = $app->getContainer();
     $logger = $container->query('OCP\\ILogger');
     $logger->warn('hello!');
 }
開發者ID:pigulla,項目名稱:owncloud-sipgate,代碼行數:7,代碼來源:userhooks.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('popcornapp');
     $this->container = $app->getContainer();
     //echo var_dump($userSession);
     $this->controller = new XML('Test', array('/data/Pictures/holiday1.jpg', '/data/Pictures/holiday2.jpg', '/data/Pictures/holiday3.jpg', '/data/Pictures/holiday4.jpg'), 1);
 }
開發者ID:camilasan,項目名稱:popcornapp,代碼行數:8,代碼來源:XmlTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('popcornapp');
     $this->container = $app->getContainer();
     $this->request = $this->getMockBuilder('OCP\\IRequest')->getMock();
     //echo var_dump($userSession);
     $this->controller = new MltController('popcornapp', $this->request);
 }
開發者ID:camilasan,項目名稱:popcornapp,代碼行數:9,代碼來源:MltControllerTest.php

示例4: setUp

 public function setUp()
 {
     $app = new App('notes');
     $container = $app->getContainer();
     $container->registerService('UserId', function ($c) {
         return $this->userId;
     });
     $this->controller = $container->query('OCA\\Notes\\Controller\\NotesApiController');
     $this->fs = $container->query('OCP\\Files\\IRootFolder');
     $this->fs->newFolder($this->notesFolder);
 }
開發者ID:cg19910712,項目名稱:notes,代碼行數:11,代碼來源:NotesApiControllerTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('ownnotes');
     $container = $app->getContainer();
     // only replace the user id
     $container->registerService('UserId', function ($c) {
         return $this->userId;
     });
     $this->controller = $container->query('OCA\\OwnNotes\\Controller\\NoteController');
     $this->mapper = $container->query('OCA\\OwnNotes\\Db\\NoteMapper');
 }
開發者ID:tzkmx,項目名稱:app-tutorial,代碼行數:12,代碼來源:NoteIntegrationTest.php

示例6: __construct

 public function __construct()
 {
     $app = new App('sipgate');
     $this->container = $app->getContainer();
     $this->appName = $this->container->query('AppName');
     $this->db = $this->container->query('OCP\\IDBConnection');
     $this->config = $this->container->query('OCP\\IConfig');
     $this->logger = $this->container->query('OCA\\Sipgate\\Service\\AppLogger');
     $this->appSettings = $this->container->query('OCA\\Sipgate\\Service\\AppSettings');
     $reflect = new \ReflectionClass($this);
     $logSuffix = mb_strtolower($reflect->getShortName());
     $this->logger->setSuffix($logSuffix);
     // Run every 15 Minutes
     $this->setInterval(15 * 60);
 }
開發者ID:pigulla,項目名稱:owncloud-sipgate,代碼行數:15,代碼來源:base.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('files_sharing_ext');
     $this->container = $app->getContainer();
 }
開發者ID:inwinstack,項目名稱:owncloud-files_sharing_ext,代碼行數:6,代碼來源:AppTest.php

示例8: App

<?php

/**
 * ownCloud - shared_session
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Dauba <dauba.k@inwinstack.com>
 * @copyright Dauba 2016
 */
namespace OCA\Shared_Session\AppInfo;

use OCP\AppFramework\App;
use OCA\Shared_Session\DatabaseSessionHandler;
$app = new App('shared_session');
$serverContainer = $app->getContainer()->getServer();
$config = $serverContainer->getSystemConfig();
$handler = new DatabaseSessionHandler();
$handler->init($config->getValue("dbtype"), $config->getValue("dbhost"), $config->getValue("dbuser"), $config->getValue("dbpassword"), $config->getValue("dbname"));
$session_Est = session_set_save_handler($handler, true);
開發者ID:inwinstack,項目名稱:owncloud-shared_session,代碼行數:21,代碼來源:app.php

示例9: _beforeSuite

 /**
  * Called before executing all tests in a suite
  *
  * If the module is injected, you need to use _initialize()
  *
  * @param array $settings
  */
 public function _beforeSuite($settings = [])
 {
     $this->coreTestCase = new CoreTestCase();
     $app = new App('gallery-test-setup');
     $this->container = $app->getContainer();
     $this->server = $this->container->getServer();
     $this->rootFolder = $this->server->getRootFolder();
     $this->userManager = $this->server->getUserManager();
     /**
      * Logging hooks are missing at the moment, so we need to disable encryption
      *
      * @link https://github.com/owncloud/core/issues/18085#issuecomment-128093797
      */
     $this->server->getConfig()->setAppValue('core', 'encryption_enabled', 'no');
     // This is because the filesystem is not properly cleaned up sometimes
     $this->server->getAppManager()->disableApp('files_trashbin');
     $this->setPreviewProviders();
     $this->createTestSetup($this->userId, $this->userPassword);
     $this->createTestSetup($this->sharerUserId, $this->sharerPassword);
     $this->createShares();
 }
開發者ID:enoch85,項目名稱:owncloud-testserver,代碼行數:28,代碼來源:DataSetup.php

示例10: App

<?php

/**
 * ownCloud - sipgate
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Raphael Pigulla <pigulla@four66.com>
 * @copyright Raphael Pigulla 2015
 */
use OCP\AppFramework\App;
use OCA\Sipgate\Service\UserSettings;
$app = new App('sipgate');
$container = $app->getContainer();
/** @var OCP\IDateTimeZone $timeZone */
$timeZone = $container->query('OCP\\IDateTimeZone');
/** @var OCA\Sipgate\Service\UserSettings $userSettings */
$userSettings = $container->query('OCA\\Sipgate\\Service\\UserSettings');
$lastUpdated = $userSettings->getLastUpdated();
$lastUpdated->setTimezone($timeZone->getTimeZone());
$template = new \OCP\Template('sipgate', 'settings-personal');
$template->assign('username', $userSettings->getUsername());
$template->assign('password', $userSettings->getPassword());
$template->assign('retention', $userSettings->getRetention());
$template->assign('syncPeriod', $userSettings->getSyncPeriod());
$template->assign('localUris', implode(' ', $userSettings->getLocalURIs()));
$template->assign('defaultCountryCode', $userSettings->getDefaultCountryCode());
$template->assign('lastUpdated', $lastUpdated->format('Y-m-d H:i:s'));
$template->assign('SYNC_PERIOD_MIN', UserSettings::SYNC_PERIOD_MIN);
$template->assign('SYNC_PERIOD_MAX', UserSettings::SYNC_PERIOD_MAX);
開發者ID:pigulla,項目名稱:owncloud-sipgate,代碼行數:31,代碼來源:settings-personal.php


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