--- /dev/null
+<?php
+
+class IPF_Server_Exception extends Exception
+{
+}
+
} elseif (class_exists($class)) {
$reflection = new ReflectionClass($class);
} else {
- throw new IPF_Exception('Invalid class or object passed to attachClass()');
+ throw new IPF_Server_Exception('Invalid class or object passed to attachClass()');
}
if ($argv && !is_array($argv)) {
- throw new IPF_Exception('Invalid argv argument passed to reflectClass');
+ throw new IPF_Server_Exception('Invalid argv argument passed to reflectClass');
}
return new IPF_Server_Reflection_Class($reflection, $namespace, $argv);
}
public static function reflectFunction($function, $argv = false, $namespace = '')
{
if (!is_string($function) || !function_exists($function)) {
- throw new IPF_Exception('Invalid function "' . $function . '" passed to reflectFunction');
+ throw new IPF_Server_Exception('Invalid function "' . $function . '" passed to reflectFunction');
}
if ($argv && !is_array($argv)) {
- throw new IPF_Exception('Invalid argv argument passed to reflectClass');
+ throw new IPF_Server_Exception('Invalid argv argument passed to reflectClass');
}
return new IPF_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv);
}
if (method_exists($this->_reflection, $method)) {
return call_user_func_array(array($this->_reflection, $method), $args);
}
- throw new IPF_Exception('Invalid reflection method');
+ throw new IPF_Server_Exception('Invalid reflection method');
}
public function __get($key)
}
if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) {
- throw new IPF_Exception('Invalid namespace');
+ throw new IPF_Server_Exception('Invalid namespace');
}
$this->_namespace = $namespace;
// testing here.
if ((!$r instanceof ReflectionFunction)
&& (!$r instanceof ReflectionMethod)) {
- throw new IPF_Exception('Invalid reflection class');
+ throw new IPF_Server_Exception('Invalid reflection class');
}
$this->_reflection = $r;
return call_user_func_array(array($this->_reflection, $method), $args);
}
- throw new IPF_Exception('Invalid reflection method ("' .$method. '")');
+ throw new IPF_Server_Exception('Invalid reflection method ("' .$method. '")');
}
public function __get($key)
}
if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) {
- throw new IPF_Exception('Invalid namespace');
+ throw new IPF_Server_Exception('Invalid namespace');
}
$this->_namespace = $namespace;
public function setDescription($string)
{
if (!is_string($string)) {
- throw new IPF_Exception('Invalid description');
+ throw new IPF_Server_Exception('Invalid description');
}
$this->_description = $string;
if (method_exists($this->_reflection, $method)) {
return call_user_func_array(array($this->_reflection, $method), $args);
}
- throw new IPF_Exception('Invalid reflection method');
+ throw new IPF_Server_Exception('Invalid reflection method');
}
public function getType()
public function setType($type)
{
if (!is_string($type) && (null !== $type)) {
- throw new IPF_Exception('Invalid parameter type');
+ throw new IPF_Server_Exception('Invalid parameter type');
}
$this->_type = $type;
}
public function setDescription($description)
{
if (!is_string($description) && (null !== $description)) {
- throw new IPF_Exception('Invalid parameter description');
+ throw new IPF_Server_Exception('Invalid parameter description');
}
$this->_description = $description;
}
$this->_return = $return;
if (!is_array($params) && (null !== $params)) {
- throw new IPF_Exception('Invalid parameters');
+ throw new IPF_Server_Exception('Invalid parameters');
}
if (is_array($params)) {
foreach ($params as $param) {
if (!$param instanceof IPF_Server_Reflection_Parameter) {
- throw new IPF_Exception('One or more params are invalid');
+ throw new IPF_Server_Exception('One or more params are invalid');
}
}
}
public function setType($type)
{
if (!is_string($type) && (null !== $type)) {
- throw new IPF_Exception('Invalid parameter type');
+ throw new IPF_Server_Exception('Invalid parameter type');
}
$this->_type = $type;
}
public function setDescription($description)
{
if (!is_string($description) && (null !== $description)) {
- throw new IPF_Exception('Invalid parameter description');
+ throw new IPF_Server_Exception('Invalid parameter description');
}
$this->_description = $description;
}