1. Go to this page and download the library: Download vitexsoftware/ease-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/ */
vitexsoftware / ease-core example snippets
inimal config
define('EASE_APPNAME', 'MyApp');
// Send logs to console and syslog (combine with "|")
define('EASE_LOGGER', 'console|syslog');
$logger = new \Ease\Sand();
$logger->addStatusMessage('MyApp started', 'info');
// i18n (optional): bind domain in ./i18n or /usr/share/locale
new \Ease\Locale('en_US', './i18n', 'php-vitexsoftware-ease-core');
$logger->addStatusMessage(_('Ready to work'), 'success');
// Mail (optional): configure sender via constants or ENV
// define('EASE_FROM', '[email protected]');
// define('EASE_SMTP', json_encode([
// 'host' => 'smtp.example.com', 'auth' => true, 'username' => '...','password' => '...'
// ]));
// $mailer = new \Ease\Mailer('[email protected]', 'Hello', 'Message body');
// $mailer->send();
// Load .env and define UPPERCASE constants from it:
\Ease\Shared::singleton()->loadConfig(__DIR__.'/.env', true);
// Or load JSON without defining constants (values accessible via Shared::cfg()):
\Ease\Shared::singleton()->loadConfig(__DIR__.'/config.json', false);
define('EASE_LOGGER', 'console|syslog');
$logger = new \Ease\Sand();
$logger->addStatusMessage('Error Message', 'error');