示例#1
0
 /**
  * Get & scan all modules.
  *
  * @return array
  */
 public function scan()
 {
     $paths = $this->getScanPaths();
     $modules = [];
     foreach ($paths as $key => $path) {
         $manifests = $this->app['files']->glob("{$path}/module.json");
         is_array($manifests) || ($manifests = []);
         foreach ($manifests as $manifest) {
             $name = Json::make($manifest)->get('name');
             $lowerName = strtolower($name);
             $modules[$name] = new Module($this->app, $lowerName, dirname($manifest));
         }
     }
     return $modules;
 }
示例#2
0
 public function testMakeNewInstance()
 {
     $data = Json::make($this->getPath());
     $this->assertInstanceOf('Pingpong\\Modules\\Json', $data);
     $this->assertTrue(is_array($data->toArray()));
 }