PHP code example of rnr1721 / le7-core

1. Go to this page and download the library: Download rnr1721/le7-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rnr1721 / le7-core example snippets




define('PUBLIC_PATH', realpath(dirname(__FILE__)));


declare(strict_types=1);

use Nyholm\Psr7Server\ServerRequestCreator;
use Core\Topology;
use Core\InitHttp;
use Core\InitCli;
use App\Classes\Factories\ContainerFactoryPhpDi;

if (!defined('PUBLIC_PATH')) {
    // Prevent to launch not from public folder
    echo 'Please run program from webroot folder' . PHP_EOL;
    exit;
}

// Set microtime for measuring page generation time
$start = microtime(true);

define('BASE_PATH', realpath(dirname(__FILE__)));

define('DS', DIRECTORY_SEPARATOR);

$diCompiledPath = BASE_PATH . DS . 'var' . DS . 'containers';
$diConfig = BASE_PATH . DS . 'config' . DS . 'di';

$loader = nse = $init->run($request);
}