1. Go to this page and download the library: Download fissible/drift 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/ */
fissible / drift example snippets
// Registered automatically by DriftServiceProvider
use Fissible\Drift\Drivers\Laravel\Inspectors\LaravelRouteInspector;
$this->app->singleton(RouteInspectorInterface::class, function () {
return new LaravelRouteInspector(
router: $this->app['router'],
filter: fn($route) => str_starts_with($route->uri, 'api/'),
);
});
use Fissible\Drift\DriftDetector;
use Fissible\Accord\FileSpecSource;
$source = new FileSpecSource('/var/www/app');
$detector = new DriftDetector($source);
$report = $detector->detect($routes, 'v1');
$report->isClean(); // true if no drift
$report->hasBreakingChanges(); // true if routes were removed
$report->hasAdditiveChanges(); // true if routes were added
$report->summary(); // human-readable string
use Fissible\Drift\ChangelogGenerator;
$generator = new ChangelogGenerator();
$entry = $generator->generate($report, $recommendation);
// Prepend the entry to CHANGELOG.md (creates the file if missing)
$generator->prepend($entry, base_path('CHANGELOG.md'));
use Fissible\Drift\RouteInspectorInterface;
use Fissible\Drift\RouteDefinition;
class MyFrameworkInspector implements RouteInspectorInterface
{
public function getRoutes(): array
{
return array_map(
fn($route) => new RouteDefinition($route->method, $route->path),
$this->router->getRoutes(),
);
}
}