Sh3ll
OdayForums


Server : Apache
System : Linux 145.162.205.92.host.secureserver.net 5.14.0-611.45.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 1 05:56:53 EDT 2026 x86_64
User : tradze ( 1001)
PHP Version : 8.1.34
Disable Function : NONE
Directory :  /home/tradze/public_html/test.tradze.com/vendor/caffeinated/modules/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/tradze/public_html/test.tradze.com/vendor/caffeinated/modules/src/ModulesServiceProvider.php
<?php

namespace Caffeinated\Modules;

use Caffeinated\Modules\Modules;
use Caffeinated\Modules\Contracts\Repository;
use Caffeinated\Modules\Providers\ConsoleServiceProvider;
use Caffeinated\Modules\Providers\GeneratorServiceProvider;
use Caffeinated\Modules\Providers\MigrationServiceProvider;
use Caffeinated\Modules\Providers\RepositoryServiceProvider;
use Illuminate\Support\ServiceProvider;

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

    /**
     * Boot the service provider.
     */
    public function boot()
    {
        $this->publishes([
            __DIR__.'/../config/modules.php' => config_path('modules.php'),
        ], 'config');

        $this->publishes([
            __DIR__.'/../resources/stubs/' => config('modules.custom_stubs'),
        ], 'stubs');

        $this->app['modules']->register();
    }

    /**
     * Register the service provider.
     */
    public function register()
    {
        $this->mergeConfigFrom(
            __DIR__.'/../config/modules.php', 'modules'
        );

        $this->app->register(ConsoleServiceProvider::class);
        $this->app->register(GeneratorServiceProvider::class);
        $this->app->register(MigrationServiceProvider::class);
        $this->app->register(RepositoryServiceProvider::class);

        $this->app->singleton('modules', function ($app) {
            $repository = $app->make(Repository::class);

            return new Modules($app, $repository);
        });
    }

    /**
     * Get the services provided by the provider.
     *
     * @return string
     */
    public function provides()
    {
        return ['modules'];
    }

    public static function compiles()
    {
        $repository = app()->make('modules');
        $modules    = $repository->all();
        $files      = [];

        foreach ($modules as $slug => $properties) {
            $namespace       = $repository->resolveNamespace($properties);
            $file            = $repository->getPath()."/{$namespace}/Providers/{$namespace}ServiceProvider.php";
            $serviceProvider = $repository->getNamespace().'\\'.$namespace."\\Providers\\{$namespace}ServiceProvider";

            if (class_exists($serviceProvider)) {
                $files = array_merge($files, forward_static_call([$serviceProvider, 'compiles']));
            }
        }

        return array_map('realpath', $files);
    }
}

ZeroDay Forums Mini