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


PHP Container::getServiceIds方法代碼示例

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


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

示例1: install

 /**
  * Fügt die zu einen Modul zugehörigen Ressourcen ein
  *
  * @param \ACP3\Core\Modules\Installer\SchemaInterface $schema
  * @param int                                          $mode
  *
  * @return bool
  */
 public function install(SchemaInterface $schema, $mode = self::INSTALL_RESOURCES_AND_RULES)
 {
     $serviceIds = $this->container->getServiceIds();
     foreach ($serviceIds as $serviceId) {
         if (strpos($serviceId, $schema->getModuleName() . '.controller.') !== false) {
             $this->insertAclResources($serviceId, $schema->specialResources());
         }
     }
     if ($mode === self::INSTALL_RESOURCES_AND_RULES) {
         $this->insertAclRules($schema->getModuleName());
     }
     $this->aclCache->getDriver()->deleteAll();
     return true;
 }
開發者ID:acp3,項目名稱:core,代碼行數:22,代碼來源:AclInstaller.php

示例2: testGetServiceIds

 public function testGetServiceIds()
 {
     $sc = new Container();
     $sc->set('foo', $obj = new \stdClass());
     $sc->set('bar', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids');
     $sc = new ProjectServiceContainer();
     $this->assertEquals(array('scoped', 'scoped_foo', 'inactive', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'service_container'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods');
 }
開發者ID:d3ancole1995,項目名稱:symfony,代碼行數:9,代碼來源:ContainerTest.php

示例3: testGetServiceIds

 /**
  * @covers Symfony\Component\DependencyInjection\Container::getServiceIds
  */
 public function testGetServiceIds()
 {
     $sc = new Container();
     $sc->set('foo', $obj = new \stdClass());
     $sc->set('bar', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids');
     $sc = new ProjectServiceContainer();
     $this->assertEquals(array('bar', 'foo_bar', 'foo.baz', 'service_container'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by getXXXService() methods');
 }
開發者ID:netixpro,項目名稱:symfony,代碼行數:12,代碼來源:ContainerTest.php

示例4: assertSaneContainer

 public static function assertSaneContainer(Container $container, $message = '')
 {
     $errors = array();
     foreach ($container->getServiceIds() as $id) {
         try {
             $container->get($id);
         } catch (\Exception $e) {
             $errors[$id] = $e->getMessage();
         }
     }
     self::assertEquals(array(), $errors, $message);
 }
開發者ID:rfc1483,項目名稱:blog,代碼行數:12,代碼來源:WebProfilerExtensionTest.php

示例5: getServiceIds

 /**
  * Gets all service ids.
  *
  * @return array An array of all defined service ids
  */
 public function getServiceIds()
 {
     return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:9,代碼來源:ContainerBuilder.php

示例6: testGetServiceIds

 public function testGetServiceIds()
 {
     $sc = new Container();
     $sc->set('foo', $obj = new \stdClass());
     $sc->set('bar', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'foo', 'bar'), $sc->getServiceIds(), '->getServiceIds() returns all defined service ids');
     $sc = new ProjectServiceContainer();
     $sc->set('foo', $obj = new \stdClass());
     $this->assertEquals(array('service_container', 'internal', 'bar', 'foo_bar', 'foo.baz', 'circular', 'throw_exception', 'throws_exception_on_service_configuration', 'foo'), $sc->getServiceIds(), '->getServiceIds() returns defined service ids by factory methods in the method map, followed by service ids defined by set()');
 }
開發者ID:blazarecki,項目名稱:symfony,代碼行數:10,代碼來源:ContainerTest.php

示例7: getServiceIds

 /**
  * Gets all service ids.
  *
  * Wrapper for ContainerBuilder::getServiceIds method.
  *
  * @return array An array of all defined service ids
  */
 public function getServiceIds()
 {
     return parent::getServiceIds();
 }
開發者ID:sourcefabric,項目名稱:newscoop,代碼行數:11,代碼來源:ContainerBuilder.php

示例8: getServiceIds

 public function getServiceIds()
 {
     return $this->container->getServiceIds();
 }
開發者ID:oasmobile,項目名稱:php-slimapp,代碼行數:4,代碼來源:SlimApp.php


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