-
-
Save Jimmi08/3ef6814fe83d3d7d1c3a6ed1c15ac4b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("e107_INIT", TRUE); | |
$chwd = realpath(dirname(__FILE__)); | |
$e107_config = $chwd . '/e107_config.php'; | |
include_once($e107_config); | |
$e107_version = $chwd . '/' . $ADMIN_DIRECTORY . 'ver.php'; | |
require_once $e107_version; | |
define("e_VERSION", $e107info['e107_version']); | |
$core_funcs = $chwd . '/' . $HANDLERS_DIRECTORY . 'core_functions.php'; | |
$e107_class = $chwd . '/' . $HANDLERS_DIRECTORY . 'e107_class.php'; | |
require_once $core_funcs; | |
e107_require_once($e107_class); | |
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY', 'UPLOADS_DIRECTORY', 'SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY', 'CACHE_DIRECTORY', 'LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY'); | |
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix'); | |
$e107 = e107::getInstance(); | |
$e107->initCore($e107_paths, $chwd, $sql_info); | |
// This auto-handles bans etc. | |
// e107::getSingleton('eIPHandler'); | |
// allow disable of autoloading - may be removed as e107::autoload_register() is flexible enough | |
if (!defset('E107_DISABLE_AUTOLOAD', FALSE)) { | |
e107::autoload_register(array('e107', 'autoload')); | |
} | |
$session_handler = e_HANDLER.'session_handler.php'; | |
e107_require_once($session_handler); | |
define('e_SECURITY_LEVEL', e_session::SECURITY_LEVEL_NONE); | |
define('e_COOKIE', 'e107cli'); | |
$e107->getSession(); | |
e107::getDb()->gen("SELECT * FROM #plugin WHERE plugin_path = 'qna' LIMIT 1"); | |
$row = e107::getDb()->fetch(); | |
$result = e107::getPlugin()->install_plugin($row['plugin_id']); | |
// var_dump($result); | |
var_dump(e107::getDb()); | |
/* | |
object(db)#8 (24) { | |
["mySQLserver"]=> | |
NULL | |
["mySQLuser"]=> | |
NULL | |
["mySQLpassword":protected]=> | |
NULL | |
["mySQLdefaultdb":protected]=> | |
NULL | |
["mySQLPrefix"]=> | |
string(7) "e107v2_" | |
["mySQLaccess":protected]=> | |
NULL | |
["mySQLresult"]=> | |
NULL | |
["mySQLrows"]=> | |
NULL | |
["mySQLerror"]=> | |
string(0) "" | |
["mySQLlastErrNum":protected]=> | |
int(0) | |
["mySQLlastErrText":protected]=> | |
string(0) "" | |
["mySQLlastQuery":protected]=> | |
string(0) "" | |
["mySQLcurTable"]=> | |
NULL | |
["mySQLlanguage"]=> | |
NULL | |
["mySQLinfo"]=> | |
NULL | |
["tabset"]=> | |
NULL | |
["mySQLtableList"]=> | |
array(0) { | |
} | |
["mySQLtableListLanguage"]=> | |
array(0) { | |
} | |
["mySQLtablelist"]=> | |
array(0) { | |
} | |
["dbFieldDefs":protected]=> | |
array(0) { | |
} | |
["mySQLcharset"]=> | |
NULL | |
["mySqlServerInfo"]=> | |
string(1) "?" | |
["total_results"]=> | |
bool(false) | |
["pdo":"e_db_mysql":private]=> | |
bool(false) | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment