Exemplo n.º 1
0
 /**
  * Validate the environment
  *
  * @param Dotenv $environment Environment
  */
 protected static function validateEnvironment(Dotenv $environment)
 {
     parent::validateEnvironment($environment);
     // Validate the required environment variables
     $environment->required('APPARAT_BASE_URL')->notEmpty();
     $environment->required('OBJECT_RESOURCE_EXTENSION')->notEmpty();
     $environment->required('OBJECT_DATE_PRECISION')->isInteger()->allowedValues([0, 1, 2, 3, 4, 5, 6]);
     $environment->required('OBJECT_DEFAULT_PRIVACY')->notEmpty()->allowedValues(MetaProperties::$privacyLevels);
     $environment->required('OBJECT_DEFAULT_LANGUAGE')->notEmpty();
     $environment->required('OBJECT_ENABLE_TYPES')->notEmpty();
     // In-depth validation of the apparat base URL
     $apparatBaseUrl = getenv('APPARAT_BASE_URL');
     self::isAbsoluteBareUrl($apparatBaseUrl);
     // Normalize the apparat base URL
     putenv('APPARAT_BASE_URL=' . rtrim($apparatBaseUrl, '/') . '/');
     // Enable the configured object types
     array_map([Object::class, 'enableType'], explode(',', getenv('OBJECT_ENABLE_TYPES')));
 }
Exemplo n.º 2
0
 /**
  * Validate the environment
  *
  * @param Dotenv $environment Environment
  */
 protected static function validateEnvironment(Dotenv $environment)
 {
     parent::validateEnvironment($environment);
 }