Example #1
0
 /**
  * Class constructor.
  * pass in alternate to $_REQUEST
  */
 public function __construct($data = NULL)
 {
     if ($data === NULL) {
         $data = $_REQUEST;
     }
     parent::__construct($data);
     $trim_chars = "/\n\r\t\v ";
     $server = \Wukka\ShortCircuit::server();
     $this->uri = '/' . trim($server->REQUEST_URI, $trim_chars);
     if (isset($this->{'_'})) {
         $action = $this->{'_'};
     } elseif (isset($server->PATH_INFO)) {
         $action = $server->PATH_INFO;
     } else {
         $pos = strpos($this->uri, '?');
         $action = $pos === FALSE ? $this->uri : substr($this->uri, 0, $pos);
     }
     $script_name = $server->SCRIPT_NAME;
     $action = str_replace(array($script_name, $script_name . '?_='), '', $action);
     $action = trim($action, $trim_chars);
     $this->action = '/' . $action;
     if (strpos($this->uri, $script_name) === 0) {
         $this->base = $script_name;
     } else {
         $this->base = '';
     }
 }
Example #2
0
 /**
  * Class constructor.
  * pass in alternate to $_REQUEST
  */
 public function __construct($data = NULL)
 {
     if ($data === NULL) {
         $this->__d =& $_SERVER;
     } else {
         parent::__construct($data);
     }
 }
Example #3
0
File: Eav.php Project: wukka/store
 /**
  * Specify storage and an entity key.
  * This will load a bunch of key/value pairs associated with the entity
  */
 public function __construct(Iface $storage, $entity)
 {
     $this->storage = $storage;
     // a way to populate an entity without having to read from storage.
     // for internal use only. used by the EAV::bulkLoad() method.
     if (is_array($entity)) {
         $this->entity = $entity["._entity"];
         unset($entity["._entity"]);
         $this->load($entity);
         $this->state = $this->checksum();
         return;
     }
     // standard approach.
     $this->entity = $entity;
     parent::__construct($this->storage->get($entity));
     $this->state = $this->checksum();
 }