<?php
/* ZNCServer.class.php - ZNC Server Class - ZNCAdmin
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
- *
+ *
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
define("ERR_OK", 0);
$zncserver_classes = array(
"ZNCServerV0.class.php",
+ "ZNCServerV1.class.php",
);
class ZNCServer {
public function ZNCServer($host, $port, $version = null) {
$this->host = $host;
$this->port = $port;
- if(is_empty(self::$zncserver_classes))
+ if(empty(self::$zncserver_classes))
self::load_classes();
if($version !== null) {
$this->loadServerObject($version);
$logged_in = !preg_match("/errorbar/i", $http);
/* Version detection */
- if(preg_match("ZNC ([0-9]+\.[0-9]+)", $http, $version_match))
+ if(preg_match("#ZNC ([0-9]+\.[0-9]+)#", $http, $version_match))
$this->loadServerObject($version_match[1], $connector);
return $logged_in;