PHP code example of phramework / query-log

1. Go to this page and download the library: Download phramework/query-log 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/ */

    

phramework / query-log example snippets



use \Phramework\Phramework;
use \Phramework\QueryLog;

$settings = [
    'database' => [
          'adapter' => 'mysql',
          'host' => '',
          'username' => '',
          'password' => '',
          'name' => '',
          'port' => 3306
    ],
    'query-log' => [
        'database' => [
            'adapter' => '\\Phramework\\Database\\MySQL',
            'host' => '',
            'username' => '',
            'password' => '',
            'name' => '',
            'port' => 3306
        ]
    ]
];

$phramework = new Phramework(
    $settings,
    new \Phramework\URIStrategy\URITemplate([])
);

\Phramework\Database\Database::setAdapter(
    new \Phramework\Database\MySQL($settings['database'])
);

//Create QueryLog object
$queryLog = new QueryLog($settings['query-log']);

$queryLog->register(
    ['client' => 'my-additional-parameter']
);

$phramework->invoke();