Permalink
Browse files

split into multiple files

  • Loading branch information...
1 parent c287441 commit 8dc2253c0cae74a36eacf3d5109459921006b7d2 @giveit-deploy giveit-deploy committed Nov 16, 2012
Showing with 34 additions and 27 deletions.
  1. +6 −27 AutoLoader.php
  2. +28 −0 Entity.php
View
@@ -10,33 +10,7 @@
* @version 3.0.0
*/
-namespace opensourceame\AutoLoader;
-
-class Entity
-{
- public $location;
- public $status;
- public $lastCheckTime;
- public $lastCheckCount;
-
- /**
- * Set the properties of the entity
- *
- * @param array $data
- * @return \opensourceame\AutoLoader\Entity
- */
- static function __set_state(array $data) {
-
- $entity = new Entity;
-
- foreach($data as $key => $val) {
- $entity->key = $val;
- }
-
- return $entity;
- }
-}
-
+namespace opensourceame;
class AutoLoader
{
@@ -91,6 +65,9 @@ public function __construct($config = false)
}
spl_autoload_register('\opensourceame\AutoLoader\AutoLoader::load');
+
+ // require the entity file
+ require_once __DIR__ . '/Entity.php';
}
/**
@@ -660,6 +637,8 @@ private function addMissingClass($className)
$this->index[$class] = $entity;
$this->missing[$class] = &$this->index[$class];
+
+ return true;
}
private function addFoundClass($filename, $namespace, $className)
View
@@ -0,0 +1,28 @@
+<?php
+
+namespace opensourceame\Autoloader;
+
+class Entity
+{
+ public $location;
+ public $status;
+ public $lastCheckTime;
+ public $lastCheckCount;
+
+ /**
+ * Set the properties of the entity
+ *
+ * @param array $data
+ * @return \opensourceame\AutoLoader\Entity
+ */
+ static function __set_state(array $data) {
+
+ $entity = new Entity;
+
+ foreach($data as $key => $val) {
+ $entity->key = $val;
+ }
+
+ return $entity;
+ }
+}

0 comments on commit 8dc2253

Please sign in to comment.