mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-13 15:05:33 +00:00
Merge branch 'php/7.0' into mcpe-1.2
This commit is contained in:
commit
10b765e17a
@ -5,7 +5,6 @@ php:
|
||||
|
||||
before_script:
|
||||
- pecl install channel://pecl.php.net/pthreads-3.1.6
|
||||
- pecl install channel://pecl.php.net/weakref-0.3.3
|
||||
- echo | pecl install channel://pecl.php.net/yaml-2.0.0
|
||||
|
||||
script:
|
||||
|
@ -120,22 +120,21 @@ namespace pocketmine {
|
||||
if(\Phar::running(true) !== ""){
|
||||
define('pocketmine\PATH', \Phar::running(true) . "/");
|
||||
}else{
|
||||
define('pocketmine\PATH', realpath(getcwd()) . DIRECTORY_SEPARATOR);
|
||||
define('pocketmine\PATH', dirname(__FILE__, 3) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
$requiredSplVer = "0.0.1";
|
||||
if(!is_file(\pocketmine\PATH . "src/spl/version.php") or version_compare($requiredSplVer, require(\pocketmine\PATH . "src/spl/version.php")) > 0){
|
||||
if(!is_file(\pocketmine\PATH . "src/spl/version.php")){
|
||||
echo "[CRITICAL] Cannot find PocketMine-SPL or incompatible version." . PHP_EOL;
|
||||
echo "[CRITICAL] Please update your submodules or use provided builds." . PHP_EOL;
|
||||
exit(1);
|
||||
}elseif(version_compare($requiredSplVer, require(\pocketmine\PATH . "src/spl/version.php")) > 0){
|
||||
echo "[CRITICAL] Incompatible PocketMine-SPL submodule version ($requiredSplVer is required)." . PHP_EOL;
|
||||
echo "[CRITICAL] Please update your submodules or use provided builds." . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(!class_exists("ClassLoader", false)){
|
||||
if(!is_file(\pocketmine\PATH . "src/spl/ClassLoader.php")){
|
||||
echo "[CRITICAL] Unable to find the PocketMine-SPL library." . PHP_EOL;
|
||||
echo "[CRITICAL] Please use provided builds or clone the repository recursively." . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
require_once(\pocketmine\PATH . "src/spl/ClassLoader.php");
|
||||
require_once(\pocketmine\PATH . "src/spl/BaseClassLoader.php");
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4ade26741e8050de196e4c12af01b8b42e76e6e7
|
||||
Subproject commit bfae42ce8985204b0db276d0b8daed7050567323
|
@ -18,23 +18,25 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
rm server.log 2> /dev/null
|
||||
mkdir -p ./plugins
|
||||
rm PocketMine-MP.phar 2> /dev/null
|
||||
|
||||
cp -r tests/plugins/PocketMine-DevTools ./plugins
|
||||
cd tests/plugins/PocketMine-DevTools
|
||||
"$PHP_BINARY" -dphar.readonly=0 ./src/DevTools/ConsoleScript.php --make ./ --relative ./ --out ../../../DevTools.phar
|
||||
cd ../../..
|
||||
|
||||
"$PHP_BINARY" ./plugins/PocketMine-DevTools/src/DevTools/ConsoleScript.php --make ./plugins/PocketMine-DevTools --relative ./plugins/PocketMine-DevTools --out ./plugins/DevTools.phar
|
||||
rm -rf ./plugins/PocketMine-DevTools
|
||||
|
||||
echo -e "version\nmakeserver\nstop\n" | "$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
|
||||
if ls plugins/DevTools/PocketMine*.phar >/dev/null 2>&1; then
|
||||
echo Server phar created successfully.
|
||||
"$PHP_BINARY" -dphar.readonly=0 DevTools.phar --make src --relative ./ --entry src/pocketmine/PocketMine.php --out PocketMine-MP.phar
|
||||
if [ -f PocketMine-MP.phar ]; then
|
||||
echo Server phar created successfully.
|
||||
else
|
||||
echo No phar created!
|
||||
exit 1
|
||||
echo Server phar was not created!
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
mkdir plugins 2> /dev/null
|
||||
mv DevTools.phar plugins
|
||||
cp -r tests/plugins/PocketMine-TesterPlugin ./plugins
|
||||
echo -e "stop\n" | "$PHP_BINARY" src/pocketmine/PocketMine.php --no-wizard --disable-ansi --disable-readline --debug.level=2
|
||||
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2
|
||||
|
||||
output=$(grep '\[TesterPlugin\]' server.log)
|
||||
if [ "$output" == "" ]; then
|
||||
@ -44,9 +46,12 @@ fi
|
||||
|
||||
result=$(echo "$output" | grep 'Finished' | grep -v 'PASS')
|
||||
if [ "$result" != "" ]; then
|
||||
echo "$result"
|
||||
echo Some tests did not complete successfully, changing build status to failed
|
||||
exit 1
|
||||
echo "$result"
|
||||
echo Some tests did not complete successfully, changing build status to failed
|
||||
exit 1
|
||||
elif [ $(grep -c "ERROR\|CRITICAL\|EMERGENCY" server.log) -ne 0 ]; then
|
||||
echo Server log contains error messages, changing build status to failed
|
||||
exit 1
|
||||
else
|
||||
echo All tests passed
|
||||
echo All tests passed
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user