示例#1
0
 /**
  *  Enable overwrite protection for all class properties
  *  @name    __set
  *  @type    magic method
  *  @access  public
  *  @param   string key
  *  @param   mixed  value
  *  @return  void
  */
 public function __set($name, $value)
 {
     if ($this->_protect) {
         return $this->call('/Log/message', __METHOD__ . ' not allowed to modify ' . strToUpper($this->_type) . ' request variables', 2);
     }
     return parent::__set($name, $value);
 }
 /**
  *  Get the value of the entity, or fall down to custom property
  *  @name   get
  *  @type   method
  *  @access public
  *  @param  string entity
  *  @return string value
  */
 public function get($property, $default = null)
 {
     if (isset(self::$resolve[$property])) {
         return self::$resolve[$property];
     }
     return parent::get($property, $default);
 }
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     //  get the _preferedlimit from the Config object, defaults to 2
     $this->_preferedlimit = $this->get("/Config/Delegate/limit", 2);
     //  set the initial value of _storecount to 0, no store calls done so far
     $this->_storecount = 0;
 }
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     session_start();
     $this->_consumer = $this->instance("/Authentication/OAuth/Consumer");
     $this->_consumer->initialize("s7cFnNqM7ifA5rnQXWgTBw", "AoyW3YRn8B3wQ3YdwgfHZG2TbNjL9J60Wym4eQPQ");
     $this->_token = $this->_getAccessTokenFromSession();
 }
 /**
  *  Constructor
  *  @name   __construct
  *  @type   method
  *  @access public
  *  @param  Konsolidate object
  *  @return ScaffoldSource object
  */
 public function __construct(Konsolidate $parent)
 {
     parent::__construct($parent);
     $cache = $this->get('/Config/Source/cache', '/tmp');
     if (!realpath($cache)) {
         $cache = $this->_locatePath($cache);
     }
     $this->_cachePath = realpath($cache);
 }
 /**
  *  constructor
  *  @name    __construct
  *  @type    constructor
  *  @access  public
  *  @param   object parent object
  *  @returns object
  *  @syntax  object = &new BreedDBMySQLi( object parent )
  *  @note    This object is constructed by one of Konsolidates modules
  */
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     $this->_URI = null;
     $this->_conn = null;
     $this->_cache = array();
     $this->error = null;
     $this->_transaction = false;
     $this->_fingerprintreplacement = array("string" => $this->get("/Config/MySQL/fingerprint_string", "'\$'"), "number" => $this->get("/Config/MySQL/fingerprint_number", "#"), "NULL" => $this->get("/Config/MySQL/fingerprint_null", "NULL"), "names" => $this->get("/Config/MySQL/fingerprint_names", "`?`"));
 }
 public function __call($method, $arg)
 {
     if ($this->_cursor && is_callable(array($this->_cursor, $method))) {
         return $this->_execute($this->_cursor, $method, $arg);
     } else {
         if ($this->_collection && is_callable(array($this->_collection, $method))) {
             return $this->_execute($this->_collection, $method, $arg);
         }
     }
     return parent::__call($method, $arg);
 }
示例#8
0
 /**
  *  Automatically populate child modules (Variables, Table and Status if requested)
  *  @name    register
  *  @type    method
  *  @access  public
  *  @param   string module/connection
  *  @returns Object
  *  @note    this method is an override to Konsolidates default behaviour
  */
 public function register($sModule)
 {
     $oModule = parent::register($sModule);
     switch (strtolower($sModule)) {
         case "variable":
             $sQuery = "SHOW VARIABLES";
             $oResult = $this->call("../query", $sQuery);
             if (is_object($oResult) && $oResult->errno <= 0 && (bool) $oResult->rows) {
                 while ($oRecord = $oResult->next()) {
                     $oModule->set(strtolower($oRecord->Variable_name), $oRecord->Value);
                 }
             }
             break;
         case "status":
             $sQuery = "SHOW GLOBAL STATUS";
             $oResult = $this->call("../query", $sQuery);
             if (is_object($oResult) && $oResult->errno <= 0 && (bool) $oResult->rows) {
                 while ($oRecord = $oResult->next()) {
                     $oModule->set("Global/" . strtolower($oRecord->Variable_name), $oRecord->Value);
                 }
             }
             $sQuery = "SHOW SESSION STATUS";
             $oResult = $this->call("../query", $sQuery);
             if (is_object($oResult) && $oResult->errno <= 0 && (bool) $oResult->rows) {
                 while ($oRecord = $oResult->next()) {
                     $oModule->set("Session/" . strtolower($oRecord->Variable_name), $oRecord->Value);
                 }
             }
             break;
         case "table":
             $sQuery = "SHOW TABLE STATUS";
             $oResult = $this->call("../query", $sQuery);
             if (is_object($oResult) && $oResult->errno <= 0 && (bool) $oResult->rows) {
                 while ($oRecord = $oResult->next()) {
                     $sName = $oRecord->Name;
                     foreach ($oRecord as $sKey => $sValue) {
                         $oModule->set("{$sName}/" . strToLower($sKey), $sValue);
                     }
                 }
             }
             break;
     }
     return $oModule;
 }
示例#9
0
<?php

//  we like to define our paths (change it to your path)
define('CLASS_PATH', realpath('path/to/your/classes'));
define('KONSOLIDATE_PATH', realpath(CLASS_PATH . '/konsolidate'));
//  include the konsolidate class (if you don't yet have it, download it from https://github.com/konfirm/konsolidate)
include KONSOLIDATE_PATH . '/konsolidate.class.php';
//  set up the Konsolidate tiers
$tier = array('Scaffold' => realpath(CLASS_PATH . '/scaffold'), 'Core' => realpath(KONSOLIDATE_PATH . '/core'));
//  and there it is.. Konsolidate now has the Scaffolding features (assuming you fixed the paths to match your development environent
$oK = new Konsolidate($tier);
//  turn of the default template filtering, so we can actually read the HTML output
$oK->set('/Config/Template/filters', '');
 public function __construct($oParent)
 {
     parent::__construct($oParent);
 }
 /**
  *  Magic setter to trigger PHASE_ASSIGN phase hooks and setting the value
  *  @name   __set
  *  @type   method
  *  @access public
  *  @return void
  */
 public function __set($property, $value)
 {
     $this->_enterPhase(self::PHASE_ASSIGN, array('property' => &$property, 'value' => &$value));
     parent::__set($property, $value);
 }
示例#12
0
 /**
  *  Enable shorthand cookie setting
  *  @name    __set
  *  @type    magic method
  *  @access  public
  *  @param   string key
  *  @param   mixed  value
  *  @return  void
  */
 public function __set($name, $value)
 {
     $this->_removeCounterfit($name);
     setCookie($name, $value);
     return parent::__set($name, $value);
 }
<?php

$START_GLOBAL = microtime(true);
//  we like to define our paths, we need to check if these are set, as the benchmark index.php will keep including this
if (!defined('CLASS_PATH')) {
    define('CLASS_PATH', realpath('path/to/your/classes'));
}
if (!defined('KONSOLIDATE_PATH')) {
    define('KONSOLIDATE_PATH', realpath(CLASS_PATH . '/konsolidate'));
}
//  include the konsolidate class
include_once KONSOLIDATE_PATH . '/konsolidate.class.php';
//  set up the Konsolidate tiers
$tier = array('Core' => realpath(KONSOLIDATE_PATH . '/core'));
//  and there it is.. Konsolidate now has the Scaffolding features (assuming you fixed the paths to match your development environent
$oK = new Konsolidate($tier);
//  Set up the template and compilation paths
$oK->set('/Config/Path/template', './template');
$oK->set('/Config/Path/compile', sys_get_temp_dir());
$START_READY = microtime(true);
 /**
  *  Create <Tier>RequestType instances for all appropiate request type and overwrite the superglobal $_REQUEST
  *  @name    _collect
  *  @type    method
  *  @access  protected
  *  @return  void
  */
 protected function _collect()
 {
     $method = $_SERVER['REQUEST_METHOD'];
     switch ($method) {
         case 'POST':
         case 'PUT':
         case 'DELETE':
             $this->{$method} = parent::instance('Type', $method);
             //  no break, all of these requests may also have GET variables
         //  no break, all of these requests may also have GET variables
         case 'GET':
         case 'PURGE':
             $this->GET = parent::instance('Type', 'GET');
             break;
         default:
             $this->call('/Log/message', 'Request-type ' . $method . ' not supported', 3);
             break;
     }
     $GLOBALS['_REQUEST'] = $this;
 }
 /**
  *  Constructor
  *  @name   __construct
  *  @type   method
  *  @access public
  *  @param  Konsolidate $parent
  *  @param  Array feature group
  *  @return ScaffoldTemplateGroup object
  */
 public function __construct(Konsolidate $parent, array $group = null)
 {
     parent::__construct($parent);
     $this->_group = $group;
 }
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     $this->_timeout = 10;
 }
示例#17
0
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     $this->version = self::OAUTH_VERSION;
 }
 public function __construct($oParent)
 {
     parent::__construct($oParent);
     $this->_resource = array();
 }
 /**
  *  Magic getter, adding a failsafe to look at the node attributes if no local property was found
  *  @name   __get
  *  @type   method
  *  @access public (magic)
  *  @param  string property
  *  @return mixed value
  */
 public function __get($property)
 {
     $return = parent::__get($property);
     if (!$return) {
         $return = $this->attribute($property);
     }
     return $return;
 }