AppserverIo\Appserver\Meta\Composer\Script\Setup::getValue PHP Метод

getValue() публичный статический Метод

Returns the configuration value with the passed key.
public static getValue ( string $key ) : mixed | null
$key string The key to get value for
Результат mixed | null The configuration value
    public static function getValue($key)
    {
        if (array_key_exists($key, Setup::$mergedProperties)) {
            return Setup::$mergedProperties[$key];
        }
    }

Usage Example

Пример #1
0
 /**
  * Copies the passed OS specific resource file to the target directory.
  *
  * @param string  $os       The OS we want to copy the files for
  * @param string  $resource The resource file we want to copy
  * @param boolean $override TRUE if the file should be overwritten if exists, else FALSE
  * @param integer $mode     The mode of the target file
  *
  * @return void
  */
 public static function copyOsSpecificResource($os, $resource, $override = false, $mode = 0644)
 {
     // we need the installation directory
     $installDir = Setup::getValue(SetupKeys::INSTALL_DIR);
     // prepare source and target directory
     $source = Setup::prepareOsSpecificPath(sprintf('%s/resources/os-specific/%s/%s', $installDir, $os, $resource));
     $target = Setup::prepareOsSpecificPath(sprintf('%s/%s', $installDir, $resource));
     // query whether we've to override the file
     if ($override === false && is_file($target) === true) {
         return;
     }
     // prepare the target directory
     Setup::prepareDirectory($target);
     // copy the file to the target directory
     copy($source, $target);
     // set the correct mode for the file
     Setup::changeFilePermissions($target, $mode);
 }
All Usage Examples Of AppserverIo\Appserver\Meta\Composer\Script\Setup::getValue