HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/gggg.komma.nl/vendor/komma/kms/src/Providers/KmsServiceProvider.php
<?php namespace Komma\KMS\Providers;

use Komma\KMS\Components\Attributables\AttributableService;
use Komma\KMS\Components\Attributables\AttributableServiceInterface;
use Komma\KMS\Components\ComponentArea\ComponentAreaService;
use Komma\KMS\Components\ComponentArea\ComponentAreaServiceInterface;
use Komma\KMS\Console\Commands\CoreSeed;
use Komma\KMS\Globalization\UpdateServices\WebScraper;
use Komma\KMS\Globalization\UpdateServices\UpdateServiceInterface;
use Komma\KMS\Auth\AuthMailService;
use Komma\KMS\Auth\AuthMailServiceInterface;
use Komma\KMS\ArtisanCommands\UpdateGlobalisationData;
use Komma\KMS\Core\AttributeDataService;
use Komma\KMS\Core\AttributeDataServiceInterface;
use Komma\KMS\Core\ModelService;
use Komma\KMS\Core\ModelServiceInterface;
use Komma\KMS\Core\RelatedModelService;
use Komma\KMS\Core\RelatedModelServiceInterface;
use Komma\KMS\Core\TranslationService;
use Komma\KMS\Core\TranslationServiceInterface;
use Komma\KMS\Core\Tree\TreeService;
use Komma\KMS\Core\Tree\TreeServiceInterface;
use Komma\KMS\ImageProcessing\CropperInterface;
use Komma\KMS\ImageProcessing\InterventionImageCropperBridge;
use Komma\KMS\Composers\FlashMessagesComposer;
use Komma\KMS\Core\Attributes\Models\SelectOption;
use Komma\KMS\Core\Attributes\Models\SelectOptionInterface;
use Komma\KMS\Transfer\AbstractCsvExportService;
use Komma\KMS\Transfer\AbstractCsvImportService;
use Komma\KMS\Transfer\AbstractFolderImporterService;
use Illuminate\Support\ServiceProvider;
use Komma\KMS\Sites\Kms\SiteService;
use Komma\KMS\Sites\Models\Site;
use Komma\KMS\Sites\Models\SiteInterface;
use Komma\KMS\Sites\SiteServiceInterface;

class KmsServiceProvider extends ServiceProvider
{
    /**
     * Indicates if loading of the provider is deferred.
     *
     * @var bool
     */
    protected $defer = false;

    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        $this->bootViewComposers();
        $this->registerCommands();
        $this->loadFactoriesFrom(__DIR__.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'database'.DIRECTORY_SEPARATOR.'factories');
    }

    /**
     * Register artisan shop commands
     */
    public function registerCommands()
    {
        $this->commands([
            //Test / benchmark commands
            UpdateGlobalisationData::class,
            CoreSeed::class
        ]);
    }

    public function registerHelpers()
    {
        $file = __DIR__ . DIRECTORY_SEPARATOR .DIRECTORY_SEPARATOR.'Helpers'.DIRECTORY_SEPARATOR.'GlobalHelpers.php';
        if (file_exists($file)) require_once($file);
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->registerHelpers();
        $this->app->bind(CropperInterface::class, InterventionImageCropperBridge::class);
        $this->app->singleton(SiteServiceInterface::class, SiteService::class);

        //Core model handling services
        $this->app->bind(ModelServiceInterface::class, ModelService::class);
        $this->app->bind(TranslationServiceInterface::class, TranslationService::class);
        $this->app->bind(RelatedModelServiceInterface::class, RelatedModelService::class);
        $this->app->bind(AttributeDataServiceInterface::class, AttributeDataService::class);
        $this->app->bind(ComponentAreaServiceInterface::class, ComponentAreaService::class);
        $this->app->bind(AttributableServiceInterface::class, AttributableService::class);
        $this->app->bind(TreeServiceInterface::class, TreeService::class);

        //Extensible model interface bindings.
        $this->app->bind(SiteInterface::class, Site::class);

        //Transfer handling services
        //Examples on how to implement specific transfer handling services.
        $this->app->bind(AbstractCsvImportService::class, function() {
            throw new \Exception('Please build an implementation of '.AbstractCsvImportService::class.' and bind it in KmsServiceProvider to enable import functionality');
        });
        $this->app->bind(AbstractCsvExportService::class, function() {
            throw new \Exception('Please build an implementation of '.AbstractCsvExportService::class.' and bind it in KmsServiceProvider to enable export functionality');
        });
        $this->app->bind(AbstractFolderImporterService::class, function() {
            throw new \Exception('Please build an implementation of '.AbstractFolderImporterService::class.' and bind it in KmsServiceProvider to enable document import functionality');
        });

        //Core helper services
//        $this->app->bind(ComponentableServiceInterface::class, ComponentableService::class); //TODO. I think this implementation became obsolete
        $this->app->bind(AuthMailServiceInterface::class, AuthMailService::class);

        $this->app->bind(SelectOptionInterface::class, SelectOption::class);
        //Bind ther service that should be used for updating globalisation (g11n) data
        $this->app->bind(UpdateServiceInterface::class, WebScraper::class);
    }

    protected function bootViewComposers()
    {
        $this->app->view->composer('KMS::partials.flashMessage', FlashMessagesComposer::class);

    }
}