Ejemplo n.º 1
0
 /**
  * Sets the current Puli directory.
  *
  * The current Puli directory is directory of the currently loaded Twig
  * template. For example, if the template "/webmozart/puli/views/index.html"
  * is being loaded, then "/webmozart/puli/views" is the current directory.
  * If asset inputs are given as relative path, the relative paths are
  * searched for in this directory of the Puli repository.
  *
  * The asset name is generated when this method is called. Once generated,
  * the name cannot be changed anymore. Hence this method can be called only
  * once.
  *
  * @param string $currentDir The current Puli directory.
  *
  * @throws RuntimeException If the method was already called before.
  */
 public function setCurrentDir($currentDir)
 {
     if ($this->name) {
         throw new RuntimeException('The current directory must be set only once.');
     }
     $this->name = $this->factory->generateAssetNameForCurrentDir($currentDir, $this->inputs, $this->filters, $this->options);
     // GC
     $this->factory = null;
     $this->inputs = null;
     $this->filters = null;
     $this->options = null;
 }