/**
 * Disable cache global
 */
$SmartConfig['disable_cache'] = 0;
/**
 * Error flags
 */
define('SMART_DIE', 999);
define('SMART_NO_MODULE', 1000);
define('SMART_NO_ACTION', 1001);
define('SMART_NO_TEMPLATE', 1003);
define('SMART_NO_VIEW', 1004);
// smart object class
include_once SMART_BASE_DIR . 'smart/includes/SmartObject.php';
// smart exceptions
include_once SMART_BASE_DIR . 'smart/includes/SmartException.php';
// include smartErrorHandler
include_once SMART_BASE_DIR . 'smart/includes/SmartErrorHandler.php';
// The base container object
include_once SMART_BASE_DIR . 'smart/includes/SmartContainer.php';
// action class
include_once SMART_BASE_DIR . 'smart/includes/SmartAction.php';
// model class
include_once SMART_BASE_DIR . 'smart/includes/SmartModel.php';
// controller class
include_once SMART_BASE_DIR . 'smart/includes/SmartController.php';
// cache class
include_once SMART_BASE_DIR . 'smart/includes/SmartCache.php';
// pass the config array to the controller
SmartController::setConfig($SmartConfig);
 /**
  * Retrieve a new Controller instance.
  *
  * @param string $class Controller class name.
  * @param array $config Main Smart config array
  */
 public static function newInstance($class)
 {
     try {
         if (!isset(self::$instance)) {
             $class_file = SMART_BASE_DIR . 'smart/includes/' . $class . '.php';
             if (!@file_exists($class_file)) {
                 throw new SmartInitException($class_file . ' dosent exists');
             }
             include_once $class_file;
             $object = new $class();
             if (!$object instanceof SmartController) {
                 throw new SmartInitException($class . ' dosent extends SmartController');
             }
             // set singleton instance
             self::$instance = $object;
             return $object;
         } else {
             $type = get_class(self::$instance);
             throw new SmartInitException('Controller instance exists: ' . $type);
         }
     } catch (SmartInitException $e) {
         $e->performStackTrace();
     }
 }
Example #3
0
{
   define('SMART_VIEW_FOLDER', 'views_default/'); 
}
*/
/*
 * Force to use the template folder, independed of the sys config settings.
 */
/*
if(!defined( 'SMART_TPL_FOLDER' ))
{
   define('SMART_TPL_FOLDER', 'templates_default/'); 
}
*/
/* #################################################### */
/* ######### Dont change any thing below !!! ########## */
/* #################################################### */
/* 
 * Secure include of files from this script
 */
if (!defined('SMART_SECURE_INCLUDE')) {
    define('SMART_SECURE_INCLUDE', 1);
}
// Define the absolute path to SMART3
//
define('SMART_BASE_DIR', dirname(__FILE__) . '/');
// Include the system core file. use this for debuging
include SMART_BASE_DIR . 'smart/includes/smart_core.php';
// Include the system core file. use this for production in order to the previous include
// include( SMART_BASE_DIR . 'smart/includes/smart_all_in_one.php' );
$smartController = SmartController::newInstance('SmartWebController');
$smartController->dispatch();
/*
 * Relative path to SMART. Example: 'test/'
 */
if (!defined('SMART_RELATIVE_PATH')) {
    define('SMART_RELATIVE_PATH', './');
}
/*
 * Force to use the views folder, independed of the sys config settings.
 */
/*
if(!defined( 'SMART_VIEW_FOLDER' ))
{
   define('SMART_VIEW_FOLDER', 'views_smart/'); 
}
*/
/* #################################################### */
/* ######### Dont change any thing below !!! ########## */
/* #################################################### */
/* 
 * Secure include of files from this script
 */
if (!defined('SMART_SECURE_INCLUDE')) {
    define('SMART_SECURE_INCLUDE', 1);
}
// Define the absolute path to SMART
//
define('SMART_BASE_DIR', dirname(__FILE__) . '/');
// Include the system core file.
include SMART_BASE_DIR . 'smart/includes/smart_core.php';
$smartController = SmartController::newInstance('SmartAjaxController');
$smartController->dispatch();
Example #5
0
if (!defined('SMART_CONTROLLER')) {
    define('SMART_CONTROLLER', 'rpcserver.php');
}
/*
 * Relative path to SMART. Example: 'test/'
 */
if (!defined('SMART_RELATIVE_PATH')) {
    define('SMART_RELATIVE_PATH', './');
}
/*
 * Force to use the views folder, independed of the sys config settings.
 */
if (!defined('SMART_VIEW_FOLDER')) {
    define('SMART_VIEW_FOLDER', 'views_rpcserver/');
}
/* #################################################### */
/* ######### Dont change any thing below !!! ########## */
/* #################################################### */
/* 
 * Secure include of files from this script
 */
if (!defined('SMART_SECURE_INCLUDE')) {
    define('SMART_SECURE_INCLUDE', 1);
}
// Define the absolute path to SMART
//
define('SMART_BASE_DIR', dirname(__FILE__) . '/');
// Include the system core file.
include SMART_BASE_DIR . 'smart/includes/smart_core.php';
$smartController = SmartController::newInstance('SmartXmlRpcController');
$smartController->dispatch();