Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #145

Merged
merged 26 commits into from
May 18, 2020
Merged

Dev #145

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
198fb18
Icon Download extended function (#131)
Sensznet Nov 27, 2019
a080d3f
Fixing naming error (#135)
y4roc Nov 27, 2019
898d0b5
try to fix issue #136
svenpaulsen Feb 15, 2020
b8aee02
add -banners option to channellist
svenpaulsen Mar 4, 2020
4de02db
remove iconname argument
svenpaulsen Mar 4, 2020
fd074a3
add -keepfiles argument to snapshot deploy
svenpaulsen Mar 4, 2020
a62f774
update changelog
svenpaulsen Mar 4, 2020
f1cc4de
set release date for 1.1.34
svenpaulsen Mar 4, 2020
b14b8c8
Fixing deprecated curly braces for PHP 7.4+ (#142)
Fjonan Apr 10, 2020
9e987b6
removed another deprecated curly braces from string.php (#144)
Fjonan Apr 17, 2020
2135207
Merge branch 'master' into dev
Apr 21, 2020
6fb1527
* Added Travis CI build status icon to README
Apr 21, 2020
44a80e4
Travis CI misses PHP extension ssh2
Apr 21, 2020
d7e8b11
PHP extension ssh2 is still missing
Apr 21, 2020
743193e
PHP extension ssh2 is still missing
Apr 21, 2020
3c90132
Next attempt to install PHP extension ssh2
Apr 21, 2020
50f071f
PHP extension ssh2 still missing
Apr 21, 2020
7d07983
Trying to fix SSH2 extension installation
May 10, 2020
e0e4ffa
Changed order of travis config
May 10, 2020
bfa2671
Exposed ServerQuery SSH port
May 17, 2020
48e04c1
Switched from libssh to phpseclib
May 17, 2020
e310640
Moved installation of phpseclib
May 17, 2020
ac5ab3c
Changed requirement from PHP extension SSH to phpseclib
May 17, 2020
3800cf9
Fixed composer warning
May 17, 2020
4b3efac
#148: Fixed deprecated curly braces in PHP 7.4
May 17, 2020
24ab264
Updated composer packages
May 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@ php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- nightly

matrix:
include:
- php: 7.2
- php: 7.4
env: COVERAGE=yes
- php: 7.2
- php: 7.4
env: EXECUTE_CS_CHECK=yes
fast_finish: true
allow_failures:
- php: nightly
- php: 7.2
- php: 7.4
env: EXECUTE_CS_CHECK=yes

services:
Expand All @@ -33,18 +35,6 @@ cache:
- $HOME/.composer/cache
- $HOME/.php-cs-fixer

before_install:
- docker run -d --name="teamspeak_server" -p "9987:9987/udp" -p 10011:10011 -p 30033:30033 teamspeak:latest
- docker ps -a
- docker logs teamspeak_server
- if [[ $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PHP_VERSION != nightly && $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- travis_retry composer self-update

install:
- travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction

before_script:
- mkdir -p "$HOME/.php-cs-fixer"
- cp phpunit.xml.dist phpunit.xml
Expand All @@ -58,5 +48,21 @@ script:
- if [[ $EXECUTE_CS_CHECK == yes ]]; then php -n -d memory_limit=768M vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --dry-run; fi
- if [[ $COVERAGE == yes ]] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi

before_install:
- sudo apt-get install -y php-pear
- sudo pear channel-discover phpseclib.sourceforge.net
- sudo pear remote-list -c phpseclib
- sudo pear install phpseclib/Net_SSH2
- docker run -d --name="teamspeak_server" -p "9987:9987/udp" -p 10011:10011 -p 30033:30033 teamspeak:latest
- docker ps -a
- docker logs teamspeak_server
- if [[ $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PHP_VERSION != nightly && $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo 'opcache.enable_cli=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi
- travis_retry composer self-update

install:
- travis_retry composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction

after_success:
- travis_retry php vendor/bin/php-coveralls -v
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
! Important - Take note!
===============================================================================

=== Release 1.1.34 - WIP ===
=== Release 1.1.34 - 04 Mar 2020 ===
! upgrading your servers to 3.10.0 (build >= 1564054246) is mandatory
+ added optional -continueonerror argument to some commands
+ added optional -keepfiles argument to serversnapshotdeploy command
+ added optional -banners argument to channellist command
+ added pagination support for banlist commands
+ added management support for ServerQuery logins
* property client_nickname will now be set before selecting a virtual server
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TeamSpeak 3 PHP Framework

[![Build Status](https://travis-ci.org/planetteamspeak/ts3phpframework.svg?branch=master)](https://travis-ci.org/planetteamspeak/ts3phpframework)

Initially released in January 2010, the TS3 PHP Framework is a powerful, open source, object-oriented framework implemented in PHP 5 and licensed under the GNU General Public License. It’s based on simplicity and a rigorously tested agile codebase. Extend the functionality of your servers with scripts or create powerful web applications to manage all features of your TeamSpeak 3 Server instances.

Tested. Thoroughly. Enterprise-ready and built with agile methods, the TS3 PHP Framework has been unit-tested from the start to ensure that all code remains stable and easy for you to extend, re-test with your extensions, and further maintain.
Expand Down Expand Up @@ -28,7 +30,7 @@ Speed up new development and reduce maintenance costs by using this nifty piece

**Requirements**

* PHP - Developed on PHP 7.x, with 7.2.x targeted for testing.
* PHP - Developed on PHP 7.x, with 7.4.x targeted for testing.
* TeamSpeak Server - v3.4.0 (build >= 1536564584) or higher.

**Often used with...**
Expand All @@ -54,7 +56,7 @@ composer require planetteamspeak/ts3-php-framework:dev-master

### Tests

To run all tests use `php vendor/bin/phpunit`.
To run all tests use `composer run tests`.

### Useful Links

Expand Down Expand Up @@ -249,6 +251,10 @@ Setup a local test instance of TeamSpeak3 (amd64, Alpine Linux):
```
docker run --name teamspeak_server -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -e TS3SERVER_LICENSE=accept teamspeak:latest
```
Or simply start the predefined docker container `docker-compose.yml`:
```
docker-compose up
```
_Add `-d` flag to run in background. Options / Examples: [Docs @ Docker](https://docs.docker.com/samples/library/teamspeak/) | [Hub @ Docker](https://hub.docker.com/_/teamspeak/)_

Use full docker stack to deploy TeamSpeak 3 with Maria DB:
Expand Down
29 changes: 19 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,41 @@
"issues": "https://github.com/planetteamspeak/ts3phpframework/issues",
"docs": "https://docs.planetteamspeak.com/ts3/php/framework"
},
"config": {
"sort-packages": true
},
"require": {
"php": ">=5.6",
"ext-json": "*",
"ext-ctype": "*",
"ext-ssh2": "*",
"phpseclib/phpseclib": "^1.0",
"ext-openssl": "*"
},
"require-dev": {
"phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0",
"satooshi/php-coveralls": "^1.1 || ^2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"friendsofphp/php-cs-fixer": "^2.0.0",
"php-coveralls/php-coveralls": "^2.2",
"phpcompatibility/php-compatibility": "^8.2",
"phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0",
"react/socket": "^0.8.5",
"symfony/yaml": "~2.1|~3.0|~4.0",
"squizlabs/php_codesniffer": "^3.3",
"phpcompatibility/php-compatibility": "^8.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4"
"symfony/yaml": "~2.1|~3.0|~4.0"
},
"autoload": {
"psr-4": {
"PlanetTeamSpeak\\TeamSpeak3Framework\\": "src/",
"PlanetTeamSpeak\\TeamSpeak3Framework\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"PlanetTeamSpeak\\TeamSpeak3Framework\\Tests\\": "tests/"
}
},
"scripts": {
"compatibility": "./vendor/bin/phpcs -ps --basepath=. --standard=PHPCompatibility --runtime-set testVersion 5.2- src",
"test": "./vendor/bin/phpunit --no-coverage ./tests",
"coverage": "./vendor/bin/phpunit"
"compatibility": "\"vendor/bin/phpcs\" -ps --basepath=. --standard=PHPCompatibility --runtime-set testVersion 5.2- src",
"tests": [
"\"vendor/bin/phpunit\" --no-coverage"
],
"coverage": "\"vendor/bin/phpunit\""
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
ports:
- 9987:9987/udp
- 10011:10011
- 10022:10022
- 30033:30033
environment:
TS3SERVER_DB_PLUGIN: ts3db_mariadb
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Teamspeak 3 PHP Framework Test Suite">
Expand All @@ -18,7 +17,7 @@

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
<log type="junit" target="build/logs/junit.xml"/>
</logging>

<filter>
Expand Down
8 changes: 4 additions & 4 deletions src/Helper/Char.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,18 @@ public function toAscii()
*/
public function toUnicode()
{
$h = ord($this->char{0});
$h = ord($this->char[0]);

if ($h <= 0x7F) {
return $h;
} elseif ($h < 0xC2) {
return false;
} elseif ($h <= 0xDF) {
return ($h & 0x1F) << 6 | (ord($this->char{1}) & 0x3F);
return ($h & 0x1F) << 6 | (ord($this->char[1]) & 0x3F);
} elseif ($h <= 0xEF) {
return ($h & 0x0F) << 12 | (ord($this->char{1}) & 0x3F) << 6 | (ord($this->char{2}) & 0x3F);
return ($h & 0x0F) << 12 | (ord($this->char[1]) & 0x3F) << 6 | (ord($this->char[2]) & 0x3F);
} elseif ($h <= 0xF4) {
return ($h & 0x0F) << 18 | (ord($this->char{1}) & 0x3F) << 12 | (ord($this->char{2}) & 0x3F) << 6 | (ord($this->char{3}) & 0x3F);
return ($h & 0x0F) << 18 | (ord($this->char[1]) & 0x3F) << 12 | (ord($this->char[2]) & 0x3F) << 6 | (ord($this->char[3]) & 0x3F);
} else {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected function setSecretKey($passphrase)
for ($i = 0; $i < 18; $i++) {
$data = 0;
for ($j = 4; $j > 0; $j--) {
$data = $data << 8 | ord($passphrase{$k});
$data = $data << 8 | ord($passphrase[$k]);
$k = ($k + 1) % $length;
}
$this->p[$i] ^= $data;
Expand Down
6 changes: 3 additions & 3 deletions src/Helper/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ public function key()
*/
public function current()
{
return new Char($this->string{$this->position});
return new Char($this->string[$this->position]);
}

/**
Expand All @@ -907,7 +907,7 @@ public function offsetExists($offset)
*/
public function offsetGet($offset)
{
return ($this->offsetExists($offset)) ? new Char($this->string{$offset}) : null;
return ($this->offsetExists($offset)) ? new Char($this->string[$offset]) : null;
}

/**
Expand All @@ -919,7 +919,7 @@ public function offsetSet($offset, $value)
return;
}

$this->string{$offset} = strval($value);
$this->string[$offset] = strval($value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Node/Host.php
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public function permissionTree()
$permtree[$val]["permcatid"] = $val;
$permtree[$val]["permcathex"] = "0x" . dechex($val);
$permtree[$val]["permcatname"] = StringHelper::factory(Convert::permissionCategory($val));
$permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"]{3} == 0 ? 0 : hexdec($permtree[$val]["permcathex"]{2} . 0);
$permtree[$val]["permcatparent"] = $permtree[$val]["permcathex"][3] == 0 ? 0 : hexdec($permtree[$val]["permcathex"][2] . 0);
$permtree[$val]["permcatchilren"] = 0;
$permtree[$val]["permcatcount"] = 0;

Expand Down