本文整理汇总了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!');
}
示例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);
}
示例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);
}
示例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);
}
示例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');
}
示例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);
}
示例7: setUp
public function setUp()
{
parent::setUp();
$app = new App('files_sharing_ext');
$this->container = $app->getContainer();
}
示例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);
示例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();
}
示例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);