改名
This commit is contained in:
@@ -75,11 +75,24 @@ abstract class BaseApplication extends Component
|
|||||||
$this->parseEvents($config);
|
$this->parseEvents($config);
|
||||||
$this->initErrorHandler();
|
$this->initErrorHandler();
|
||||||
$this->enableEnvConfig();
|
$this->enableEnvConfig();
|
||||||
|
$this->mapping($config['mapping']);
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $mapping
|
||||||
|
*/
|
||||||
|
public function mapping(array $mapping)
|
||||||
|
{
|
||||||
|
$di = Kiri::getDi();
|
||||||
|
foreach ($mapping as $interface => $class) {
|
||||||
|
$di->mapping($interface, $class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -94,6 +94,16 @@ class Container extends BaseObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $interface
|
||||||
|
* @param $class
|
||||||
|
*/
|
||||||
|
public function mapping($interface, $class)
|
||||||
|
{
|
||||||
|
$this->_interfaces[$interface] = $class;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $class
|
* @param $class
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|||||||
Reference in New Issue
Block a user