getPhp() public method

Method to get PHP version
public getPhp ( ) : string
return string
Beispiel #1
0
 /**
  * Create a new config model object
  *
  * @param array $data
  * @return Config
  */
 public function __construct(array $data = [])
 {
     parent::__construct($data);
     $server = new Server();
     $config = Table\Config::getConfig();
     $distro = $server->getDistro();
     $this->data['overview'] = ['version' => \Phire\Module::VERSION, 'domain' => $config['domain'], 'document_root' => $config['document_root'], 'base_path' => BASE_PATH == '' ? ' ' : BASE_PATH, 'application_path' => APP_PATH == '' ? ' ' : APP_PATH, 'content_path' => CONTENT_PATH, 'modules_path' => MODULES_PATH, 'operating_system' => $server->getOs() . (!empty($distro) ? ' (' . $distro . ')' : null), 'software' => $server->getServer() . ' ' . $server->getServerVersion(), 'database_version' => Table\Config::db()->version(), 'php_version' => $server->getPhp(), 'installed_on' => $config['installed_on'] != '0000-00-00 00:00:00' ? date($config['datetime_format'], strtotime($config['installed_on'])) : '', 'updated_on' => $config['updated_on'] != '0000-00-00 00:00:00' ? date($config['datetime_format'], strtotime($config['updated_on'])) : ''];
     $config['datetime_formats'] = ['M j Y', 'F d, Y', 'm/d/Y', 'Y/m/d', 'F d, Y g:i A', 'M j Y g:i A', 'm/d/Y g:i A', 'Y/m/d g:i A'];
     $config['system_themes'] = [];
     $config['custom_system_themes'] = [];
     $dir = new Dir(__DIR__ . '/../../data/themes');
     foreach ($dir->getFiles() as $file) {
         if ($file != 'index.html') {
             $config['system_themes'][$file] = $file;
         }
     }
     if (isset($_SERVER['DOCUMENT_ROOT'])) {
         $dir = new Dir($_SERVER['DOCUMENT_ROOT'] . BASE_PATH . CONTENT_PATH . '/phire/themes');
         foreach ($dir->getFiles() as $file) {
             if ($file != 'index.html') {
                 $config['custom_system_themes'][$file] = $file;
             }
         }
     }
     sort($config['system_themes']);
     sort($config['custom_system_themes']);
     $this->data['config'] = $config;
     $this->data['modules'] = Table\Modules::findAll(['order' => 'id DESC', 'limit' => 5])->rows();
 }
Beispiel #2
0
 /**
  * Static method to get all configuration values
  *
  * @return array
  */
 public static function setConfig()
 {
     if (isset($_SERVER) && isset($_SERVER['SERVER_SOFTWARE'])) {
         $server = new Server();
         $cfg = static::findById('system_domain');
         $cfg->value = $_SERVER['HTTP_HOST'];
         $cfg->update();
         $cfg = static::findById('system_document_root');
         $cfg->value = $_SERVER['DOCUMENT_ROOT'];
         $cfg->update();
         $cfg = static::findById('server_operating_system');
         $cfg->value = $server->getOs() . ' (' . $server->getDistro() . ')';
         $cfg->update();
         $cfg = static::findById('server_software');
         $cfg->value = $server->getServer() . ' ' . $server->getServerVersion();
         $cfg->update();
         $cfg = static::findById('database_version');
         $cfg->value = static::getDb()->adapter()->version();
         $cfg->update();
         $cfg = static::findById('php_version');
         $cfg->value = $server->getPhp();
         $cfg->update();
         $cfg = static::findById('reply_email');
         $cfg->value = 'noreply@' . str_replace('www.', '', $_SERVER['HTTP_HOST']);
         $cfg->update();
     }
 }