Files
Phraseanet/lib/Alchemy/Phrasea/Application/Environment.php
Thibaud Fabre 450adb0847 Application bootstrap refactor
- Extract environment properties in Environment class
- Replaces initialisation closure by ApplicationLoader class
- Removes undesirable error handling/PHP settings modifications
2016-01-22 17:12:21 +01:00

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;
}
}