1. Go to this page and download the library: Download perfbase/cakephp 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/ */
perfbase / cakephp example snippets
use Cake\Http\BaseApplication;
use Perfbase\CakePHP\PerfbasePlugin;
class Application extends BaseApplication
{
public function bootstrap(): void
{
parent::bootstrap();
$this->addPlugin(PerfbasePlugin::class);
}
}
namespace App\Command;
use Cake\Console\Arguments;
use Cake\Console\ConsoleIo;
use Perfbase\CakePHP\Command\ProfiledCommand;
class ExampleCommand extends ProfiledCommand
{
public function execute(Arguments $args, ConsoleIo $io)
{
$io->out('Perfbase command profiling is active.');
return static::CODE_SUCCESS;
}
}