1. Go to this page and download the library: Download codeops/slim-phpconsole 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/ */
codeops / slim-phpconsole example snippets
$logwriter = new \Amenadiel\SlimPHPConsole\PHPConsoleWriter(true);
$app = new \Slim\Slim(array(
'log.enabled' => true,
'log.level' => \Slim\Log::DEBUG,
'log.writer' => $logwriter
));
$app->log->debug('Debug called!');
$app->log->info('This is just info');
$app->log->warning('Heads Up! This is a warning');
$app->log->getWriter()->debug('This has a custom tag', 'custom.tag');
$myHandler = \PhpConsole\Handler::getInstance();
if (!$myHandler->isStarted()) {
$myHandler->start(); // Only start it if it hasn't been started yet
}
$logwriter = new \Amenadiel\SlimPHPConsole\PHPConsoleWriter(false);
$handler = $logwriter->getHandler();
$handler->setHandleErrors(false); // disable errors handling, must be done before 'start' method
$handler->start();
$connector = $logwriter->getConnector();
$connector->setPassword('macoy123'); //sets a very insecure passwd
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.