public function getConnection() { if ($this->conn === null) { $dsn = 'mysql:dbname=' . $_SERVER['PM_UNIT_DB_NAME'] . ';host=' . $_SERVER['PM_UNIT_DB_HOST']; if (self::$pdo == null) { self::$pdo = new PDO($dsn, $_SERVER['PM_UNIT_DB_USER'], $_SERVER['PM_UNIT_DB_PASS']); } $this->conn = $this->createDefaultDBConnection(self::$pdo, $_SERVER['PM_UNIT_DB_NAME']); } return $this->conn; }
public function setUp() { if (self::$InitProcessToRestore === null) { self::$InitProcessToRestore = ProcManager::getInstance()->getCurrentProcess(); } $this->config = new XMLAuthConfiguration(SYSTEM_CONF_PATH . '/' . SERVICES_DIR . '/' . SERVICE_UM_DIR . '/' . SERVICE_UM_AUTHCONFIGURATIONS_DIR . '/eyeos_default.xml'); $this->loginContext = new LoginContext('eyeos-login', new Subject(), $this->config); $this->loginContext->getSubject()->getPrivateCredentials()->append(new EyeosPasswordCredential('john', 'john')); $this->loginContext->login(); $proc = new Process('init'); $proc->setLoginContext($this->loginContext); ProcManager::getInstance()->execute($proc); self::$MyProcPid = $proc->getPid(); }
public function __construct($url) { $this->url = $url; parent::__construct("curl --connect-timeout 3 {$this->url}"); }
public function __construct($domain, $server) { $this->domain = $domain; $this->server = $server; parent::__construct("nslookup -timeout=3 {$domain} {$server}"); }
public function __construct($ip) { $this->ip = $ip; parent::__construct("/bin/ping -c 1 -W 3 {$this->ip}"); }