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