本文整理汇总了PHP中Application::getContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getContainer方法的具体用法?PHP Application::getContainer怎么用?PHP Application::getContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::getContainer方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ensureKernelShutdown
/**
* Shuts the kernel down if it was used in the test.
*/
protected static function ensureKernelShutdown()
{
if (null !== static::$application) {
$container = static::$application->getContainer();
static::$application->shutdown(static::$application);
$container->reset();
static::$application->setContainer($container);
}
}
示例2: Application
<?php
/**
* ownCloud - user_permission
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Dino Peng <dino.p@inwinstack.com>
* @copyright Dino Peng 2015
*/
namespace OCA\User_Permission\AppInfo;
$app = new Application();
$app->getContainer()->query('UserHooks')->register();
\OCP\Util::addScript('user_permission', 'permission');
\OCP\Util::addStyle('user_permission', "style");
示例3: Application
* @copyright 2013 Frank Karlitschek frank@owncloud.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Activity\AppInfo;
$app = new Application();
$c = $app->getContainer();
// add an navigation entry
$navigationEntry = function () use($c) {
return ['id' => $c->getAppName(), 'order' => 1, 'name' => $c->query('ActivityL10N')->t('Activity'), 'href' => $c->getServer()->getURLGenerator()->linkToRoute('activity.Activities.showList'), 'icon' => $c->getServer()->getURLGenerator()->imagePath('activity', 'activity.svg')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
// register the hooks for filesystem operations. All other events from other apps has to be send via the public api
\OCA\Activity\FilesHooksStatic::register();
\OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OCA\\Activity\\Hooks', 'deleteUser');
\OCA\Activity\Consumer::register($c->getServer()->getActivityManager(), $c);
// Personal settings for notifications and emails
\OCP\App::registerPersonal($c->getAppName(), 'personal');
示例4: testGetContainer
public function testGetContainer()
{
$this->assertThat($this->object->getContainer(), $this->isInstanceOf('IDependencyInjectionContainer'));
}
示例5: Application
<?php
/**
* ownCloud - files_mv
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author eotryx <mhfiedler@gmx.de>
* @copyright eotryx 2015
*/
namespace OCA\Files_mv\AppInfo;
\OCP\Util::addScript('files_mv', "move");
\OCP\Util::addStyle('files_mv', 'mv');
$app = new Application();
$app->getContainer()->query('FilesHook')->register();
\OCA\Files_mv\HookStatic::register();
\OC::$server->getActivityManager()->registerExtension(function () {
return new \OCA\Files_mv\Activity(\OC::$server->query('L10NFactory'), \OC::$server->getURLGenerator(), \OC::$server->getActivityManager());
});
示例6: Application
<?php
/**
* ownCloud - registration
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Pellaeon Lin <pellaeon@cnmc.tw>
* @copyright Pellaeon Lin 2015
*/
namespace OCA\Registration\AppInfo;
$app = new Application();
$controller = $app->getContainer()->query('SettingsController');
return $controller->displayPanel()->render();
示例7: Application
<?php
/**
* ownCloud - user_status_validator
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Dino Peng <dino.p@inwinstack.com>
* @copyright Dino Peng 2015
*/
namespace OCA\User_Status_Validator\AppInfo;
$app = new Application();
$app->getContainer()->query('LoginHooks')->register();
示例8: Application
<?php
/**
* @author Björn Schießle <schiessle@owncloud.com>
*
* @copyright Copyright (c) 2015, ownCloud, Inc.
* @license AGPL-3.0
*
* This code is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License, version 3,
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
namespace OCA\PopularityContestServer\AppInfo;
$app = new Application();
$app->registerOCSApi();
$container = $app->getContainer();
$container->query('OCP\\INavigationManager')->add(function () use($container) {
$urlGenerator = $container->query('OCP\\IURLGenerator');
$l10n = $container->query('OCP\\IL10N');
return ['id' => 'popularitycontestserver', 'order' => 10, 'href' => $urlGenerator->linkToRoute('popularitycontestserver.page.index'), 'icon' => $urlGenerator->imagePath('popularitycontestserver', 'app.svg'), 'name' => $l10n->t('Popularity Contest')];
});