shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

proxy.php (1119B)


      1 <?php
      2 /**
      3  * @package		OpenCart
      4  * @author		Daniel Kerr
      5  * @copyright	Copyright (c) 2005 - 2017, OpenCart, Ltd. (https://www.opencart.com/)
      6  * @license		https://opensource.org/licenses/GPL-3.0
      7  * @link		https://www.opencart.com
      8 */
      9 
     10 /**
     11 * Proxy class
     12 */
     13 class Proxy {
     14     /**
     15      * 
     16      *
     17      * @param	string	$key
     18      */	
     19 	public function __get($key) {
     20 		return $this->{$key};
     21 	}	
     22 
     23     /**
     24      * 
     25      *
     26      * @param	string	$key
     27 	 * @param	string	$value
     28      */	
     29 	public function __set($key, $value) {
     30 		 $this->{$key} = $value;
     31 	}
     32 	
     33 	public function __call($key, $args) {
     34 		$arg_data = array();
     35 		
     36 		$args = func_get_args();
     37 		
     38 		foreach ($args as $arg) {
     39 			if ($arg instanceof Ref) {
     40 				$arg_data[] =& $arg->getRef();
     41 			} else {
     42 				$arg_data[] =& $arg;
     43 			}
     44 		}
     45 		
     46 		if (isset($this->{$key})) {		
     47 			return call_user_func_array($this->{$key}, $arg_data);	
     48 		} else {
     49 			$trace = debug_backtrace();
     50 			
     51 			exit('<b>Notice</b>:  Undefined property: Proxy::' . $key . ' in <b>' . $trace[1]['file'] . '</b> on line <b>' . $trace[1]['line'] . '</b>');
     52 		}
     53 	}
     54 }