/** * The class constructor initializes variables. * @param string $user * @param string $pass * @param string $dbname * @param string $host * @param string $driver * @final */ public final function __construct($user, $pass, $dbname = null, $host = 'localhost', $driver = 'mysql') { if (Server::PDO()) { $this->dbname = $dbname; try { $this->db = new \PDO("{$driver}:host={$host}" . (is_null($dbname) ? '' : ";dbname={$dbname}"), $user, $pass); } catch (PDOException $e) { } } }
/** * Search data platform PHPNuke. * @return boolean * @final */ private final function PHPNuke() { global $docroot; $root = $docroot && empty($docroot) === false ? $docroot : $_SERVER['DOCUMENT_ROOT']; if (file_exists("{$root}/admin.php")) { $file = file_get_contents("{$root}/admin.php"); if (stripos($file, 'PHP-NUKE') !== false) { $this->name = 'PHP-Nuke'; if (file_exists("{$root}/config.php")) { @(include "config.php"); if (isset($dbtype)) { $this->db['driver'] = strtolower($dbtype); } if (isset($dbhost)) { $this->db['host'] = $dbhost; } if (isset($dbuname)) { $this->db['user'] = $dbuname; } if (isset($dbpass)) { $this->db['password'] = $dbpass; } if (isset($dbname)) { $this->db['dbname'] = $dbname; } } if (isset($this->db['driver']) && isset($this->db['host']) && isset($this->db['user']) && isset($this->db['password']) && isset($this->db['dbname']) && isset($prefix) && Server::PDO()) { try { $db = new \PDO("{$this->db['driver']}:host={$this->db['host']};dbname={$this->db['dbname']}", $this->db['user'], $this->db['password']); $v = $db->prepare("SELECT `Version_Num` as `version` FROM `{$prefix}_config` LIMIT 1"); $v->execute(); if ($tmp = $v->fetch(\PDO::FETCH_ASSOC)) { $this->version = reset(explode(' ', $tmp['version'])); } } catch (PDOException $e) { } } return true; } } return false; }
$b->add('PHP Accelerator', Server::PHPAccelerator(), null, null, 'Finds accelerator php.'); $b->add('Safe Mode', Server::SafeMode(), null, null, 'Checking Safe Mode.'); $b->add('Short Open Tag', Server::ShortOpenTag(), null, null, 'Checking Short Open Tag.'); $b->add('Shared Memory', Server::SharedMemory(), null, null, 'Checking Shared Memory.'); $b->add('Posix', Server::Posix(), null, null, 'Checking posix.'); $b->add('Pcntl', Server::Pcntl(), null, null, 'Checking pcntl.'); $b->add('Email Sending', Server::EmailSending(), null, null, 'Checking Messages.'); $b->add('Mcrypt', Server::Mcrypt(), null, null, 'Checking mcrypt.'); $b->add('Sockets', Server::Sockets(), null, null, 'Checking sockets.'); $b->add('PHP Regex', Server::PHPRegex(), null, null, 'Checking php regex.'); $b->add('Perl Regex', Server::PerlRegex(), null, null, 'Checking perl regex.'); $b->add('Zlib', Server::Zlib(), null, null, 'Checking zlib.'); $b->add('GDlib', Server::GDlib(), null, null, 'Checking gdlib.'); $b->add('Free Type', Server::FreeType(), null, null, 'Checking free type.'); $b->add('Mbstring', Server::Mbstring(), null, null, 'Checking mbstring.'); $b->add('PDO', Server::PDO(), null, null, 'Checking PDO'); $b->add('SimpleXML', Server::SimpleXML(), null, null, 'Checking SimpleXML'); $b->add('DOMDocument', Server::DOMDocument(), null, null, 'Checking DOMDocument'); $b->add('Curl', Server::Curl(), null, null, 'Checking Curl'); $b->add('Memory Limit', Server::MemoryLimit(), null, null, 'Checking Memory Limit'); $b->add('Max Execution Time', Server::MaxExecutionTime(), null, null, 'Checking Max Execution Time'); $b->add('Umask', Server::Umask(), null, null, 'Finds and returns the umask.'); $b->add('Post Max Size', Server::PostMaxSize(), null, null, 'Finds and returns the post max size.'); $b->add('Register Globals', Server::RegisterGlobals(), null, null, 'Checking Register Globals.'); $b->add('Display Errors', Server::DisplayErrors(), null, null, 'Checking Display Errors.'); $b->add('PHP File Uploads', Server::PHPFileUploads(), null, null, 'Checking PHPFileUploads.'); $b->add('Server Time', Server::ServerTime(), null, null, 'Returns the current server time.'); $b->addHeader('High Load.'); $b->add('Actual Memory Limit', HighLoad::ActualMemoryLimit(), 128, '>', 'Checks the actual memory limit.'); $b->add('Number Cpu Operations', HighLoad::NumberCpuOperations(), null, null, 'Number of operations of the CPU.'); $b->add('Number File Operations', HighLoad::NumberFileOperations(), null, null, 'Number of file operations.');