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


PHP Context::isInternalModule方法代码示例

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


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

示例1: runResolve

 public function runResolve(framework\Request $request)
 {
     $theme = isset($request['theme_name']) ? $request['theme_name'] : framework\Settings::getThemeName();
     if ($request->hasParameter('css')) {
         $this->getResponse()->setContentType('text/css');
         if (!$request->hasParameter('theme_name')) {
             $basepath = THEBUGGENIE_PATH . 'public' . DS . 'css';
             $asset = THEBUGGENIE_PATH . 'public' . DS . 'css' . DS . $request->getParameter('css');
         } else {
             $basepath = THEBUGGENIE_PATH . 'themes';
             $asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'css' . DS . $request->getParameter('css');
         }
     } elseif ($request->hasParameter('js')) {
         $this->getResponse()->setContentType('text/javascript');
         if ($request->hasParameter('theme_name')) {
             $basepath = THEBUGGENIE_PATH . 'themes';
             $asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'js' . DS . $request->getParameter('js');
         } elseif ($request->hasParameter('module_name') && framework\Context::isModuleLoaded($request['module_name'])) {
             $module_path = framework\Context::isInternalModule($request['module_name']) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
             $basepath = $module_path . $request['module_name'] . DS . 'public' . DS . 'js';
             $asset = $module_path . $request['module_name'] . DS . 'public' . DS . 'js' . DS . $request->getParameter('js');
         } else {
             $basepath = THEBUGGENIE_PATH . 'public' . DS . 'js';
             $asset = THEBUGGENIE_PATH . 'public' . DS . 'js' . DS . $request->getParameter('js');
         }
     } else {
         throw new \Exception('The expected theme Asset type is not supported.');
     }
     $fileAsset = new AssetCollection(array(new FileAsset($asset, array(), $basepath)));
     $fileAsset->load();
     // Do not decorate the asset with the theme's header/footer
     $this->getResponse()->setDecoration(framework\Response::DECORATE_NONE);
     return $this->renderText($fileAsset->dump());
 }
开发者ID:AzerothShard,项目名称:thebuggenie,代码行数:34,代码来源:Asset.php

示例2:

    ?>
>
                <span class="badge csrf <?php 
    echo $csrf_enabled ? 'enabled' : '';
    ?>
">CSRF</span>
                <span class="badge routename"><?php 
    echo $route_name;
    ?>
</span>
                <span class="badge url"><?php 
    echo $route;
    ?>
</span>
                <span class="badge method">\thebuggenie\<?php 
    echo Context::isInternalModule($module) ? "core\\" : '';
    ?>
<span class="badge modulename"><?php 
    echo $module;
    ?>
</span>\Actions::<?php 
    echo $action;
    ?>
()</span>
                <?php 
    if ($overridden) {
        ?>
                    <span class="badge csrf <?php 
        echo $csrf_enabled ? 'enabled' : '';
        ?>
">Overridden</span>
开发者ID:founderio,项目名称:thebuggenie,代码行数:31,代码来源:_routing.inc.php

示例3: loadModuleAnnotationRoutes

 protected function loadModuleAnnotationRoutes($classname, $module)
 {
     if (!class_exists($classname)) {
         return;
     }
     $internal = Context::isInternalModule($module);
     $reflection = new \ReflectionClass($classname);
     $docblock = $reflection->getDocComment();
     $annotationset = new AnnotationSet($docblock);
     $route_url_prefix = '';
     $route_name_prefix = '';
     $default_route_name_prefix = $internal ? '' : $module . '_';
     if ($annotationset->hasAnnotation('Routes')) {
         $routes = $annotationset->getAnnotation('Routes');
         if ($routes->hasProperty('url_prefix')) {
             $route_url_prefix = $routes->getProperty('url_prefix');
         }
         if ($routes->hasProperty('name_prefix')) {
             $route_name_prefix = $routes->getProperty('name_prefix', $default_route_name_prefix);
         }
     } else {
         $route_name_prefix = $default_route_name_prefix;
     }
     foreach ($reflection->getMethods() as $method) {
         $annotationset = new AnnotationSet($method->getDocComment());
         if ($annotationset->hasAnnotation('Route')) {
             if (substr($method->name, 0, 3) != 'run') {
                 throw new exceptions\InvalidRouteException('A @Route annotation can only be used on methods prefixed with "run"');
             }
             $options = array();
             $route_annotation = $annotationset->getAnnotation('Route');
             $action = substr($method->name, 3);
             $name = $route_name_prefix . ($route_annotation->hasProperty('name') ? $route_annotation->getProperty('name') : strtolower($action));
             $route = $route_url_prefix . $route_annotation->getProperty('url');
             $options['csrf_enabled'] = $annotationset->hasAnnotation('CsrfProtected');
             $options['anonymous_route'] = $annotationset->hasAnnotation('AnonymousRoute');
             $http_methods = $route_annotation->getProperty('methods', array());
             $params = $annotationset->hasAnnotation('Parameters') ? $annotationset->getAnnotation('Parameters')->getProperties() : array();
             if ($annotationset->hasAnnotation('Overrides')) {
                 $name = $annotationset->getAnnotation('Overrides')->getProperty('name');
                 $this->overrideRoute($name, $module, $action);
             } elseif ($this->hasRoute($name)) {
                 throw new exceptions\RoutingException('A route that overrides another route must have an @Override annotation');
             } else {
                 $this->addRoute($name, $route, $module, $action, $params, $options, $http_methods);
             }
         }
     }
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:49,代码来源:Routing.php

示例4: runResolve

 public function runResolve(framework\Request $request)
 {
     $theme = isset($request['theme_name']) ? $request['theme_name'] : framework\Settings::getThemeName();
     $module_path = framework\Context::isInternalModule($request['module_name']) ? THEBUGGENIE_INTERNAL_MODULES_PATH : THEBUGGENIE_MODULES_PATH;
     if ($request->hasParameter('css')) {
         $this->getResponse()->setContentType('text/css');
         if ($request->hasParameter('module_name') && framework\Context::isModuleLoaded($request['module_name'])) {
             $basepath = $module_path . $request['module_name'] . DS . 'public' . DS . 'css';
             $asset = $module_path . $request['module_name'] . DS . 'public' . DS . 'css' . DS . $request->getParameter('css');
         } elseif (!$request->hasParameter('theme_name')) {
             $basepath = THEBUGGENIE_PATH . 'public' . DS . 'css';
             $asset = THEBUGGENIE_PATH . 'public' . DS . 'css' . DS . $request->getParameter('css');
         } else {
             $basepath = THEBUGGENIE_PATH . 'themes';
             $asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'css' . DS . $request->getParameter('css');
         }
     } elseif ($request->hasParameter('js')) {
         $this->getResponse()->setContentType('text/javascript');
         if ($request->hasParameter('theme_name')) {
             $basepath = THEBUGGENIE_PATH . 'themes';
             $asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'js' . DS . $request->getParameter('js');
         } elseif ($request->hasParameter('module_name') && framework\Context::isModuleLoaded($request['module_name'])) {
             $basepath = $module_path . $request['module_name'] . DS . 'public' . DS . 'js';
             $asset = $module_path . $request['module_name'] . DS . 'public' . DS . 'js' . DS . $request->getParameter('js');
         } else {
             $basepath = THEBUGGENIE_PATH . 'public' . DS . 'js';
             $asset = THEBUGGENIE_PATH . 'public' . DS . 'js' . DS . $request->getParameter('js');
         }
     } elseif ($request->hasParameter('image')) {
         $basepath = THEBUGGENIE_PATH . 'themes';
         $asset = THEBUGGENIE_PATH . 'themes' . DS . $theme . DS . 'images';
         if (isset($request['module_name'])) {
             $asset .= DS . "modules" . DS . $request['module_name'];
         }
         if (isset($request['folder'])) {
             $asset .= DS . $request['folder'];
         }
         $asset .= DS . $request->getParameter('image');
         if (!file_exists($asset) && isset($request['module_name']) && framework\Context::isModuleLoaded($request['module_name'])) {
             $basepath = $module_path . $request['module_name'] . DS . 'public' . DS . 'images';
             $asset = $module_path . $request['module_name'] . DS . 'public' . DS . 'images';
             if (isset($request['folder'])) {
                 $asset .= DS . $request['folder'];
             }
             $asset .= DS . $request->getParameter('image');
         }
         $fileinfo = finfo_open(FILEINFO_MIME_TYPE);
         $mimetype = finfo_file($fileinfo, $asset);
         finfo_close($fileinfo);
         $this->getResponse()->setContentType($mimetype);
     } else {
         throw new \Exception('The expected theme Asset type is not supported.');
     }
     $last_modified = filemtime($asset);
     $this->getResponse()->addHeader('Cache-Control: max-age=3600, must-revalidate');
     $this->getResponse()->addHeader('Last-Modified: ' . gmdate('D, d M Y H:i:s ', $last_modified) . 'GMT');
     $this->getResponse()->addHeader('ETag: ' . md5($last_modified));
     if (!$this->getResponse()->isModified($last_modified)) {
         return $this->return304();
     }
     $fileAsset = new AssetCollection(array(new FileAsset($asset, array(), $basepath)));
     $fileAsset->load();
     // Do not decorate the asset with the theme's header/footer
     $this->getResponse()->setDecoration(framework\Response::DECORATE_NONE);
     return $this->renderText($fileAsset->dump());
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:66,代码来源:Asset.php


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