1. Go to this page and download the library: Download oihana/php-system 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/ */
oihana / php-system example snippets
use function oihana\init\{ initDefaultTimezone, initMemoryLimit, initErrors, initConfig, initDefinitions, initContainer };
use oihana\logging\Logger;
// Bootstrap
initDefaultTimezone('UTC');
initMemoryLimit('256M');
initErrors([
'display_errors' => '1',
'error_log' => 'var/logs/php_errors.log',
], __DIR__);
// Load config and build the DI container
$config = initConfig(__DIR__ . '/config', 'app.toml');
$definitions = initDefinitions(__DIR__ . '/definitions');
$container = initContainer($definitions, ['config' => $config]);
// Logger
$logger = new Logger(__DIR__ . '/var/logs', Logger::DEBUG);
$logger->info('Application started');