Permalink
Browse files

Fixing imports and exceptions in ChdbLoader.

  • Loading branch information...
1 parent a048d66 commit 318cf9175a577a28f884f2dd885bf21234ce2d96 @zyxist zyxist committed Jul 11, 2011
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/Opl/Autoloader/ChdbLoader.php
@@ -10,7 +10,9 @@
* and other contributors. See website for details.
*/
namespace Opl\Autoloader;
+use chdb;
use DomainException;
+use Exception;
use RuntimeException;
/**
@@ -59,7 +61,14 @@ public function __construct($defaultPath, $classMapLocation)
{
$this->setDefaultPath($defaultPath);
$this->classMapLocation = $classMapLocation;
- $this->classMap = new chdb($this->classMapLocation);
+ try
+ {
+ $this->classMap = new chdb($this->classMapLocation);
+ }
+ catch(Exception $exception)
+ {
+ throw new RuntimeException('Cannot find a class map under the specified location.');
+ }
} // end __construct();
/**
@@ -181,6 +190,7 @@ public function loadClass($className)
{
return false;
}
+ $class = unserialize($class);
require($this->namespaces[$class[0]].$class[1]);
return true;
} // end loadClass();

0 comments on commit 318cf91

Please sign in to comment.