Ejemplo n.º 1
0
 public static function getLink()
 {
     // is phpmyadmin installed?
     if (is_dir(WPNXM_WWW_DIR . 'phpmyadmin') === true) {
         $password = \WPNXM\Webinterface\Helper\Serverstack::getPassword('mariadb');
         $href = WPNXM_ROOT . 'tools/phpmyadmin/index.php?lang=en&server=1&pma_username=root&pma_password='******'<a href="' . $href . '">phpMyAdmin</a>';
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns Version.
  *
  * @return string Version
  */
 public function getVersion()
 {
     if (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('Traitor - you are using Apache!');
     }
     if (strpos($_SERVER['SERVER_SOFTWARE'], 'Development Server') !== false) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('The webinterface is served via the embedded PHP Development Server!');
     }
     return substr($_SERVER['SERVER_SOFTWARE'], 6);
 }
Ejemplo n.º 3
0
 /**
  * Returns MariaDB Version.
  *
  * @return string MariaDB Version
  */
 public function getVersion()
 {
     # fail safe, for unconfigured php.ini files
     if (!function_exists('mysqli_connect')) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "mysqli" is required.');
     }
     $connection = @mysqli_connect('localhost', 'root', $this->getPassword());
     if (false === $connection) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark(sprintf('MariaDB Connection not possible. Access denied. Check credentials. Error: "%s"', mysqli_connect_error()));
     }
     // fetch server_info, e.g. "5.5.5-10.1.0-MariaDB" and drop the last part
     $version = str_replace('-MariaDB', '', $connection->server_info);
     $connection->close();
     return $version;
 }
Ejemplo n.º 4
0
 /**
  * Returns PHP Version.
  *
  * @return string PHP Version
  */
 public function getVersion()
 {
     // load and parse a PEAR file to get the version, alternative to "pear.bat -V"
     $file = WPNXM_BIN . 'php\\PEAR\\pear\\PEAR\\Autoloader.php';
     # fail safe, if PEAR not installed
     if (is_file($file) === false) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "mysqli" is required.');
     }
     $maxLines = 60;
     // read only the first few lines of the file
     $file_handle = fopen($file, 'r');
     for ($i = 1; $i < $maxLines && !feof($file_handle); $i++) {
         $line_of_text = fgetcsv($file_handle, 1024);
         if (strpos($line_of_text[0], '@version')) {
             // lets grab the version from the phpdoc tag
             preg_match('/\\/* @version[\\s]+Release: (\\d+.\\d+.\\d+)/', $line_of_text[0], $matches);
         }
     }
     fclose($file_handle);
     return $versions = $matches[1];
 }
Ejemplo n.º 5
0
 public function getVersion()
 {
     if ($this->isInstalled() === false) {
         return 'not installed';
     }
     if (!extension_loaded('mongo')) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "Mongo" is required.');
     }
     try {
         $m = new \MongoClient();
         //require admin privilege
         $db = $m->admin;
         //$mongodb_info = $db->command(['buildinfo' => true]);
         //$mongodb_version = $mongodb_info['version'];
         // this returns an array with the keys "retval","ok"
         $mongodb_version = $db->execute('return db.version()');
     } catch (\MongoConnectionException $e) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark($e->getMessage() . '. Please wake the daemon.');
     }
     return $mongodb_version['retval'];
 }
Ejemplo n.º 6
0
 /**
  * Returns memcached Version.
  *
  * @return string memcached Version
  */
 public function getVersion()
 {
     if ($this->isInstalled() === false) {
         return 'not installed';
     }
     if (extension_loaded('memcache') === false) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "memcache" is required.');
     }
     // hardcoded for now
     $server = 'localhost';
     $port = 11211;
     $memcache = new \Memcache();
     $memcache->addServer($server, $port);
     $version = @$memcache->getVersion();
     $available = (bool) $version;
     if ($available && @$memcache->connect($server, $port)) {
         return $version;
     } else {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('Please wake the Memcache daemon.');
     }
 }
Ejemplo n.º 7
0
 public function getVersion()
 {
     if (extension_loaded('zmq') === false) {
         return \WPNXM\Webinterface\Helper\Serverstack::printExclamationMark('Not implemented yet!');
     }
 }