Пример #1
0
 /**
  * Appelle l'autoloader
  */
 public static function load()
 {
     session_start();
     require ROOT . '/app/Autoloader.php';
     Autoloader::register();
     require ROOT . '/core/Autoloader.php';
     \Core\Autoloader::register();
 }
Пример #2
0
use Core\Autoloader;
date_default_timezone_set('Europe/Paris');
define('DS', DIRECTORY_SEPARATOR);
define('WS', '/');
define('ROOT', __DIR__ . DS);
define('ROOT_TMP', ROOT . 'tmp' . DS);
define('ROOT_VUE', ROOT . 'app' . DS . 'vue' . DS);
$directory = basename(ROOT);
$tabUrl = explode($directory, filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL));
if (count($tabUrl) > 1) {
    define('WEBROOT', $tabUrl[0] . $directory . WS);
} else {
    define('WEBROOT', WS);
}
require ROOT . 'core' . DS . 'autoloader.class.php';
$autoloader = new Autoloader();
$autoloader->activeCache(true)->addExtension('.php')->addExtension('.class.php')->addFolder(ROOT, true)->addFolder(ROOT . 'lib', true)->register();
function array_union(&$array1, $array2)
{
    foreach ($array2 as $value) {
        array_push($array1, $value);
    }
}
function scanFolder($folder)
{
    $lstFileTest = [];
    $lstFSO = scandir($folder);
    $bad = ['.', '..'];
    foreach ($lstFSO as $fso) {
        if (!in_array($fso, $bad)) {
            $fsoFull = $folder . DS . $fso;
Пример #3
0
<?php

$page_root = "admin.php";
require "vendor/autoload.php";
use core\Autoloader;
use core\auth\Connexion;
use core\admin\Admin;
use core\HTML\flashmessage\FlashMessage;
use core\admin\droitsacces\DroitAcces;
require "core/Autoloader.class.php";
Autoloader::register();
require "config/initialise.php";
$login = new Connexion();
if (isset($_SESSION["idlogin" . CLEF_SITE])) {
    $droit_acces = new DroitAcces();
}
$config = new \core\Configuration();
if ($config->getAccesAdmin() != 1) {
    FlashMessage::setFlash("Il n'y a pas d'interface d'administration sur ce site !");
    header("location:" . WEBROOT);
}
require ROOT . "core/save/save.php";
//--------------------------------------------- GENERATION META TITLE ++ DESCRIPTION -------------------------------------------------------//
if (isset($_GET['page'])) {
    $titre_page = "Administration du site";
    $description_page = "Administration du site";
} else {
    $titre_page = "Administration du site";
    $description_page = "Administration du site";
}
//--------------------------------------------- FIN GENERATION META TITLE ++ DESCRIPTION -------------------------------------------------------//
Пример #4
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);