Пример #1
0
 /**
  * Creates a new install target.
  *
  * @param string $name            The name of the target.
  * @param string $installerName   The name of the used installer.
  * @param string $location        The location where resources are installed.
  * @param string $urlFormat       The format of the generated resource URLs. Include the placeholder "%s" for the resource path relative to the target location.
  * @param array  $parameterValues Values for the parameters defined by the installer descriptor.
  */
 public function __construct($name, $installerName, $location, $urlFormat = self::DEFAULT_URL_FORMAT, array $parameterValues = array())
 {
     Assert::stringNotEmpty($name, 'The target name must be a non-empty string. Got: %s');
     Assert::stringNotEmpty($installerName, 'The installer name must be a non-empty string. Got: %s');
     Assert::notEq($name, self::DEFAULT_TARGET, 'The target name must not be "' . self::DEFAULT_TARGET . '".');
     Assert::stringNotEmpty($location, 'The target location must be a non-empty string. Got: %s');
     Assert::stringNotEmpty($urlFormat, 'The target URL format must be a non-empty string. Got: %s');
     $this->name = $name;
     $this->installerName = $installerName;
     $this->location = $location;
     $this->urlFormat = $urlFormat;
     $this->parameterValues = $parameterValues;
 }