Example #1
0
<?php

/*
 * call: http://site.ru/shell.php?action=TestService/Once/TestController:start
 *
 * */
const FILE_ERROR_LOG = '../log/errors.log';
const FILE_FATAL_ERROR_LOG = '../log/fatal_errors.log';
ini_set("display_errors", "on");
error_reporting(E_ALL);
ini_set('html_errors', 'on');
require_once dirname(__FILE__) . '/../Core/Autoload.php';
\Core\Autoloader::register();
$action = substr($_GET['action'], strpos($_GET['action'], ':') + 1);
$_GET['action'] = str_replace(':' . $action, '', $_GET['action']);
$t = explode('/', $_GET['action']);
$service = array_shift($t);
$controller = 'Controller_Shell_' . implode('_', $t);
$cms = new \Core\Init();
$cms->runShell($service, $controller, $action);
Example #2
0
<?php

require_once dirname(__FILE__) . '/../Core/Autoload.php';
\Core\Autoloader::register();
/** @var \Composer\Autoload\ClassLoader $loader */
$loader = (require_once '../vendor/autoload.php');
$loader->register();
/** @var \Core\Config $config */
$config = (require_once '../config.php');
/** @var Service_Factory $service_factory */
$service_factory = (require_once '../Service/Factory.php');
$cms = new \Core\Init($config, $service_factory);
$cms->run();