release 1.1.1

This commit is contained in:
Newcomer1989
2016-10-08 15:26:17 +02:00
parent e20f08f8b3
commit ab76128c42
80 changed files with 4085 additions and 3002 deletions

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Abstract.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Blacklist.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Blacklist.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: FileTransfer.php 10/11/2013 11:35:21 scp@orilla $
* $Id: FileTransfer.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: ServerQuery.php 10/11/2013 11:35:21 scp@orilla $
* $Id: ServerQuery.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Event.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Event.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Reply.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Reply.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -194,7 +194,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
foreach($nodes as $node)
{
if(array_key_exists($ident, $node))
if(isset($node[$ident]))
{
$array[(is_object($node[$ident])) ? $node[$ident]->toString() : $node[$ident]] = $node;
}
@@ -315,7 +315,7 @@ class TeamSpeak3_Adapter_ServerQuery_Reply
{
$suffix = "";
}
throw new TeamSpeak3_Adapter_ServerQuery_Exception($this->getErrorProperty("msg") . $suffix, $this->getErrorProperty("id"));
}
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: TSDNS.php 10/11/2013 11:35:21 scp@orilla $
* $Id: TSDNS.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Update.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Update.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -1,9 +1,10 @@
<?PHP
<?php
/**
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -19,8 +20,110 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
class TeamSpeak3_Exception extends Exception{ protected static $messages=array(); public function __construct($mesg,$code=0x00){parent::__construct($mesg,$code);if(array_key_exists((int)$code,self::$messages)){$this->message=$this->prepareCustomMessage(self::$messages[intval($code)]);}TeamSpeak3_Helper_Signal::getInstance()->emit("errorException",$this);} protected function prepareCustomMessage(TeamSpeak3_Helper_String$mesg){$args=array("code"=>$this->getCode(),"mesg"=>$this->getMessage(),"line"=>$this->getLine(),"file"=>$this->getFile(),);return $mesg->arg($args)->toString();} public static function registerCustomMessage($code,$mesg){if(array_key_exists((int)$code,self::$messages)){ throw new self("custom message for code 0x".strtoupper(dechex($code))." is already registered");}if(!is_string($mesg)){ throw new self("custom message for code 0x".strtoupper(dechex($code))." must be a string");}self::$messages[(int)$code]=new TeamSpeak3_Helper_String($mesg);} public static function unregisterCustomMessage($code){if(!array_key_exists((int)$code,self::$messages)){ throw new self("custom message for code 0x".strtoupper(dechex($code))." is not registered");}unset(self::$messages[intval($code)]);} public function getSender(){$trace=$this->getTrace();return (isset($trace[0]["class"]))?$trace[0]["class"]:"{main}";}}?>
/**
* @class TeamSpeak3_Exception
* @brief Enhanced exception class for TeamSpeak3 objects.
*/
class TeamSpeak3_Exception extends Exception
{
/**
* Stores custom error messages.
*
* @var array
*/
protected static $messages = array();
/**
* The TeamSpeak3_Exception constructor.
*
* @param string $mesg
* @param integer $code
* @return TeamSpeak3_Exception
*/
public function __construct($mesg, $code = 0x00)
{
parent::__construct($mesg, $code);
if(array_key_exists((int) $code, self::$messages))
{
$this->message = $this->prepareCustomMessage(self::$messages[intval($code)]);
}
TeamSpeak3_Helper_Signal::getInstance()->emit("errorException", $this);
}
/**
* Prepares a custom error message by replacing pre-defined signs with given values.
*
* @param TeamSpeak3_Helper_String $mesg
* @return TeamSpeak3_Helper_String
*/
protected function prepareCustomMessage(TeamSpeak3_Helper_String $mesg)
{
$args = array(
"code" => $this->getCode(),
"mesg" => $this->getMessage(),
"line" => $this->getLine(),
"file" => $this->getFile(),
);
return $mesg->arg($args)->toString();
}
/**
* Registers a custom error message to $code.
*
* @param integer $code
* @param string $mesg
* @throws TeamSpeak3_Exception
* @return void
*/
public static function registerCustomMessage($code, $mesg)
{
if(array_key_exists((int) $code, self::$messages))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is already registered");
}
if(!is_string($mesg))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " must be a string");
}
self::$messages[(int) $code] = new TeamSpeak3_Helper_String($mesg);
}
/**
* Unregisters a custom error message from $code.
*
* @param integer $code
* @throws TeamSpeak3_Exception
* @return void
*/
public static function unregisterCustomMessage($code)
{
if(!array_key_exists((int) $code, self::$messages))
{
throw new self("custom message for code 0x" . strtoupper(dechex($code)) . " is not registered");
}
unset(self::$messages[(int) $code]);
}
/**
* Returns the class from which the exception was thrown.
*
* @return string
*/
public function getSender()
{
$trace = $this->getTrace();
return (isset($trace[0]["class"])) ? $trace[0]["class"] : "{main}";
}
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Char.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Char.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Convert.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Convert.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Crypt.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Crypt.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Profiler.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Profiler.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Timer.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Timer.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Signal.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Signal.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Handler.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Handler.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Interface.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Interface.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: String.php 10/11/2013 11:35:21 scp@orilla $
* $Id: String.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -51,7 +51,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
*/
public function __construct($string)
{
$this->string = strval($string);
$this->string = (string) $string;
}
/**
@@ -177,7 +177,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
* Returns true if the string contains $pattern.
*
* @param string $pattern
* @param booean $regexp
* @param boolean $regexp
* @return boolean
*/
public function contains($pattern, $regexp = FALSE)
@@ -270,7 +270,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
$total = count($sections);
$first = intval($first);
$last = intval($last);
$last = intval($last);
if($first > $total) return null;
if($first > $last) $last = $first;
@@ -491,7 +491,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
/**
* Decodes the string with MIME base64 and returns the result as an TeamSpeak3_Helper_String
*
* @param string
* @param string $base64
* @return TeamSpeak3_Helper_String
*/
public static function fromBase64($base64)
@@ -519,7 +519,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
/**
* Returns the TeamSpeak3_Helper_String based on a given hex value.
*
* @param string
* @param string $hex
* @throws TeamSpeak3_Helper_Exception
* @return TeamSpeak3_Helper_String
*/
@@ -550,7 +550,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
$utf8_accents = array(
"à" => "a",
"ô" => "o",
"<EFBFBD>?" => "d",
"ď" => "d",
"" => "f",
"ë" => "e",
"š" => "s",
@@ -560,9 +560,9 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"ř" => "r",
"ț" => "t",
"ň" => "n",
"<EFBFBD>?" => "a",
"ā" => "a",
"ķ" => "k",
"<EFBFBD>?" => "s",
"ŝ" => "s",
"" => "y",
"ņ" => "n",
"ĺ" => "l",
@@ -573,7 +573,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"ě" => "e",
"é" => "e",
"ç" => "c",
"<EFBFBD><EFBFBD>?" => "w",
"" => "w",
"ċ" => "c",
"õ" => "o",
"" => "s",
@@ -591,7 +591,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"ŵ" => "w",
"" => "t",
"ū" => "u",
"<EFBFBD>?" => "c",
"č" => "c",
"ö" => "oe",
"è" => "e",
"ŷ" => "y",
@@ -622,7 +622,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"ñ" => "n",
"ń" => "n",
"ĥ" => "h",
"<EFBFBD>?" => "g",
"ĝ" => "g",
"đ" => "d",
"ĵ" => "j",
"ÿ" => "y",
@@ -639,8 +639,8 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"ī" => "i",
"ã" => "a",
"ġ" => "g",
"<EFBFBD><EFBFBD>?" => "m",
"<EFBFBD>?" => "o",
"" => "m",
"ō" => "o",
"ĩ" => "i",
"ù" => "u",
"į" => "i",
@@ -700,7 +700,7 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"È" => "E",
"Ŷ" => "Y",
"Ą" => "A",
"<EFBFBD>?" => "L",
"Ł" => "L",
"Ų" => "U",
"Ů" => "U",
"Ş" => "S",
@@ -712,12 +712,12 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"" => "B",
"Å" => "A",
"Ì" => "I",
"<EFBFBD>?" => "I",
"Ï" => "I",
"" => "D",
"Ť" => "T",
"Ŗ" => "R",
"Ä" => "Ae",
"<EFBFBD>?" => "I",
"Í" => "I",
"Ŕ" => "R",
"Ê" => "E",
"Ü" => "Ue",
@@ -727,15 +727,15 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"Ń" => "N",
"Ĥ" => "H",
"Ĝ" => "G",
"<EFBFBD>?" => "D",
"Đ" => "D",
"Ĵ" => "J",
"Ÿ" => "Y",
"Ũ" => "U",
"Ŭ" => "U",
"Ư" => "U",
"Ţ" => "T",
"<EFBFBD>?" => "Y",
"<EFBFBD>?" => "O",
"Ý" => "Y",
"Ő" => "O",
"Â" => "A",
"Ľ" => "L",
"" => "W",
@@ -749,10 +749,10 @@ class TeamSpeak3_Helper_String implements ArrayAccess, Iterator, Countable
"Ù" => "U",
"Į" => "I",
"Ź" => "Z",
"<EFBFBD>?" => "A",
"Á" => "A",
"Û" => "U",
"Þ" => "Th",
"<EFBFBD>?" => "Dh",
"Ð" => "Dh",
"Æ" => "Ae",
"Ĕ" => "E",
"Œ" => "Oe",

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Uri.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Uri.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -155,7 +155,7 @@ class TeamSpeak3_Helper_Uri
$this->query = (isset($matches[6])) ? $matches[6] : '';
$this->fragment = (isset($matches[8])) ? $matches[8] : '';
$status = @preg_match("~^(([^:@]*)(:([^@]*))?@)?([^:]+)(:(.*))?$~", (isset($matches[3])) ? $matches[3] : "", $matches);
$status = @preg_match("~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~", (isset($matches[3])) ? $matches[3] : "", $matches);
if($status === FALSE)
{
@@ -166,7 +166,7 @@ class TeamSpeak3_Helper_Uri
$this->user = isset($matches[2]) ? $matches[2] : "";
$this->pass = isset($matches[4]) ? $matches[4] : "";
$this->host = isset($matches[5]) ? $matches[5] : "";
$this->host = isset($matches[5]) === TRUE ? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) : "";
$this->port = isset($matches[7]) ? $matches[7] : "";
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Abstract.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -229,7 +229,6 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces
$props = $node->getInfo(FALSE);
$props = array_intersect_key($props, $rules);
$match = TRUE;
foreach($props as $key => $val)
{
@@ -403,7 +402,7 @@ abstract class TeamSpeak3_Node_Abstract implements RecursiveIterator, ArrayAcces
*/
protected function getStorage($key, $default = null)
{
return (array_key_exists($key, $this->storage) && !empty($this->storage[$key])) ? $this->storage[$key] : $default;
return !empty($this->storage[$key]) ? $this->storage[$key] : $default;
}
/**

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Channel.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Channel.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -168,7 +168,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*
* @param integer $cldbid
* @param boolean $permsid
* @return void
* @return array
*/
public function clientPermList($cldbid, $permsid = FALSE)
{
@@ -186,7 +186,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function clientPermAssign($cldbid, $permid, $permvalue)
{
return $this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
$this->getParent()->channelClientPermAssign($this->getId(), $cldbid, $permid, $permvalue);
}
/**
@@ -196,7 +196,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function clientPermAssignByName($cldbid, $permname, $permvalue)
{
return $this->clientPermAssign($cldbid, $permname, $permvalue);
$this->clientPermAssign($cldbid, $permname, $permvalue);
}
/**
@@ -208,7 +208,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function clientPermRemove($cldbid, $permid)
{
return $this->getParent()->channelClientPermRemove($this->getId(), $cldbid, $permid);
$this->getParent()->channelClientPermRemove($this->getId(), $cldbid, $permid);
}
/**
@@ -218,7 +218,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function clientPermRemoveByName($cldbid, $permname)
{
return $this->clientPermRemove($cldbid, $permname);
$this->clientPermRemove($cldbid, $permname);
}
/**
@@ -242,7 +242,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function permAssign($permid, $permvalue)
{
return $this->getParent()->channelPermAssign($this->getId(), $permid, $permvalue);
$this->getParent()->channelPermAssign($this->getId(), $permid, $permvalue);
}
/**
@@ -252,7 +252,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function permAssignByName($permname, $permvalue)
{
return $this->permAssign($permname, $permvalue);
$this->permAssign($permname, $permvalue);
}
/**
@@ -263,7 +263,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function permRemove($permid)
{
return $this->getParent()->channelPermRemove($this->getId(), $permid);
$this->getParent()->channelPermRemove($this->getId(), $permid);
}
/**
@@ -273,7 +273,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function permRemoveByName($permname)
{
return $this->permRemove($permname);
$this->permRemove($permname);
}
/**
@@ -282,7 +282,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
* @param string $cpw
* @param string $path
* @param boolean $recursive
* @return void
* @return array
*/
public function fileList($cpw = "", $path = "/", $recursive = FALSE)
{
@@ -314,7 +314,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function fileRename($cpw = "", $oldname = "/", $newname = "/", $tcid = null, $tcpw = null)
{
return $this->getParent()->channelFileRename($this->getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
$this->getParent()->channelFileRename($this->getId(), $cpw, $oldname, $newname, $tcid, $tcpw);
}
/**
@@ -326,7 +326,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function fileDelete($cpw = "", $name = "/")
{
return $this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
$this->getParent()->channelFileDelete($this->getId(), $cpw, $name);
}
/**
@@ -338,7 +338,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
*/
public function dirCreate($cpw = "", $dirname = "/")
{
return $this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
$this->getParent()->channelDirCreate($this->getId(), $cpw, $dirname);
}
/**
@@ -401,7 +401,7 @@ class TeamSpeak3_Node_Channel extends TeamSpeak3_Node_Abstract
if($this->iconIsLocal("channel_icon_id") || $this["channel_icon_id"] == 0) return;
$download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("channel_icon_id"));
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Channelgroup.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Channelgroup.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -61,7 +61,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
*/
public function rename($name)
{
return $this->getParent()->channelGroupRename($this->getId(), $name);
$this->getParent()->channelGroupRename($this->getId(), $name);
}
/**
@@ -112,7 +112,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
*/
public function permAssign($permid, $permvalue)
{
return $this->getParent()->channelGroupPermAssign($this->getId(), $permid, $permvalue);
$this->getParent()->channelGroupPermAssign($this->getId(), $permid, $permvalue);
}
/**
@@ -122,7 +122,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
*/
public function permAssignByName($permname, $permvalue)
{
return $this->permAssign($permname, $permvalue);
$this->permAssign($permname, $permvalue);
}
/**
@@ -134,7 +134,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
*/
public function permRemove($permid)
{
return $this->getParent()->channelGroupPermRemove($this->getId(), $permid);
$this->getParent()->channelGroupPermRemove($this->getId(), $permid);
}
/**
@@ -144,7 +144,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
*/
public function permRemoveByName($permname)
{
return $this->permRemove($permname);
$this->permRemove($permname);
}
/**
@@ -212,7 +212,7 @@ class TeamSpeak3_Node_Channelgroup extends TeamSpeak3_Node_Abstract
if($this->iconIsLocal("iconid") || $this["iconid"] == 0) return;
$download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("iconid"));
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Client.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Client.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -75,7 +75,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function modifyDb(array $properties)
{
return $this->getParent()->clientModifyDb($this["client_database_id"], $properties);
$this->getParent()->clientModifyDb($this["client_database_id"], $properties);
}
/**
@@ -85,7 +85,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function deleteDb()
{
return $this->getParent()->clientDeleteDb($this["client_database_id"]);
$this->getParent()->clientDeleteDb($this["client_database_id"]);
}
/**
@@ -118,7 +118,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function move($cid, $cpw = null)
{
return $this->getParent()->clientMove($this->getId(), $cid, $cpw);
$this->getParent()->clientMove($this->getId(), $cid, $cpw);
}
/**
@@ -130,7 +130,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function kick($reasonid = TeamSpeak3::KICK_CHANNEL, $reasonmsg = null)
{
return $this->getParent()->clientKick($this->getId(), $reasonid, $reasonmsg);
$this->getParent()->clientKick($this->getId(), $reasonid, $reasonmsg);
}
/**
@@ -141,7 +141,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function poke($msg)
{
return $this->getParent()->clientPoke($this->getId(), $msg);
$this->getParent()->clientPoke($this->getId(), $msg);
}
/**
@@ -200,7 +200,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function permAssign($permid, $permvalue, $permskip = FALSE)
{
return $this->getParent()->clientPermAssign($this["client_database_id"], $permid, $permvalue, $permskip);
$this->getParent()->clientPermAssign($this["client_database_id"], $permid, $permvalue, $permskip);
}
/**
@@ -210,7 +210,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function permAssignByName($permname, $permvalue, $permskip = FALSE)
{
return $this->permAssign($permname, $permvalue, $permskip);
$this->permAssign($permname, $permvalue, $permskip);
}
/**
@@ -221,7 +221,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function permRemove($permid)
{
return $this->getParent()->clientPermRemove($this["client_database_id"], $permid);
$this->getParent()->clientPermRemove($this["client_database_id"], $permid);
}
/**
@@ -231,7 +231,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function permRemoveByName($permname)
{
return $this->permRemove($permname);
$this->permRemove($permname);
}
/**
@@ -243,7 +243,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function setChannelGroup($cid, $cgid)
{
return $this->getParent()->clientSetChannelGroup($this["client_database_id"], $cid, $cgid);
$this->getParent()->clientSetChannelGroup($this["client_database_id"], $cid, $cgid);
}
/**
@@ -254,7 +254,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function addServerGroup($sgid)
{
return $this->getParent()->serverGroupClientAdd($sgid, $this["client_database_id"]);
$this->getParent()->serverGroupClientAdd($sgid, $this["client_database_id"]);
}
/**
@@ -265,7 +265,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
public function remServerGroup($sgid)
{
return $this->getParent()->serverGroupClientDel($sgid, $this["client_database_id"]);
$this->getParent()->serverGroupClientDel($sgid, $this["client_database_id"]);
}
/**
@@ -288,7 +288,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
if($this["client_flag_avatar"]->toString() == 0) return;
$download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->avatarGetName());
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}
@@ -340,7 +340,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
if($this->iconIsLocal("client_icon_id") || $this["client_icon_id"] == 0) return;
$download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("client_icon_id"));
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}
@@ -362,7 +362,7 @@ class TeamSpeak3_Node_Client extends TeamSpeak3_Node_Abstract
*/
protected function fetchNodeInfo()
{
if($this["client_type"] == 1) return;
if($this->offsetExists("client_type") && $this["client_type"] == 1) return;
$this->nodeInfo = array_merge($this->nodeInfo, $this->execute("clientinfo", array("clid" => $this->getId()))->toList());
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Host.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Host.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -125,7 +125,7 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract
$this->version = $this->request("version")->toList();
}
return ($ident && array_key_exists($ident, $this->version)) ? $this->version[$ident] : $this->version;
return ($ident && isset($this->version[$ident])) ? $this->version[$ident] : $this->version;
}
/**
@@ -467,9 +467,9 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract
*
* @return array
*/
public function bindingList()
public function bindingList($subsystem = "voice")
{
return $this->request("bindinglist")->toArray();
return $this->execute("bindinglist", array("subsystem" => $subsystem))->toArray();
}
/**
@@ -906,7 +906,7 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract
{
$this->whoami();
$this->whoami[$ident] = (is_numeric($value)) ? intval($value) : TeamSpeak3_Helper_String::factory($value);
$this->whoami[$ident] = (is_numeric($value)) ? (int) $value : TeamSpeak3_Helper_String::factory($value);
}
/**
@@ -1175,8 +1175,17 @@ class TeamSpeak3_Node_Host extends TeamSpeak3_Node_Abstract
{
$func = array_shift($server);
$args = array_shift($server);
call_user_func_array(array($this, $func), $args);
try
{
call_user_func_array(array($this, $func), $args);
}
catch(Exception $e)
{
$class = get_class($e);
throw new $class($e->getMessage(), $e->getCode());
}
}
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Server.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Server.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -159,7 +159,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
$cid = $this->execute("channelcreate", $properties)->toList();
$this->channelListReset();
if(!isset($properties["client_flag_permanent"]) && !isset($properties["client_flag_semi_permanent"]))
if(!isset($properties["channel_flag_permanent"]) && !isset($properties["channel_flag_semi_permanent"]))
{
$this->getParent()->whoamiSet("client_channel_id", $cid["cid"]);
}
@@ -1753,7 +1753,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
if($this->iconIsLocal("virtualserver_icon_id") || $this["virtualserver_icon_id"] == 0) return;
$download = $this->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("virtualserver_icon_id"));
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}
@@ -1770,7 +1770,7 @@ class TeamSpeak3_Node_Server extends TeamSpeak3_Node_Abstract
$size = strlen($data);
$upload = $this->transferInitUpload(rand(0x0000, 0xFFFF), 0, "/icon_" . $crc, $size);
$transfer = TeamSpeak3::factory("filetransfer://" . $upload["host"] . ":" . $upload["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($upload["host"], ":") !== FALSE ? "[" . $upload["host"] . "]" : $upload["host"]) . ":" . $upload["port"]);
$transfer->upload($upload["ftkey"], $upload["seekpos"], $data);

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Servergroup.php 10/11/2013 11:35:21 scp@orilla $
* $Id: Servergroup.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -61,7 +61,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function rename($name)
{
return $this->getParent()->serverGroupRename($this->getId(), $name);
$this->getParent()->serverGroupRename($this->getId(), $name);
}
/**
@@ -114,7 +114,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function permAssign($permid, $permvalue, $permnegated = FALSE, $permskip = FALSE)
{
return $this->getParent()->serverGroupPermAssign($this->getId(), $permid, $permvalue, $permnegated, $permskip);
$this->getParent()->serverGroupPermAssign($this->getId(), $permid, $permvalue, $permnegated, $permskip);
}
/**
@@ -124,7 +124,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function permAssignByName($permname, $permvalue, $permnegated = FALSE, $permskip = FALSE)
{
return $this->permAssign($permname, $permvalue, $permnegated, $permskip);
$this->permAssign($permname, $permvalue, $permnegated, $permskip);
}
/**
@@ -136,7 +136,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function permRemove($permid)
{
return $this->getParent()->serverGroupPermRemove($this->getId(), $permid);
$this->getParent()->serverGroupPermRemove($this->getId(), $permid);
}
/**
@@ -146,7 +146,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function permRemoveByName($permname)
{
return $this->permRemove($permname);
$this->permRemove($permname);
}
/**
@@ -168,7 +168,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function clientAdd($cldbid)
{
return $this->getParent()->serverGroupClientAdd($this->getId(), $cldbid);
$this->getParent()->serverGroupClientAdd($this->getId(), $cldbid);
}
/**
@@ -179,7 +179,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
*/
public function clientDel($cldbid)
{
return $this->getParent()->serverGroupClientDel($this->getId(), $cldbid);
$this->getParent()->serverGroupClientDel($this->getId(), $cldbid);
}
/**
@@ -236,7 +236,7 @@ class TeamSpeak3_Node_Servergroup extends TeamSpeak3_Node_Abstract
if($this->iconIsLocal("iconid") || $this["iconid"] == 0) return;
$download = $this->getParent()->transferInitDownload(rand(0x0000, 0xFFFF), 0, $this->iconGetName("iconid"));
$transfer = TeamSpeak3::factory("filetransfer://" . $download["host"] . ":" . $download["port"]);
$transfer = TeamSpeak3::factory("filetransfer://" . (strstr($download["host"], ":") !== FALSE ? "[" . $download["host"] . "]" : $download["host"]) . ":" . $download["port"]);
return $transfer->download($download["ftkey"], $download["size"]);
}

File diff suppressed because one or more lines are too long

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Abstract.php 10/11/2013 11:35:22 scp@orilla $
* $Id: Abstract.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -186,7 +186,7 @@ abstract class TeamSpeak3_Transport_Abstract
*/
public function setAdapter(TeamSpeak3_Adapter_Abstract $adapter)
{
$this->adapter = $adapter;
$this->adapter = get_class($adapter);
}
/**
@@ -208,7 +208,7 @@ abstract class TeamSpeak3_Transport_Abstract
{
if($this->adapter instanceof TeamSpeak3_Adapter_Abstract)
{
$string = TeamSpeak3_Helper_String::factory(get_class($this->adapter));
$string = TeamSpeak3_Helper_String::factory($this->adapter);
return $string->substr($string->findLast("_"))->replace(array("_", " "), "")->toString();
}
@@ -253,7 +253,8 @@ abstract class TeamSpeak3_Transport_Abstract
{
if(!$this->isConnected() || $this->config["blocking"]) return;
do {
do
{
$read = array($this->stream);
$null = null;
@@ -263,6 +264,7 @@ abstract class TeamSpeak3_Transport_Abstract
}
$time = $time+$this->config["timeout"];
} while(@stream_select($read, $null, $null, $this->config["timeout"]) == 0);
}
while(@stream_select($read, $null, $null, $this->config["timeout"]) == 0);
}
}

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: Exception.php 10/11/2013 11:35:22 scp@orilla $
* $Id: Exception.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: TCP.php 10/11/2013 11:35:22 scp@orilla $
* $Id: TCP.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -44,8 +44,8 @@ class TeamSpeak3_Transport_TCP extends TeamSpeak3_Transport_Abstract
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$address = "tcp://" . $host . ":" . $port;
$timeout = intval($this->config["timeout"]);
$address = "tcp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$timeout = (int) $this->config["timeout"];
$this->stream = @stream_socket_client($address, $errno, $errstr, $timeout);

View File

@@ -4,7 +4,7 @@
* @file
* TeamSpeak 3 PHP Framework
*
* $Id: UDP.php 10/11/2013 11:35:22 scp@orilla $
* $Id: UDP.php 06/06/2016 22:27:13 scp@Svens-iMac $
*
* 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
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package TeamSpeak3
* @version 1.1.23
* @version 1.1.24
* @author Sven 'ScP' Paulsen
* @copyright Copyright (c) 2010 by Planet TeamSpeak. All rights reserved.
*/
@@ -44,8 +44,8 @@ class TeamSpeak3_Transport_UDP extends TeamSpeak3_Transport_Abstract
$host = strval($this->config["host"]);
$port = strval($this->config["port"]);
$address = "udp://" . $host . ":" . $port;
$timeout = intval($this->config["timeout"]);
$address = "udp://" . (strstr($host, ":") !== FALSE ? "[" . $host . "]" : $host) . ":" . $port;
$timeout = (int) $this->config["timeout"];
$this->stream = @stream_socket_client($address, $errno, $errstr, $timeout);