function installClasses() { litepublisher::$urlmap = turlmap::i(); litepublisher::$urlmap->lock(); $posts = tposts::i(); $posts->lock(); $xmlrpc = TXMLRPC::i(); $xmlrpc->lock(); ttheme::$defaultargs = array(); $theme = ttheme::getinstance('default'); // $html = tadminhtml::i(); // $html->loadinstall(); foreach (litepublisher::$classes->items as $class => $item) { //echo "$class<br>\n"; if (preg_match('/^(titem|titem_storage|titemspostsowner|tcomment|IXR_Client|IXR_Server|tautoform|tchildpost|tchildposts|tlitememcache)$/', $class)) { continue; } $obj = getinstance($class); if (method_exists($obj, 'install')) { $obj->install(); } } $xmlrpc->unlock(); $posts->unlock(); litepublisher::$urlmap->unlock(); }
require_once litepublisher::$paths->lib . 'events.class.php'; require_once litepublisher::$paths->lib . 'items.class.php'; require_once litepublisher::$paths->lib . 'classes.php'; require_once litepublisher::$paths->lib . 'options.class.php'; } else { require_once litepublisher::$paths->lib . 'kernel.php'; } litepublisher::$classes = tclasses::instance(); litepublisher::$options = toptions::instance(); if (!litepublisher::$options->installed) { require_once litepublisher::$paths->lib . 'install' . DIRECTORY_SEPARATOR . 'install.php'; } if (dbversion) { litepublisher::$db = new tdatabase(); } litepublisher::$options->admincookie = litepublisher::$options->cookieenabled && litepublisher::$options->authcookie(); litepublisher::$urlmap = turlmap::instance(); if (!defined('litepublisher_mode')) { litepublisher::$urlmap->request(strtolower($_SERVER['HTTP_HOST']), $_SERVER['REQUEST_URI']); } litepublisher::$options->cache = false; litepublisher::$options->savemodified(); litepublisher::$options->showerrors(); if (dbversion && !preg_match('/(^\\/rpc\\.xml|\\/rss|\\/comments\\.)|(\\.xml$)/', $_SERVER['REQUEST_URI'])) { echo "<pre>\n"; $man = tdbmanager::instance(); //$man->deletealltables(); //echo $man->performance(); //file_put_contents(litepublisher::$pathshome. "litepublisher::$domain .sql", $man->export()); } //
require_once litepublisher::$paths->lib . 'options.class.php'; require_once litepublisher::$paths->lib . 'site.class.php'; } else { require_once litepublisher::$paths->lib . 'kernel.php'; } define('dbversion', true); /* if (class_exists('Memcache')) { tfilestorage::$memcache = new Memcache; tfilestorage::$memcache->connect('127.0.0.1', 11211); } */ if (!tstorage::loaddata()) { if (file_exists(litepublisher::$paths->data . 'storage.php') && filesize(litepublisher::$paths->data . 'storage.php')) { die('Storage not loaded'); } require_once litepublisher::$paths->lib . 'install' . DIRECTORY_SEPARATOR . 'install.php'; } litepublisher::$classes = tclasses::i(); litepublisher::$options = toptions::i(); litepublisher::$db = tdatabase::i(); litepublisher::$site = tsite::i(); litepublisher::$urlmap = turlmap::i(); if (!defined('litepublisher_mode')) { litepublisher::$urlmap->request(strtolower($_SERVER['HTTP_HOST']), $_SERVER['REQUEST_URI']); } } catch (Exception $e) { litepublisher::$options->handexception($e); } litepublisher::$options->savemodified(); litepublisher::$options->showerrors();
} return parent::getinstance($class); } public function newinstance($class) { if (isset($this->mobileclasses[$class])) { $class = $this->mobileclasses[$class]; } return parent::newinstance($class); } } //class litepublisher::$classes = new tmobileclasses(); require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mobile.classes.php'; litepublisher::$options = tmobileoptions::instance(); if (!litepublisher::$options->installed) { require_once litepublisher::$paths->lib . 'install' . DIRECTORY_SEPARATOR . 'install.php'; } if (dbversion) { litepublisher::$db = new tdatabase(); } litepublisher::$options->admincookie = litepublisher::$options->cookieenabled && litepublisher::$options->authcookie(); litepublisher::$urlmap = tmobileurlmap::instance(); if (!defined('litepublisher_mode')) { litepublisher::$urlmap->request(strtolower($_SERVER['HTTP_HOST']), $_SERVER['REQUEST_URI']); } } catch (Exception $e) { echo $e->GetMessage(); } litepublisher::$options->savemodified(); litepublisher::$options->showerrors();