예제 #1
0
 /**
  * Returns file to inject, or false if none specified.
  *
  * @param OMBuilder $builder
  * @param string $type
  * @return string|bool
  */
 public function inject($builder, $type)
 {
     if ($file = $this->getParameter($type)) {
         $path = $builder->getBuildProperty('projectDir') . DIRECTORY_SEPARATOR . $file;
         if (!file_exists($path)) {
             throw new Exception('Inject-file doesnt exist: ' . $path);
         }
         return file_get_contents($path);
     }
     return false;
 }