Your IP : 216.73.216.229


Current Path : /home/jeromecohp/www/tmp/yooessentials/modules/core-joomla/
Upload File :
Current File : /home/jeromecohp/www/tmp/yooessentials/modules/core-joomla/bootstrap.php

<?php
/**
 * @package   Essentials YOOtheme Pro (Freemium) 1.6.8
 * @author    ZOOlanders https://www.zoolanders.com
 * @copyright Copyright (C) Joolanders, SL
 * @license   http://www.gnu.org/licenses/gpl.html GNU/GPL
 */

namespace ZOOlanders\YOOessentials;

use YOOtheme\Config as Yooconfig;

return [

    'config' => function (Yooconfig $yooconfig) {
        $host = explode(':', $yooconfig->get('joomla.config.host', '127.0.0.1'));

        return [
            'yooessentials' => [
                'timezone' => new \DateTimeZone($yooconfig->get('joomla.config.offset')),
                'db' => [
                    'database' => $yooconfig->get('joomla.config.db'),
                    'prefix' => $yooconfig->get('joomla.config.dbprefix'),
                    'host' => array_shift($host),
                    'port' => array_shift($host) ?: 3306
                ]
            ]
        ];
    },

    'events' => [

        'url.resolve' => [
            Joomla\Platform::class => 'handleRoute',
        ],

        'app.request' => [
            Joomla\CsrfTokenMiddleware::class => ['@handle', 20],
        ],

        'source.init' => [
            Joomla\SourceListener::class => ['extendCoreTypes', -100],
        ],

        'yooessentials.config.load' => [
            Joomla\ConfigListener::class => ['loadConfig', 90]
        ],

        'yooessentials.config.save' => [
            Joomla\ConfigListener::class => ['saveConfig', -90]
        ],

    ],

    'extend' => [

        Form\Http\FormSubmissionRequest::class => function (Form\Http\FormSubmissionRequest $submission) {
            $submission->csrfFormToken = Joomla\Platform::printCsrfFormToken();
        },

    ],

    'services' => [

        Session::class => Joomla\Session::class,
        Unzipper::class => Joomla\Unzipper::class,
        DatabaseManager::class => Joomla\DatabaseManager::class,
        Mailer::class => [
            'class' => Joomla\Mailer::class,
            'shared' => false,
        ],
        DatabaseQuery::class => [
            'shared' => false,
            'class' => Joomla\DatabaseQuery::class,
        ],

    ],

];