Ejemplo n.º 1
0
 /**
  * Search data platform Magento.
  * @return boolean
  * @final
  */
 private final function Magento()
 {
     global $docroot;
     $root = $docroot && empty($docroot) === false ? $docroot : $_SERVER['DOCUMENT_ROOT'];
     if (file_exists("{$root}/app/Mage.php")) {
         $file = file_get_contents("{$root}/app/Mage.php");
         if (stripos($file, 'Magento') !== false) {
             $this->name = 'Magento';
             $file = str_replace("\n", "", $file);
             if (Server::PerlRegex() && preg_match("/.*getVersionInfo\\(\\)\\s+\\{(.*\\s+\\)\\;)\\s+\\}.*/", $file, $regx)) {
                 $v = @eval($regx[1]);
                 if ($v) {
                     $this->version = trim("{$v['major']}.{$v['minor']}.{$v['revision']}" . ($v['patch'] != '' ? ".{$v['patch']}" : "") . "-{$v['stability']}{$v['number']}", '.-');
                 }
             }
             if (file_exists("{$root}/app/etc/local.xml") && Server::SimpleXML()) {
                 $config = file_get_contents("{$root}/app/etc/local.xml");
                 $config = str_replace("<![CDATA[", "", $config);
                 $config = str_replace("]]>", "", $config);
                 $config = simplexml_load_string($config);
                 if (isset($config->global->resources->default_setup->connection)) {
                     $config = $config->global->resources->default_setup->connection;
                     $this->db['driver'] = 'mysql';
                 }
                 if (isset($config->host)) {
                     $this->db['host'] = (string) $config->host;
                 }
                 if (isset($config->username)) {
                     $this->db['user'] = (string) $config->username;
                 }
                 if (isset($config->password)) {
                     $this->db['password'] = (string) $config->password;
                 }
                 if (isset($config->dbname)) {
                     $this->db['dbname'] = (string) $config->dbname;
                 }
             }
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 2
0
$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.');
$b->add('Actual Execution Time', HighLoad::ActualExecutionTime(50), null, null, 'Checks real-time execution of the script.');