Exemplo n.º 1
0
 function __construct($request, $controller, $action)
 {
     $this->_setRequest($request);
     $this->_setController($controller);
     $this->_setAction($action);
     $this->_setParams($request->params);
     $this->_set_REQUEST($request->_REQUEST);
     $this->_set_POST($request->_POST);
     $this->_set_GET($request->_GET);
     $this->Model = new Model(SimPHPfy::getDatasource(), $this->getController());
     $this->View = new View($this);
     register_shutdown_function('_shutdown', $this);
 }
Exemplo n.º 2
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('Controller'), SIMPHPFY_CONTROLLER);
Exemplo n.º 3
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('View', 'Template', 'Mimetype'), SIMPHPFY_VIEW);
Exemplo n.º 4
0
// Setup the SimPHPfy Core package
SimPHPfy::package(SIMPHPFY_MODEL);
SimPHPfy::package(SIMPHPFY_VIEW);
SimPHPfy::package(SIMPHPFY_CONTROLLER);
SimPHPfy::package(SIMPHPFY_LIBRARY);
SimPHPfy::package(SIMPHPFY_UTILITY);
// Setup the ROUTER package
SimPHPfy::package(ROUTER);
// Setup the app Core package
SimPHPfy::package(MODEL);
SimPHPfy::package(VIEW);
SimPHPfy::package(CONTROLLER);
// Include the database configuration
require CONFIG . 'datasource.php';
$datasourceConfig = new DataSourceConfig();
SimPHPfy::setDatasource(new DataSource($datasourceConfig->config));
// Include the routes.php from the configuration
require CONFIG . 'routes.php';
/*
 * shutdown function
 * 
 * The shutdown function accepts a controller object and is responsible to 
 * render a View if there is no specified render call in the 
 * :Controller->:Action()
 * 
 * @params View $controllerObj
 * 
 * @return void
 */
function _shutdown($controllerObj)
{
Exemplo n.º 5
0
 public static function setDatasource($datasource)
 {
     self::$_datasource = $datasource;
 }
Exemplo n.º 6
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('JSMin'), SIMPHPFY_LIBRARY);
Exemplo n.º 7
0
<?php

/* 
 * Created by Hei
 */
/*
 * namespace file for all the Exceptions
 */
SimPHPfy::definePackage(array('SimPHPfyBaseException', 'HttpException', 'FileNotFoundException', 'SimPHPfyException', 'ClassCollisionException', 'MissingClassFileException', 'UnknownClassException', 'InvalidPackagePathException', 'ArgumentTypeMismatchException', 'InvalidRouteException', 'InvalidControllerException', 'MissingControllerException', 'InvalidTemplateException', 'MissingTemplateException', 'InvalidViewException', 'InvalidDataSourceException', 'DataSourceConnectionException', 'DatabaseConnectionException', 'InvalidModelException', 'MissingModelException', 'DatabaseORMException', 'DatabaseDataRowException', 'InvalidModelDataRowException'), EXCEPTION);
Exemplo n.º 8
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('FileUtility'), SIMPHPFY_UTILITY);
Exemplo n.º 9
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('Router', 'Route', 'Request'), ROUTER);
Exemplo n.º 10
0
<?php

/* 
 * Created by Hei
 */
SimPHPfy::definePackage(array('DataSource', 'Model', 'DatabaseORM', 'ModelDataRow', 'Validator'), SIMPHPFY_MODEL);