Esempio n. 1
0
 public function actionRun()
 {
     $server = new WebServer("0.0.0.0", "443");
     try {
         $server->run();
     } catch (Exception $e) {
         $server->stdout($e->getMessage());
     }
 }
 public function setUp()
 {
     parent::setUp();
     // launch selenium server
     SeleniumServer::getInstance()->launchServer();
     SeleniumServer::getInstance()->forwardWebServerViaSSH();
     // launch web server
     WebServer::getInstance()->launchServer();
     S::startbrowser();
 }
Esempio n. 3
0
 /**
  * 初始化AccessLog
  * @return void 
  */
 public function initAccessLog()
 {
     // 虚拟机访问日志目录
     self::$accessLog = \Man\Core\Lib\Config::get($this->workerName . '.access_log');
     // 默认访问日志目录
     if ($default_access_log = \Man\Core\Lib\Config::get($this->workerName . '.default_access_log')) {
         self::$defaultAccessLog = $default_access_log;
     }
 }
Esempio n. 4
0
 /**
  * Checks that the server running on hostname:port is actually XBMC and not 
  * some other software. We do this by looking at the authentication realm 
  * string.
  * @param string $attribute the attribute being validated ("username" in 
  * this case)
  */
 public function checkServerType($attribute)
 {
     if (!$this->areAttributesValid(array('hostname', 'port'))) {
         return;
     }
     $webserver = new WebServer($this->hostname, $this->port);
     // Check that the server requires authentication
     if (!$webserver->requiresAuthentication()) {
         $this->addError($attribute, Yii::t('Backend', 'The server does not ask for authentication'));
     } else {
         // Check the authentication realm
         $realm = $webserver->getAuthenticationRealm();
         if (strtolower($realm) !== 'xbmc') {
             $message = 'The server at ' . $webserver->getHostInfo() . " doesn't seem to be an XBMC instance";
             // Log whatever string the server identified as for debugging purposes
             Yii::log($message . ' (the server identified as "' . $realm . '")', CLogger::LEVEL_ERROR, 'Backend');
             $this->addError($attribute, $message);
         }
     }
 }
Esempio n. 5
0
<?php

namespace Zotlabs\Web;

/**
 * @file index.php
 *
 * @brief The main entry point to the application.
 */
require_once 'Zotlabs/Web/WebServer.php';
$server = new WebServer();
$server->run();