예제 #1
0
파일: Header.php 프로젝트: rudraks/core
 public static function scan()
 {
     Browser::warn("Scanning All Web Modules");
     ResourceUtil::$RESOURCE_DIST_DIR = "resources_cache";
     // READ MODULES
     self::$webmodules = self::getModuleProperties(LIB_PATH, self::$webmodules);
     self::$webmodules = self::getModuleProperties(RESOURCE_PATH, self::$webmodules);
     self::$cache->set('webmodules', self::$webmodules);
     // CREATE MODULE FILES
     self::$modulefiles = array();
     $header = new Header();
     if (!empty(self::$webmodules['bundles'])) {
         foreach (self::$webmodules['bundles'] as $module => $moduleObject) {
             $header->_import($module);
         }
     }
     $header->minify();
     self::$cache->set('modulefiles', self::$modulefiles);
     self::$cache->save();
     FileUtil::build_write(self::$BUNDLE_PATH, json_encode(Header::getModules()));
     Browser::info(self::$webmodules, self::$modulefiles);
 }
예제 #2
0
파일: controller.php 프로젝트: rudraks/core
<?php

// Default RudraX Plug
RudraX::mapRequest("combinejs/{mdfile}", function () {
    include_once RUDRA . "/core/handler/ResourceHandler.php";
    $handler = new ResourceHandler();
    $handler->invokeHandler();
});
RudraX::mapRequest("template/{temp}", function ($temp = "nohandler") {
    return RudraX::invokeHandler($temp);
});
RudraX::mapRequest('data/{eventname}', function ($eventName = "dataHandler") {
    $controller = RudraX::getDataController();
    $controller->invokeHandler($eventName);
});
RudraX::mapRequest("resources.json", function ($cb = "") {
    require_once RUDRA . '/core/model/Header.php';
    echo $cb . "((" . json_encode(Header::getModules()) . ").bundles)";
});
// Default Plug for default page
RudraX::mapRequest("", function () {
    return RudraX::invokeHandler("Index");
});