Ejemplo n.º 1
0
 /**
  * Retrieves the content.
  *
  * @return string
  */
 public function getContent()
 {
     $content = '<span>Class Locations: </span>';
     $content .= $this->formatLocations($this->classLoader->getLocations());
     $content .= '<br />';
     $content .= '<span>Plugin Locations: </span>';
     $content .= $this->formatLocations($this->pluginLoader->getLocations());
     $content .= '<br />';
     $content .= '<span>File Locations: </span>';
     $content .= $this->formatLocations($this->fileLoader->getLocations());
     return $content;
 }
Ejemplo n.º 2
0
 /**
  * Loads a config file.
  *
  * @param string $file
  *
  * @return self
  */
 public function loadFile($file)
 {
     $content = $this->fileLoader->load($file, 'config');
     if ($this->placeholders) {
         $search = array_keys($this->placeholders);
         $replace = array_values($this->placeholders);
         $content = str_replace($search, $replace, $content);
     }
     $values = $this->parser->parse($content);
     $this->settings = array_merge($this->settings, $values);
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Locates a plugin, which implements/extends a superclass.
  *
  * @param string $name
  * @param string $superclass
  *
  * @return string|false
  */
 public function locate($name, $superclass)
 {
     $this->assertPluginNameIsNotEmpty($name);
     $superclass = trim($superclass, '\\');
     $file = $this->getClassName($name) . '.php';
     $path = parent::locate($file, $superclass);
     return $path;
 }
Ejemplo n.º 4
0
 /**
  * @test
  * @expectedException \Neat\Loader\Exception\UnexpectedValueException
  */
 public function load_nonExistingFile_throwsException()
 {
     $this->assertSame('dir3_test', $this->subject->load('test.php', $this->domain));
 }