Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //error_reporting(E_ALL &~ E_NOTICE);
- //ini_set('display_errors', 1);
- require(XENFORO_PATH . '/library/XenForo/Autoloader.php');
- //require(XENFORO_PATH . '/library/Zend/Registry.php');
- XenForo_Autoloader::getInstance()->setupAutoloader(XENFORO_PATH . '/library');
- //XenForo_Application::initialize(XENFORO_PATH . '/library', XENFORO_PATH);
- XenForo_Application::setClassName('XenForo_Application');
- XenForo_Application::$time = time();
- XenForo_Application::$host = (empty($_SERVER['HTTP_HOST']) ? '' : $_SERVER['HTTP_HOST']);
- XenForo_Application::$secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on');
- $app = XenForo_Application::getInstance();
- require(XenForo_Autoloader::getInstance()->autoloaderClassToFile('Lgpl_utf8'));
- $app->_configDir = XENFORO_PATH . '/library';
- $defaultConfig = $app->loadDefaultConfig();
- $config = array();
- require($app->_configDir . '/config.php');
- $outconfig = new Zend_Config(array(), true);
- $outconfig->merge($defaultConfig)
- ->merge(new Zend_Config($config))
- ->setReadOnly();
- $config = $outconfig;
- //var_dump($app->_configDir);
- $app->_rootDir = XENFORO_PATH;
- $app->addLazyLoader('requestPaths', array($app, 'loadRequestPaths'));
- //var_Dump(file_exists($app->_configDir . '/config.php'));
- //$config = $app->loadConfig();
- XenForo_Application::set('config', $config);
- $app->addLazyLoader('db', array($app, 'loadDb'), $config->db);
- $app->addLazyLoader('cache', array($app, 'loadCache'), $config->cache);
- $app->addLazyLoader('options', array($app, 'loadOptions'));
- $app->addLazyLoader('simpleCache', array($app, 'loadSimpleCache'));
- //$app->loadDefaultData();
- $app->_initialized = true;
- //var_Dump("derp"); exit;
- XenForo_Application::set('page_start_time', microtime(true));
- class Bridge extends XenForo_ControllerPublic_Abstract {
- private static $_instance;
- public $_request;
- protected $_dependencies;
- private $_action;
- private $_session_timeout;
- protected $_view;
- public function __construct(){
- $this->_dependencies = new XenForo_Dependencies_Public();
- $this->_dependencies->preLoadData();
- $this->_request = new Zend_Controller_Request_Http();
- $this->_response = new Zend_Controller_Response_Http();
- $this->_request->setBasePath(XENFORO_PATH);
- $requestPaths = XenForo_Application::getRequestPaths($this->_request);
- XenForo_Application::set('requestPaths', $requestPaths);
- }
- public function init(){
- $this->_preDispatchFirst($this->_action);
- $this->_setupSession($this->_action);
- $this->_handlePost($this->_action);
- $this->_preDispatchType($this->_action);
- $this->_preDispatch($this->_action);
- XenForo_CodeEvent::fire('controller_pre_dispatch', array($this, $this->_action));
- $this->_dependencies->preRenderView();
- $this->_view = new XenForo_ViewPublic_Base(
- new XenForo_ViewRenderer_HtmlPublic($this->_dependencies, new Zend_Controller_Response_Http(), $this->_request),
- new Zend_Controller_Response_Http());
- }
- public function shutdown(){
- $this->postDispatch(new XenForo_ControllerResponse_Message(), 'Tapatalk_ControllerPublic_Tapatalk', $this->_action);
- $this->_response->sendHeaders();
- }
- public function renderTemplate($templateName){
- $template = $this->_view->createTemplateObject($templateName);
- $params = $this->_dependencies->getEffectiveContainerParams(array(), $this->_request);
- $params['serverTimeInfo'] = XenForo_Locale::getDayStartTimestamps();
- $template->setParams($params);
- return $template->render();
- }
- /*
- * Bridge instance manager
- * @return Bridge
- */
- public static final function getInstance()
- {
- if (!self::$_instance)
- {
- self::$_instance = new Bridge();
- self::$_instance->init();
- }
- return self::$_instance;
- }
- /**
- * @return Shimmie_Dependencies_Public
- */
- public function getDependencies(){
- return $this->_dependencies;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement