Skip to content

Commit

Permalink
split into multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
giveit-deploy committed Nov 16, 2012
1 parent c287441 commit 8dc2253
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
33 changes: 6 additions & 27 deletions AutoLoader.php
Expand Up @@ -10,33 +10,7 @@
* @version 3.0.0 * @version 3.0.0
*/ */


namespace opensourceame\AutoLoader; namespace opensourceame;

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;
}
}



class AutoLoader class AutoLoader
{ {
Expand Down Expand Up @@ -91,6 +65,9 @@ public function __construct($config = false)
} }


spl_autoload_register('\opensourceame\AutoLoader\AutoLoader::load'); spl_autoload_register('\opensourceame\AutoLoader\AutoLoader::load');

// require the entity file
require_once __DIR__ . '/Entity.php';
} }


/** /**
Expand Down Expand Up @@ -660,6 +637,8 @@ private function addMissingClass($className)
$this->index[$class] = $entity; $this->index[$class] = $entity;


$this->missing[$class] = &$this->index[$class]; $this->missing[$class] = &$this->index[$class];

return true;
} }


private function addFoundClass($filename, $namespace, $className) private function addFoundClass($filename, $namespace, $className)
Expand Down
28 changes: 28 additions & 0 deletions Entity.php
@@ -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.