PHP code example of zenoware / laravel-sql-dump-validator
1. Go to this page and download the library: Download zenoware/laravel-sql-dump-validator 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/ */
zenoware / laravel-sql-dump-validator example snippets
$validatorService->validateSqlDumps($path, $depth, function (SqlDumpFileMetadata $metadata, array $errors) {
// Handle the validation results
});
class SqlDumpEventSubscriber
{
public function subscribe($events)
{
$events->listen(
SqlDumpFileOk::class,
function ($event) {
Log::info('SqlDumpFileOk event fired', ['metadata' => $event->metadata]);
}
);
$events->listen(
SqlDumpFileCorrupted::class,
function ($event) {
Log::info('SqlDumpFileCorrupted event fired', ['metadata' => $event->metadata, 'errors' => $event->errors]);
}
);
}
}