Exemplo n.º 1
0
 public function onGlobalIncludes(Am_Event_GlobalIncludes $e)
 {
     if ($this->isConfigured() && ($this->getConfig('use_wordpress_theme') || $this->getConfig('network'))) {
         // Disable autoload;
         //Save superglobals to avoid modification in wordpress.
         $this->saveGlobalVars();
         foreach (spl_autoload_functions() as $f) {
             $this->_autoload_backup[] = $f;
             spl_autoload_unregister($f);
         }
         $this->_include_path = get_include_path();
         // Add theme folder to include path;
         define("WP_CACHE", false);
         define("WP_USE_THEMES", false);
         // Save headers that was sent by aMember;
         $this->_headers_backup = headers_list();
         $this->_timezone_backup = date_default_timezone_get();
         $this->_error_reporting_backup = error_reporting();
         $e->add($this->config['folder'] . "/wp-blog-header.php");
     }
 }
Exemplo n.º 2
0
 public function onGlobalIncludes(Am_Event_GlobalIncludes $e)
 {
     if ($this->isConfigured() && $this->getConfig('use_wordpress_theme')) {
         // Disable autoload;
         //Save superglobals to avoid modification in wordpress.
         $this->saveGlobalVars();
         foreach (spl_autoload_functions() as $f) {
             $this->_autoload_backup[] = $f;
             spl_autoload_unregister($f);
         }
         // Add theme folder to include path;
         define("WP_CACHE", false);
         define("WP_USE_THEMES", false);
         $e->add($this->config['folder'] . "/wp-blog-header.php");
     }
 }