mirror of
https://github.com/friendica/friendica
synced 2024-11-14 18:22:55 +00:00
7d876aab98
- Updated mobiledetectlib to 2.8.26 - Updated PEAR to 1.10.5 - Updated Archive_Tar to 1.4.3 - Updated XML_Util to 1.4.3
42 lines
1,004 B
PHP
42 lines
1,004 B
PHP
<?php
|
|
/**
|
|
* Helper that enables access to private and protected methods and properties.
|
|
*/
|
|
class PrivProxy
|
|
{
|
|
private $obj;
|
|
|
|
public function __construct($obj)
|
|
{
|
|
$this->obj = $obj;
|
|
}
|
|
|
|
public function __call($method, $arguments)
|
|
{
|
|
$rm = new ReflectionMethod($this->obj, $method);
|
|
$rm->setAccessible(true);
|
|
return $rm->invokeArgs($this->obj, $arguments);
|
|
}
|
|
|
|
public static function __callStatic($method, $arguments)
|
|
{
|
|
$rm = new ReflectionMethod($this->obj, $method);
|
|
$rm->setAccessible(true);
|
|
return $rm->invokeArgs($this->obj, $arguments);
|
|
}
|
|
|
|
public function __set($var, $value)
|
|
{
|
|
$rp = new ReflectionProperty($this->obj, $var);
|
|
$rp->setAccessible(true);
|
|
$rp->setValue($this->obj, $value);
|
|
}
|
|
|
|
public function __get($var)
|
|
{
|
|
$rp = new ReflectionProperty($this->obj, $var);
|
|
$rp->setAccessible(true);
|
|
return $rp->getValue($this->obj);
|
|
}
|
|
}
|
|
?>
|