<commit_before><?php

use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Event;
use Orchestra\Support\Messages;
use Orchestra\Foundation\Services\UserMetaRepository;

App::make('orchestra.memory')->extend('user', function ($app, $name)
{
	return new UserMetaRepository($app, $name);
});

/*
|--------------------------------------------------------------------------
| Bind Installation Interface
|--------------------------------------------------------------------------
|
| These interface allow Orchestra Platform installation process to be 
| customized by the application when there a requirement for it.
|
*/

App::bind('Orchestra\Foundation\Installation\InstallerInterface', function ()
{
	return new Orchestra\Foundation\Installation\Installer(App::make('app'));
});

App::bind('Orchestra\Foundation\Installation\RequirementInterface', function ()
{
	return new Orchestra\Foundation\Installation\Requirement(App::make('app'));
});

/*
|--------------------------------------------------------------------------
| Inject Safe Mode Notification
|--------------------------------------------------------------------------
|
| This event listener would allow Orchestra Platform to display notification 
| if the application is running on safe mode.
|
*/

Event::listen('composing: *', function ()
{
	if ('on' === App::make('session')->get('orchestra.safemode'))
	{
		$messages = App::make('orchestra.messages')->retrieve();

		($messages instanceof Messages) or $messages = new Messages;

		$messages->add('info', trans('orchestra/foundation::response.safe-mode'));
		$messages->save();
	}
});<commit_msg>Improve safe mode notification using the new Orchestra\Messages::extend() API<commit_after><?php

use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Event;
use Orchestra\Support\Messages;
use Orchestra\Foundation\Services\UserMetaRepository;

App::make('orchestra.memory')->extend('user', function ($app, $name)
{
	return new UserMetaRepository($app, $name);
});

/*
|--------------------------------------------------------------------------
| Bind Installation Interface
|--------------------------------------------------------------------------
|
| These interface allow Orchestra Platform installation process to be 
| customized by the application when there a requirement for it.
|
*/

App::bind('Orchestra\Foundation\Installation\InstallerInterface', function ()
{
	return new Orchestra\Foundation\Installation\Installer(App::make('app'));
});

App::bind('Orchestra\Foundation\Installation\RequirementInterface', function ()
{
	return new Orchestra\Foundation\Installation\Requirement(App::make('app'));
});

/*
|--------------------------------------------------------------------------
| Inject Safe Mode Notification
|--------------------------------------------------------------------------
|
| This event listener would allow Orchestra Platform to display notification 
| if the application is running on safe mode.
|
*/

Event::listen('composing: *', function ()
{
	if ('on' === App::make('session')->get('orchestra.safemode'))
	{
		App::make('orchestra.messages')->extend(function ($messages)
		{
			$messages->add('info', trans('orchestra/foundation::response.safe-mode'));
		});
	}
});
{'fraction_non_alphanumeric': 0.3081664098613251, 'fraction_numerical': 0.0, 'mean_word_length': 2.360248447204969, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1508906', 'n_tokens_mistral': 778, 'n_tokens_neox': 773, 'n_words': 176}