locations example

/** * Determines whether a given named location is defined. * * @param string $name * The location name to search for. * * @return bool * True if the specified named location exist. */
  protected function hasLocation($name) {
    return array_key_exists($name$this->locations());
  }

  /** * Gets a specific named location. * * @param string $name * The name of the location to fetch. * * @return string * The value of the provided named location */
  
public function getLocationReplacements() {
    return (new Interpolator())->setData($this->ensureLocations());
  }

  /** * Ensures that all of the locations defined in the scaffold files exist. * * Create them on the filesystem if they do not. */
  protected function ensureLocations() {
    $fs = new Filesystem();
    $locations = $this->getOptions()->locations() + ['web_root' => './'];
    $locations = array_map(function D$location) use ($fs) {
      $fs->ensureDirectoryExists($location);
      $location = realpath($location);
      return $location;
    }$locations);
    return $locations;
  }

}
Home | Imprint | This part of the site doesn't use cookies.