예제 #1
0
파일: AclInstaller.php 프로젝트: acp3/core
 /**
  * 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;
 }
예제 #2
0
 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');
 }
예제 #3
0
 /**
  * @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');
 }
예제 #4
0
 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);
 }
예제 #5
0
 /**
  * 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()));
 }
예제 #6
0
 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()');
 }
예제 #7
0
 /**
  * Gets all service ids.
  *
  * Wrapper for ContainerBuilder::getServiceIds method.
  *
  * @return array An array of all defined service ids
  */
 public function getServiceIds()
 {
     return parent::getServiceIds();
 }
예제 #8
0
 public function getServiceIds()
 {
     return $this->container->getServiceIds();
 }