mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00

- Extract environment properties in Environment class - Replaces initialisation closure by ApplicationLoader class - Removes undesirable error handling/PHP settings modifications
43 lines
665 B
PHP
43 lines
665 B
PHP
<?php
|
|
|
|
namespace Alchemy\Phrasea\Application;
|
|
|
|
use Alchemy\Phrasea\Application;
|
|
|
|
class Environment
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var bool
|
|
*/
|
|
private $debug = false;
|
|
|
|
public function __construct($name, $debug)
|
|
{
|
|
$this->name = (string) $name;
|
|
$this->debug = ((bool) $debug) || ! in_array($name, [
|
|
Application::ENV_PROD, Application::ENV_TEST
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @return bool
|
|
*/
|
|
public function isDebug()
|
|
{
|
|
return $this->debug;
|
|
}
|
|
}
|