1. Go to this page and download the library: Download inanepain/inane 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/ */
inanepain / inane example snippets
'factories' => [
'LogService' => function ($sm) {
$logger = new Logger();
$priority = new Priority(getenv('LOG_LEVEL') ?: $logger::WARN);
$fileWriterGeneral = new Stream('log/general.log');
$dbWriter = new Db(GlobalAdapterFeature::getStaticAdapter(), 'logs');
$dbWriter->setFormatter(new \Laminas\Log\Formatter\Db('Y-m-d H:i:s'));
$fileWriterGeneral->addFilter($priority);
$dbWriter->addFilter($priority);
$logger->addWriter($fileWriterGeneral);
$logger->addWriter($dbWriter);
return $logger;
},
]
// some central place: config.php
define('DUMPER_SILENCE_CLASS', false);
define('DUMPER_SILENCE_METHOD', true);
// IndexDemo.php
#[Silence(DUMPER_SILENCE_CLASS)]
class IndexDemo {
protected function logSilence(): void {
dd(DUMPER_SILENCE_CLASS, 'This WILL show since DUMPER_SILENCE_CLASS == false');
}
#[Silence(DUMPER_SILENCE_METHOD)]
public function indexAction() {
$this->logSilence();
dd(DUMPER_SILENCE_METHOD, 'This will NOT show since DUMPER_SILENCE_METHOD == true');
}
}
shell
php composer.phar
shell
php composer.phar update
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.