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/blije-gasten.komma.pro/app/Komma/Kms/KmsServiceProvider.php
<?php namespace App\Komma\Kms;

//use App\Console\Commands\UpdateGlobalisationData;
use App\Komma\Globalization\UpdateServices\WebScraper;
use App\Komma\Globalization\UpdateServices\UpdateServiceInterface;
use App\Komma\Kms\ArtisanCommands\RunTests;
use App\Komma\Auth\AuthMailService;
use App\Komma\Auth\AuthMailServiceInterface;
use App\Komma\Documents\Kms\DocumentService;
use App\Komma\Documents\Kms\DocumentServiceInterface;
use App\Komma\Components\Attributables\AttributableService;
use App\Komma\Components\Attributables\AttributableServiceInterface;
use App\Komma\Components\Componentables\ComponentableService;
use App\Komma\Components\Componentables\ComponentableServiceInterface;
use App\Komma\Components\ComponentArea\ComponentAreaService;
use App\Komma\Components\ComponentArea\ComponentAreaServiceInterface;
use App\Komma\Kms\Core\AttributeDataService;
use App\Komma\Kms\Core\AttributeDataServiceInterface;
use App\Komma\Kms\Core\ModelService;
use App\Komma\Kms\Core\ModelServiceInterface;
use App\Komma\Kms\Core\RelatedModelService;
use App\Komma\Kms\Core\RelatedModelServiceInterface;
use App\Komma\Kms\Core\TranslationService;
use App\Komma\Kms\Core\TranslationServiceInterface;
use App\Komma\Kms\Core\Tree\TreeService;
use App\Komma\Kms\Core\Tree\TreeServiceInterface;
use App\Komma\Kms\ImageProcessing\CropperInterface;
use App\Komma\Kms\ImageProcessing\InterventionImageCropperBridge;
use App\Komma\Kms\Composers\FlashMessagesComposer;
use App\Komma\Kms\Composers\SidebarMenuComposer;
use App\Komma\Kms\Core\Attributes\Models\SelectOption;
use App\Komma\Kms\Core\Attributes\Models\SelectOptionInterface;
use App\Komma\Kms\QualityAssurance\ExtraDuskTools;
use App\Komma\Kms\Transfer\AbstractCsvExportService;
use App\Komma\Kms\Transfer\AbstractCsvImportService;
use App\Komma\Kms\Transfer\AbstractFolderImporterService;
use App\Komma\Routes\AbstractRouteService;
use App\Komma\Routes\RouteService;
use App\Komma\Shop\Products\Product\Transfer\ProductCsvExportService;
use App\Komma\Shop\Products\Product\Transfer\ProductCsvImportService;
use App\Komma\Shop\Products\Product\Transfer\ProductDocumentImporterService;
use App\Komma\Sites\Kms\SiteService;
use App\Komma\Sites\SiteServiceInterface;
use Illuminate\Support\ServiceProvider;

class KmsServiceProvider extends ServiceProvider
{
    use ExtraDuskTools;

    /**
     * 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->bootValidators();
        $this->registerCommands();
//        $this->setupExtraDuskTools();
    }

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

    public function registerHelpers()
    {
        $file = app_path('Helpers/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);

        //Core model handling services
        $this->app->bind(ModelServiceInterface::class, ModelService::class);
        $this->app->bind(TranslationServiceInterface::class, TranslationService::class);
        $this->app->bind(DocumentServiceInterface::class, DocumentService::class);
        $this->app->bind(RelatedModelServiceInterface::class, RelatedModelService::class);
        $this->app->bind(AttributeDataServiceInterface::class, AttributeDataService::class);
        $this->app->bind(ComponentAreaServiceInterface::class, ComponentAreaService::class);
        $this->app->singleton(SiteServiceInterface::class, SiteService::class);
        $this->app->bind(TreeServiceInterface::class, TreeService::class);
        $this->app->bind(AbstractRouteService::class, RouteService::class);

        //Transfer handling services
        $this->app->bind(AbstractCsvImportService::class, ProductCsvImportService::class);
        $this->app->bind(AbstractCsvExportService::class, ProductCsvExportService::class);
        $this->app->bind(AbstractFolderImporterService::class, ProductDocumentImporterService::class);

        //Core helper services
        $this->app->bind(AttributableServiceInterface::class, AttributableService::class);
//        $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.sidebar', SidebarMenuComposer::class);
        $this->app->view->composer('kms/partials.flashMessage', FlashMessagesComposer::class);

    }

    protected function bootValidators()
    {
        \Validator::extend('csv', 'App\Komma\Kms\Core\Validators\Validator@csv');
    }
}