PHP code example of labrador-kennel / framework
1. Go to this page and download the library: Download labrador-kennel/framework 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/ */
labrador-kennel / framework example snippets
declare(strict_types=1);
namespace App;
use Amp\Log\StreamHandler;
use Cspray\AnnotatedContainer\Attribute\Service;
use Labrador\Logging\LoggerFactory;
use Monolog\Logger;
use Monolog\Processor\PsrLogMessageProcessor;
use Psr\Log\LoggerInterface;
use function Amp\ByteStream\getStdout;
#[Service]
final class MyLoggerFactory implements LoggerFactory {
public function createLogger() : LoggerInterface{
return new Logger(
'my-logger-name',
[new StreamHandler(getStdout())],
[new PsrLogMessageProcessor()]
);
}
}