Exemplo n.º 1
0
 /**
  * Constructor
  *
  * @param Configurator $configurator
  */
 public function __construct(Configurator $configurator)
 {
     $parameters = $configurator->getParameters();
     foreach ($parameters as $key => $value) {
         if (0 === strpos($key, 'db_')) {
             $parameters[substr($key, 3)] = $value;
             $key = substr($key, 3);
             $this->{$key} = $value;
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Checks if the application has been installed and redirects if so
  *
  * @return bool
  */
 private function checkIfInstalled()
 {
     // If the config file doesn't even exist, no point in checking further
     $localConfigFile = $this->get('mautic.helper.paths')->getSystemPath('local_config');
     if (!file_exists($localConfigFile)) {
         return false;
     }
     /** @var \Mautic\CoreBundle\Configurator\Configurator $configurator */
     $params = $this->configurator->getParameters();
     // if db_driver and mailer_from_name are present then it is assumed all the steps of the installation have been
     // performed; manually deleting these values or deleting the config file will be required to re-enter
     // installation.
     if (empty($params['db_driver']) || empty($params['mailer_from_name'])) {
         return false;
     }
     return true;
 }