1. Go to this page and download the library: Download jairocgr/datashot 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/ */
jairocgr / datashot example snippets
return [
'database_servers' => [
// A database server called 'live1'
'live1' => [
// Only mysql for now, maby postgres in the future
'driver' => 'mysql',
// The env function will read from the environment or .env file
'socket' => env('MYSQL56_SOCKET', ''),
'host' => env('MYSQL56_HOST', 'localhost'),
'port' => env('MYSQL56_PORT', 3306),
'user' => env('MYSQL56_USER', 'root'),
'password' => env('MYSQL56_PASSWORD', 'root'),
// If you mark it as a 'production' server, a confirmation question
// will be pronted in every execution and no drop action will
// be performed for safety reasons
'production' => TRUE
]
]
];
return [
'snappers' => [
'quick' => [
// If you want to snap the rows only
// 'data_only' => TRUE,
// If you wanna dump only the ddl, triggers, functions, etc.
// 'no_data' => TRUE,
// Custom made user-defined property for later interpolation
'cutoff' => '(NOW() - INTERVAL 3 MONTH)',
// Table-specific where used to filter the rows witch will be dumped
'wheres' => [
// Interpolate the 'cutoff' parameter in the where clause for the
// "logs" table
'logs' => "created_at > '{cutoff}'",
// Bring only the active users
'users' => 'active = TRUE',
],
]
]
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.