public function actionView()
 {
     $class = $this->_input->filterSingle('class', XenForo_Input::STRING);
     try {
         $dataWriter = XenForo_DataWriter::create($class);
     } catch (Exception $e) {
     }
     if (empty($dataWriter) || !$dataWriter instanceof XenForo_DataWriter) {
         return $this->responseNoPermission();
     }
     $reflectionClass = new ThemeHouse_Reflection_Class(get_class($dataWriter));
     $reflectionMethods = $reflectionClass->getMethods();
     $methods = array();
     foreach ($reflectionMethods as $reflectionMethod) {
         /* @var $reflectionMethod ReflectionMethod */
         $methodName = $reflectionMethod->getName();
         $declaringClass = $reflectionMethod->getDeclaringClass();
         $methods[$methodName]['declaringClass'] = $declaringClass->getName();
         $methods[$methodName]['isAbstract'] = $reflectionMethod->isAbstract();
         $methods[$methodName]['isConstructor'] = $reflectionMethod->isConstructor();
         $methods[$methodName]['isDeprecated'] = $reflectionMethod->isDeprecated();
         $methods[$methodName]['isDestructor'] = $reflectionMethod->isDestructor();
         $methods[$methodName]['isFinal'] = $reflectionMethod->isFinal();
         $methods[$methodName]['isInternal'] = $reflectionMethod->isInternal();
         $methods[$methodName]['isPrivate'] = $reflectionMethod->isPrivate();
         $methods[$methodName]['isProtected'] = $reflectionMethod->isProtected();
         $methods[$methodName]['isPublic'] = $reflectionMethod->isPublic();
         $methods[$methodName]['isStatic'] = $reflectionMethod->isStatic();
         $methods[$methodName]['isUserDefined'] = $reflectionMethod->isUserDefined();
     }
     $fields = $dataWriter->getFields();
     $dataWriter = array('class' => $class);
     $viewParams = array('dataWriter' => $dataWriter, 'fields' => $fields, 'methods' => $methods);
     return $this->responseView('ThemeHouse_DataWriters_ViewAdmin_Model_View', 'th_datawriter_view_datawriters', $viewParams);
 }
 public function actionView()
 {
     $class = $this->_input->filterSingle('class', XenForo_Input::STRING);
     try {
         $response = new Zend_Controller_Response_Http();
         $controllerAdmin = new $class($this->getRequest(), $response, $this->getRouteMatch());
     } catch (Exception $e) {
     }
     if (empty($controllerAdmin) || !$controllerAdmin instanceof XenForo_ControllerAdmin_Abstract) {
         return $this->responseNoPermission();
     }
     $reflectionClass = new ThemeHouse_Reflection_Class(get_class($controllerAdmin));
     $reflectionMethods = $reflectionClass->getMethods();
     $methods = array();
     foreach ($reflectionMethods as $reflectionMethod) {
         /* @var $reflectionMethod ReflectionMethod */
         $methodName = $reflectionMethod->getName();
         $declaringClass = $reflectionMethod->getDeclaringClass();
         $methods[$methodName]['declaringClass'] = $declaringClass->getName();
         $methods[$methodName]['isAbstract'] = $reflectionMethod->isAbstract();
         $methods[$methodName]['isConstructor'] = $reflectionMethod->isConstructor();
         $methods[$methodName]['isDeprecated'] = $reflectionMethod->isDeprecated();
         $methods[$methodName]['isDestructor'] = $reflectionMethod->isDestructor();
         $methods[$methodName]['isFinal'] = $reflectionMethod->isFinal();
         $methods[$methodName]['isInternal'] = $reflectionMethod->isInternal();
         $methods[$methodName]['isPrivate'] = $reflectionMethod->isPrivate();
         $methods[$methodName]['isProtected'] = $reflectionMethod->isProtected();
         $methods[$methodName]['isPublic'] = $reflectionMethod->isPublic();
         $methods[$methodName]['isStatic'] = $reflectionMethod->isStatic();
         $methods[$methodName]['isUserDefined'] = $reflectionMethod->isUserDefined();
     }
     $controllerAdmin = array('class' => $class);
     $viewParams = array('controllerAdmin' => $controllerAdmin, 'methods' => $methods);
     return $this->responseView('ThemeHouse_Controllers_ViewAdmin_ControllerAdmin_View', 'th_controller_admin_view_controllers', $viewParams);
 }
 public static function createFromReflectionClass(ThemeHouse_Reflection_Class $reflectionClass)
 {
     $phpFile = self::create('ThemeHouse_PhpFile', $reflectionClass->getName());
     foreach ($reflectionClass->getConstants() as $constantName => $constantValue) {
         $constant = $phpFile->getConstant($constantName);
         $constant->setValue($constantValue);
     }
     foreach ($reflectionClass->getDefaultProperties() as $propertyName => $propertyValue) {
         $variable = $phpFile->getVariable($propertyName);
         $variable->setValue($propertyValue);
     }
     foreach ($reflectionClass->getMethods(-1, 'ThemeHouse_Reflection_Method') as $method) {
         /* @var $method ThemeHouse_Reflection_Method */
         $function = $phpFile->getFunction($method->getName());
         $function->setBody($method->getBody());
         $function->setPhpDoc($method->getDocblock()->getContents());
         $function->setSignature(explode(',', $method->getSignature()));
         if ($method->isPublic()) {
             $function->setPublic(true);
         } elseif ($method->isProtected()) {
             $function->setProtected(true);
         }
     }
     return $phpFile;
 }