当前位置: 首页>>代码示例>>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;未经允许,请勿转载。