当前位置: 首页>>代码示例>>PHP>>正文


PHP Container::roles方法代码示例

本文整理汇总了PHP中Chamilo\CoreBundle\Framework\Container::roles方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::roles方法的具体用法?PHP Container::roles怎么用?PHP Container::roles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chamilo\CoreBundle\Framework\Container的用法示例。


在下文中一共展示了Container::roles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onKernelRequest

 /**
  * @param GetResponseEvent $event
  */
 public function onKernelRequest(GetResponseEvent $event)
 {
     $kernel = $event->getKernel();
     $request = $event->getRequest();
     $session = $request->getSession();
     /** @var ContainerInterface $container */
     $container = $this->container;
     // Setting container
     Container::setContainer($container);
     // Setting session.
     Container::setSession($request->getSession());
     // Setting database.
     $dbConnection = $container->get('database_connection');
     // Setting DB connection and Doctrine Manager.
     $database = new \Database();
     $database->setConnection($dbConnection);
     $entityManager = $container->get('doctrine')->getManager();
     $database->setManager($entityManager);
     // Setting course tool chain (in order to create tools to a course)
     \CourseManager::setToolList($container->get('chamilo_course.tool_chain'));
     \CourseManager::setEntityManager($entityManager);
     \CourseManager::setCourseManager($container->get('chamilo_core.manager.course'));
     \CourseManager::setCourseSettingsManager($container->get('chamilo_course.settings.manager'));
     Container::$mailer = $container->get('mailer');
     // Setting legacy properties.
     Container::$urlGenerator = $container->get('router');
     Container::$security = $container->get('security.context');
     Container::$translator = $container->get('translator');
     // Setting paths.
     Container::$rootDir = $container->get('kernel')->getRealRootDir();
     Container::$logDir = $container->get('kernel')->getLogDir();
     Container::$dataDir = $container->get('kernel')->getDataDir();
     Container::$tempDir = $container->get('kernel')->getCacheDir();
     Container::$courseDir = $container->get('kernel')->getDataDir();
     //Container::$configDir = $container->get('kernel')->getConfigDir();
     Container::$assets = $container->get('templating.helper.assets');
     Container::$roles = $container->get('security.role_hierarchy');
     // Setting editor
     Container::$htmlEditor = $container->get('chamilo_core.html_editor');
     if (!defined('DEFAULT_DOCUMENT_QUOTA')) {
         $default_quota = api_get_setting('document.default_document_quotum');
         // Just in case the setting is not correctly set
         if (empty($default_quota)) {
             $default_quota = 100000000;
         }
         define('DEFAULT_DOCUMENT_QUOTA', $default_quota);
     }
     // Access URL (multiple URL)
     /** @var \Sonata\PageBundle\Model\SnapshotPageProxy $page */
     $page = $request->get('page');
     if (isset($page) && !is_numeric($page)) {
         $siteId = $page->getSite()->getId();
         $request->getSession()->set('url_info', $page->getSite());
     } else {
         $siteId = 1;
     }
     $request->getSession()->set('url_id', $siteId);
     /*
             // Loading portal settings from DB.
             $settingsRefreshInfo = $em->getRepository('ChamiloCoreBundle:SettingsCurrent')->findOneByVariable('settings_latest_update');
             $settingsLatestUpdate = !empty($settingsRefreshInfo) ? $settingsRefreshInfo->getSelectedValue() : null;
     
             $settings = $session->get('_setting');
     
             if (empty($settings)) {
                 api_set_settings_and_plugins();
             } else {
                 if (isset($settings['settings_latest_update']) &&
                     $settings['settings_latest_update'] != $settingsLatestUpdate
                 ) {
                     api_set_settings_and_plugins();
                 }
             }*/
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:77,代码来源:LegacyListener.php


注:本文中的Chamilo\CoreBundle\Framework\Container::roles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。