Exemplo n.º 1
0
 public static function register()
 {
     self::initPath();
     // register autoload function
     spl_autoload_register('rtAutoloader::basic_autoloader');
     rtConfig::set('rt_core_dir', dirname(__FILE__));
 }
Exemplo n.º 2
0
 /**
  * get the application's config
  *
  * @param unknown_type $app_name
  * @param unknown_type $env
  */
 public static function getAppConfig($app_name, $env)
 {
     $app_conf = new AppConfig();
     $app_conf->setup();
     // init frameowk's dirs
     // TODO Make these dirs configable
     rtConfig::set('rt_apps_dir', rtConfig::get('rt_project_dir') . DS . 'apps');
     rtConfig::set('rt_app_dir', rtConfig::get('rt_apps_dir') . DS . $app_name);
     rtConfig::set('rt_app_config_dir', rtConfig::get('rt_app_dir') . DIRECTORY_SEPARATOR . 'config');
     rtConfig::set('rt_app_controllers_dir', rtConfig::get('rt_app_dir') . DS . 'controllers');
     rtConfig::set('rt_app_components_dir', rtConfig::get('rt_app_controllers_dir') . DS . 'components');
     rtConfig::set('rt_app_views_dir', rtConfig::get('rt_app_dir') . DS . 'views');
     rtConfig::set('rt_app_views_layout_dir', rtConfig::get('rt_app_views_dir') . DS . 'layout');
     rtConfig::set('rt_models_dir', rtConfig::get('rt_project_dir') . DS . 'lib' . DS . 'models');
     rtConfig::set('rt_app_helpers_dir', rtConfig::get('rt_app_dir') . DS . 'helper');
     rtConfig::set('rt_config_dir', rtConfig::get('rt_project_dir') . DS . 'config');
     rtConfig::set('rt_web_dir', rtConfig::get('rt_project_dir') . DS . 'web');
     rtConfig::set('rt_data_dir', rtConfig::get('rt_project_dir') . DS . 'data');
     rtAutoloader::addPath(rtConfig::get('rt_project_dir') . DS . 'lib');
     rtAutoloader::addPath(rtConfig::get('rt_models_dir'), rtConfig::get('rt_models_dir') . DS . 'generated', rtConfig::get('rt_app_controllers_dir'), rtConfig::get('rt_app_components_dir'));
     // setup app config
     require rtConfig::get('rt_app_config_dir') . DS . $app_name . 'AppConfig.class.php';
     $app_class_name = $app_name . 'AppConfig';
     $class = new $app_class_name();
     $class->setup();
     return $class;
 }
Exemplo n.º 3
0
 public static function registerViewClasses()
 {
     $classes = array();
     $views = rtConfig::get('views');
     foreach ($views as $view) {
         $classes[] = call_user_func(array($view, 'register'));
     }
     rtConfig::set('rt.view.classes', $classes);
 }
Exemplo n.º 4
0
function end_slot()
{
    $slot_name = rtConfig::get('rt.response.view.slots');
    if (!$slot_name) {
        throw new rtException("end_slot() should follow with a slot() function");
    }
    $response = rtResponse::getInstance();
    $content = ob_get_clean();
    $response->setSlot($slot_name, $content);
    // empty it
    rtConfig::set('rt.response.view.current_slot', NULL);
}
Exemplo n.º 5
0
<?php

# This should require rythm framework's autoload class to start the framework
# rythm autoload
require_once dirname(__FILE__) . '/../../rythm/lib/rtAutoloader.class.php';
rtAutoloader::register();
rtConfig::set('rt_project_dir', realpath(dirname(__FILE__) . DS . '..'));
class AppConfig extends rtAppConfig
{
    public function setup()
    {
        // Set your config here
        // rtConfig::set('your-key', $your_value);
    }
}