Exemplo n.º 1
0
 public static function getLink()
 {
     // is phpmyadmin installed?
     if (is_dir(WPNXM_WWW_DIR . 'phpmyadmin') === true) {
         $password = \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>';
     }
 }
Exemplo n.º 2
0
 /**
  * Returns Version.
  *
  * @return string Version
  */
 public function getVersion()
 {
     if (extension_loaded('apc') === false) {
         return \Webinterface\Helper\Serverstack::printExclamationMarkLeft('The PHP Extension "APC" is required.');
     }
     //$info = \apc_sma_info();
     //var_dump($info);
     return phpversion('apc');
 }
Exemplo n.º 3
0
 /**
  * Returns Version.
  *
  * @return string Version
  */
 public function getVersion()
 {
     if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') !== false) {
         return \Webinterface\Helper\Serverstack::printExclamationMark('Traitor - you are using Apache!');
     }
     if (strpos($_SERVER["SERVER_SOFTWARE"], 'Development Server') !== false) {
         return \Webinterface\Helper\Serverstack::printExclamationMark('The webinterface is served via the embedded PHP Development Server!');
     }
     return substr($_SERVER["SERVER_SOFTWARE"], 6);
 }
Exemplo n.º 4
0
 /**
  * Returns MariaDB Version.
  *
  * @return string MariaDB Version
  */
 public function getVersion()
 {
     # fail safe, for unconfigured php.ini files
     if (!function_exists('mysqli_connect')) {
         return \Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "mysqli" is required.');
     }
     $connection = @mysqli_connect('localhost', 'root', $this->getPassword());
     if (false === $connection) {
         return \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;
 }
Exemplo n.º 5
0
 /**
  * Returns memcached Version.
  *
  * @return string memcached Version
  */
 public function getVersion()
 {
     if ($this->isInstalled() === false) {
         return 'not installed';
     }
     if (extension_loaded('memcache') === false) {
         return \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 \Webinterface\Helper\Serverstack::printExclamationMark('Please wake the Memcache daemon.');
     }
 }
Exemplo n.º 6
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 \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];
 }
Exemplo n.º 7
0
 public function getVersion()
 {
     if ($this->isInstalled() === false) {
         return 'not installed';
     }
     if (!extension_loaded('mongo')) {
         return \Webinterface\Helper\Serverstack::printExclamationMark('The PHP Extension "Mongo" is required.');
     }
     try {
         $m = new \MongoClient();
         //require admin privilege
         $db = $m->admin;
         //$mongodb_info = $db->command(array('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 \Webinterface\Helper\Serverstack::printExclamationMark($e->getMessage() . '. Please wake the daemon.');
     }
     return $mongodb_version['retval'];
 }
Exemplo n.º 8
0
 public function getVersion()
 {
     if (extension_loaded('zmq') === false) {
         return \Webinterface\Helper\Serverstack::printExclamationMark('Not implemented yet!');
     }
 }
Exemplo n.º 9
0
/**
 * WPИ-XM Server Stack
 * Copyright © 2010 - onwards, Jens-André Koch <*****@*****.**>
 * http://wpn-xm.org/
 *
 * This source file is subject to the terms of the MIT license.
 * For full copyright and license information, view the bundled LICENSE file.
 */
function index()
{
    $tpl_data = array('load_jquery_additionals' => true, 'components' => \Webinterface\Helper\Serverstack::getInstalledComponents(), 'windows_version' => \Webinterface\Helper\Serverstack::getWindowsVersion(), 'bitsize' => \Webinterface\Helper\Serverstack::getBitSizeString(), 'registry_updated' => \Webinterface\Helper\Updater::updateRegistry(), 'registry' => include WPNXM_DATA_DIR . 'wpnxm-software-registry.php');
    render('page-action', $tpl_data);
}
Exemplo n.º 10
0
 public function getPackagistPackageDescription($package = '')
 {
     $url = sprintf('https://packagist.org/packages/%s.json', $package);
     $context = stream_context_create(array('http' => array('ignore_errors' => true)));
     // silenced: because this throws a warning, if offline
     $json = @file_get_contents($url, false, $context);
     $array = json_decode($json, true);
     if (isset($array['status']) && $array['status'] === 'error') {
         \Webinterface\Helper\Serverstack::printExclamationMark('The request to packagist.org failed. This might be a service problem.' . ' Please ensure that HTTPS streamwrapper support is enabled in php.ini (extension=php_openssl.dll).');
     }
     return $array;
 }
Exemplo n.º 11
0
function index()
{
    $tpl_data = array('load_jquery_additionals' => true, 'nginx_version' => Serverstack::getVersion('nginx'), 'php_version' => Serverstack::getVersion('php'), 'mariadb_version' => Serverstack::getVersion('mariadb'), 'memcached_version' => Serverstack::getVersion('memcached'), 'xdebug_version' => Serverstack::getVersion('xdebug'), 'mongodb_version' => Serverstack::getVersion('mongodb'), 'postgresql_version' => Serverstack::getVersion('postgresql'), 'nginx_status' => Serverstack::getStatus('nginx'), 'php_status' => Serverstack::getStatus('php'), 'mariadb_status' => Serverstack::getStatus('mariadb'), 'xdebug_status' => Serverstack::getStatus('xdebug'), 'mongodb_status' => Serverstack::getStatus('mongodb'), 'phpext_mongo_status' => Serverstack::getStatus('phpext_mongo'), 'memcached_status' => Serverstack::getStatus('memcached'), 'phpext_memcached_status' => Serverstack::getStatus('phpext_memcache'), 'postgresql_status' => Serverstack::getStatus('postgresql'), 'my_ip' => Serverstack::getMyIP(), 'mariadb_password' => Serverstack::getPassword('mariadb'), 'memcached_installed' => Serverstack::isInstalled('memcached'), 'xdebug_installed' => Serverstack::isInstalled('xdebug'), 'mongodb_installed' => Serverstack::isInstalled('mongodb'), 'postgresql_installed' => Serverstack::isInstalled('postgresql'), 'phpext_memcached_installed' => Serverstack::isExtensionInstalled('memcached'), 'phpext_xdebug_installed' => Serverstack::isExtensionInstalled('xdebug'), 'xdebug_extension_type' => XDebug::getXDebugExtensionType(), 'xdebug_profiler_active' => XDebug::isProfilerActive(), 'server_is_nginx' => strpos($_SERVER["SERVER_SOFTWARE"], 'nginx') !== false ? true : false);
    render('page-action', $tpl_data);
}