Мелкие правки
This commit is contained in:
parent
b3f6cfcbd7
commit
0c3fba0d7e
2 changed files with 6 additions and 4 deletions
|
|
@ -208,9 +208,11 @@ class Component
|
|||
$filename = Path::join($this->viewPath[count($this->viewPath) - 1], 'install.json');
|
||||
if (file_exists($filename)) {
|
||||
$settings = json_decode(File::getContents($filename), true);
|
||||
return $settings;
|
||||
if ($settings) {
|
||||
return $settings;
|
||||
}
|
||||
}
|
||||
return array();
|
||||
return array('parameter' => []);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -246,7 +248,7 @@ class Component
|
|||
$name = $path;
|
||||
|
||||
$path = Path::join ($site->config->get('site', 'components'), $name, $name . '.php');
|
||||
$className = 'Components\\'. ucfirst($name). '\\' . ucfirst($name);
|
||||
$className = implode("\\", ['Components', ucfirst($name), ucfirst($name)]);
|
||||
|
||||
$component/*: Component*/ = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class Factory
|
|||
public $db;
|
||||
public $config;
|
||||
|
||||
public function __construct (Database $db, Registry $config = null, User $user)
|
||||
public function __construct (Database $db, Registry $config = null, User $user = null)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->config = $config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue