コード例 #1
0
 /**
  * This operation reads a configuration file using the file path method argument.
  * 
  * Configurations are stored in a class attribue as an array.
  * 
  * @param string $sPath
  * @throws \MiniOrm\DbalException
  */
 public function read($sPath)
 {
     if (!\is_file($sPath)) {
         throw DbalException::configurationNotFound($sPath);
     }
     if (!\is_readable($sPath)) {
         throw DbalException::configurationNotReadable($sPath);
     }
     $this->aConfigs = (include $sPath);
     if (!\is_array($this->aConfigs)) {
         throw DbalException::configurationInvalid($sPath);
     }
 }