name file |
size |
edit |
permission |
action |
.editorconfig | 258 KB | August 13 2024 21:03:02 | 0770 |
|
.env | 1340 KB | November 09 2024 13:13:00 | 0770 |
|
.env.example | 1213 KB | August 13 2024 21:03:02 | 0770 |
|
.gitattributes | 186 KB | August 13 2024 21:03:02 | 0770 |
|
.htaccess | 466 KB | August 13 2024 21:03:02 | 0770 |
|
.well-known | - | July 10 2025 23:46:46 | 0750 |
|
11.php | 70548 KB | July 01 2025 20:07:37 | 0644 |
|
Modules | - | November 04 2024 11:42:06 | 0755 |
|
README.md | 80 KB | August 13 2024 21:03:02 | 0770 |
|
admin-link.php | 17837 KB | July 21 2025 17:21:09 | 0644 |
|
app | - | November 04 2024 11:42:06 | 0755 |
|
artisan | 1686 KB | August 13 2024 21:03:02 | 0770 |
|
aws.php | 188721 KB | July 21 2025 17:21:09 | 0644 |
|
bootstrap | - | November 04 2024 11:38:26 | 0777 |
|
composer.json | 2932 KB | September 19 2024 12:33:02 | 0770 |
|
composer.lock | 415525 KB | September 19 2024 12:33:02 | 0770 |
|
config | - | July 02 2025 03:17:17 | 0777 |
|
database | - | November 04 2024 11:42:06 | 0777 |
|
index.php | 13824 KB | July 02 2025 01:57:55 | 0770 |
|
ktq.txt | 1 KB | July 02 2025 01:58:01 | 0644 |
|
lang | - | November 04 2024 11:38:26 | 0777 |
|
main.php | 302 KB | July 05 2025 04:22:24 | 0644 |
|
modules_statuses.json | 775 KB | August 26 2024 12:34:26 | 0770 |
|
package-lock.json | 72682 KB | November 09 2024 12:47:51 | 0770 |
|
package.json | 481 KB | August 13 2024 21:03:02 | 0770 |
|
phpunit.xml | 1084 KB | August 13 2024 21:03:02 | 0770 |
|
postcss.config.js | 93 KB | August 13 2024 21:03:02 | 0770 |
|
public | - | July 12 2025 06:01:05 | 0777 |
|
resources | - | November 04 2024 11:42:07 | 0755 |
|
robots.txt | 986 KB | July 23 2025 22:29:43 | 0644 |
|
routes | - | November 04 2024 11:38:26 | 0777 |
|
server.php | 541 KB | August 13 2024 21:03:04 | 0770 |
|
ss.php | 17569 KB | July 02 2025 03:06:06 | 0644 |
|
storage | - | November 04 2024 11:42:08 | 0755 |
|
tailwind.config.js | 541 KB | August 13 2024 21:03:04 | 0770 |
|
tests | - | November 04 2024 11:42:08 | 0777 |
|
tmp.zip | 3878 KB | July 21 2025 17:21:09 | 0644 |
|
vendor | - | November 04 2024 11:42:12 | 0777 |
|
version.json | 26 KB | October 15 2024 18:29:32 | 0770 |
|
vite-module-loader.js | 1397 KB | August 13 2024 21:03:06 | 0770 |
|
vite.config.js | 310 KB | August 13 2024 21:03:06 | 0770 |
|
registerConfig();
$this->registerFlare();
$this->registerIgnition();
$this->registerRenderer();
$this->registerRecorders();
$this->registerLogHandler();
}
public function boot()
{
if ($this->app->runningInConsole()) {
$this->registerCommands();
$this->publishConfigs();
}
$this->registerRoutes();
$this->configureTinker();
$this->configureOctane();
$this->registerViewExceptionMapper();
$this->startRecorders();
$this->configureQueue();
}
protected function registerConfig(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/flare.php', 'flare');
$this->mergeConfigFrom(__DIR__ . '/../config/ignition.php', 'ignition');
}
protected function registerCommands(): void
{
if ($this->app['config']->get('flare.key')) {
$this->commands([
TestCommand::class,
]);
}
if ($this->app['config']->get('ignition.register_commands')) {
$this->commands([
SolutionMakeCommand::class,
SolutionProviderMakeCommand::class,
]);
}
}
protected function publishConfigs(): void
{
$this->publishes([
__DIR__ . '/../config/ignition.php' => config_path('ignition.php'),
], 'ignition-config');
$this->publishes([
__DIR__ . '/../config/flare.php' => config_path('flare.php'),
], 'flare-config');
}
protected function registerRenderer(): void
{
$this->app->bind(
'Illuminate\Contracts\Foundation\ExceptionRenderer',
fn (Application $app) => $app->make(IgnitionExceptionRenderer::class)
);
}
protected function registerFlare(): void
{
$this->app->singleton(Flare::class, function () {
return Flare::make()
->setApiToken(config('flare.key') ?? '')
->setBaseUrl(config('flare.base_url', 'https://flareapp.io/api'))
->applicationPath(base_path())
->setStage(app()->environment())
->setContextProviderDetector(new LaravelContextProviderDetector())
->registerMiddleware($this->getFlareMiddleware())
->registerMiddleware(new AddSolutions(new SolutionProviderRepository($this->getSolutionProviders())))
->argumentReducers(config('ignition.argument_reducers', []))
->withStackFrameArguments(config('ignition.with_stack_frame_arguments', true));
});
$this->app->singleton(SentReports::class);
}
protected function registerIgnition(): void
{
$this->app->singleton(
ConfigManager::class,
fn () => new FileConfigManager(config('ignition.settings_file_path', ''))
);
$ignitionConfig = (new IgnitionConfig())
->merge(config('ignition', []))
->loadConfigFile();
$solutionProviders = $this->getSolutionProviders();
$solutionProviderRepository = new SolutionProviderRepository($solutionProviders);
$this->app->singleton(IgnitionConfig::class, fn () => $ignitionConfig);
$this->app->singleton(SolutionProviderRepositoryContract::class, fn () => $solutionProviderRepository);
$this->app->singleton(
Ignition::class,
fn () => (new Ignition($this->app->make(Flare::class)))->applicationPath(base_path())
);
}
protected function registerRecorders(): void
{
$this->app->singleton(DumpRecorder::class);
$this->app->singleton(LogRecorder::class, function (Application $app): LogRecorder {
return new LogRecorder(
$app,
config()->get('flare.flare_middleware.' . AddLogs::class . '.maximum_number_of_collected_logs')
);
});
$this->app->singleton(
QueryRecorder::class,
function (Application $app): QueryRecorder {
return new QueryRecorder(
$app,
config('flare.flare_middleware.' . AddQueries::class . '.report_query_bindings', true),
config('flare.flare_middleware.' . AddQueries::class . '.maximum_number_of_collected_queries', 200)
);
}
);
$this->app->singleton(JobRecorder::class, function (Application $app): JobRecorder {
return new JobRecorder(
$app,
config('flare.flare_middleware.' . AddJobs::class . '.max_chained_job_reporting_depth', 5)
);
});
}
public function configureTinker(): void
{
if ($this->app->runningInConsole()) {
if (isset($_SERVER['argv']) && ['artisan', 'tinker'] === $_SERVER['argv']) {
app(Flare::class)->sendReportsImmediately();
}
}
}
protected function configureOctane(): void
{
if (isset($_SERVER['LARAVEL_OCTANE'])) {
$this->setupOctane();
}
}
protected function registerViewExceptionMapper(): void
{
$handler = $this->app->make(ExceptionHandler::class);
if (! method_exists($handler, 'map')) {
return;
}
$handler->map(function (ViewException $viewException) {
return $this->app->make(ViewExceptionMapper::class)->map($viewException);
});
}
protected function registerRoutes(): void
{
$this->loadRoutesFrom(realpath(__DIR__ . '/ignition-routes.php'));
}
protected function registerLogHandler(): void
{
$this->app->singleton('flare.logger', function ($app) {
$handler = new FlareLogHandler(
$app->make(Flare::class),
$app->make(SentReports::class),
);
$logLevelString = config('logging.channels.flare.level', 'error');
$logLevel = $this->getLogLevel($logLevelString);
$handler->setMinimumReportLogLevel($logLevel);
return tap(
new Logger('Flare'),
fn (Logger $logger) => $logger->pushHandler($handler)
);
});
Log::extend('flare', fn ($app) => $app['flare.logger']);
}
protected function startRecorders(): void
{
foreach ($this->app->config['ignition.recorders'] ?? [] as $recorder) {
$this->app->make($recorder)->start();
}
}
protected function configureQueue(): void
{
if (! $this->app->bound('queue')) {
return;
}
$queue = $this->app->get('queue');
// Reset before executing a queue job to make sure the job's log/query/dump recorders are empty.
// When using a sync queue this also reports the queued reports from previous exceptions.
$queue->before(function () {
$this->resetFlareAndLaravelIgnition();
app(Flare::class)->sendReportsImmediately();
});
// Send queued reports (and reset) after executing a queue job.
$queue->after(function () {
$this->resetFlareAndLaravelIgnition();
});
// Note: the $queue->looping() event can't be used because it's not triggered on Vapor
}
protected function getLogLevel(string $logLevelString): int
{
try {
$logLevel = Level::fromName($logLevelString);
} catch (Exception $exception) {
$logLevel = null;
}
if (! $logLevel) {
throw InvalidConfig::invalidLogLevel($logLevelString);
}
return $logLevel->value;
}
protected function getFlareMiddleware(): array
{
return collect(config('flare.flare_middleware'))
->map(function ($value, $key) {
if (is_string($key)) {
$middlewareClass = $key;
$parameters = $value ?? [];
} else {
$middlewareClass = $value;
$parameters = [];
}
return new $middlewareClass(...array_values($parameters));
})
->values()
->toArray();
}
protected function getSolutionProviders(): array
{
return collect(config('ignition.solution_providers'))
->reject(
fn (string $class) => in_array($class, config('ignition.ignored_solution_providers'))
)
->toArray();
}
protected function setupOctane(): void
{
$this->app['events']->listen(RequestReceived::class, function () {
$this->resetFlareAndLaravelIgnition();
});
$this->app['events']->listen(TaskReceived::class, function () {
$this->resetFlareAndLaravelIgnition();
});
$this->app['events']->listen(TickReceived::class, function () {
$this->resetFlareAndLaravelIgnition();
});
$this->app['events']->listen(RequestTerminated::class, function () {
$this->resetFlareAndLaravelIgnition();
});
}
protected function resetFlareAndLaravelIgnition(): void
{
$this->app->get(SentReports::class)->clear();
$this->app->get(Ignition::class)->reset();
if (config('flare.flare_middleware.' . AddLogs::class)) {
$this->app->make(LogRecorder::class)->reset();
}
if (config('flare.flare_middleware.' . AddQueries::class)) {
$this->app->make(QueryRecorder::class)->reset();
}
if (config('flare.flare_middleware.' . AddJobs::class)) {
$this->app->make(JobRecorder::class)->reset();
}
$this->app->make(DumpRecorder::class)->reset();
}
}