diff --git a/src/build/compile.sh b/src/build/compile.sh index 13b9d2514..f2d6e04e2 100755 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -11,7 +11,7 @@ PHPNCURSES_VERSION="1.0.2" PTHREADS_VERSION="2.0.4" PHP_POCKETMINE_VERSION="0.0.4" UOPZ_VERSION="2.0.3" -WEAKREF_VERSION="0.2.2" +WEAKREF_VERSION="0.2.4" PHPYAML_VERSION="1.1.1" YAML_VERSION="0.1.4" LIBXML_VERSION="2.9.1" @@ -527,11 +527,11 @@ fi #mv uopz-$UOPZ_VERSION "$DIR/install_data/php/ext/uopz" #echo " done!" -#WeakRef -#echo -n "[PHP WeakRef] downloading $WEAKREF_VERSION..." -#download_file "http://pecl.php.net/get/Weakref-$WEAKREF_VERSION.tgz" | tar -zx >> "$DIR/install.log" 2>&1 -#mv Weakref-$WEAKREF_VERSION "$DIR/install_data/php/ext/weakref" -#echo " done!" +WeakRef +echo -n "[PHP Weakref] downloading $WEAKREF_VERSION..." +download_file "http://pecl.php.net/get/Weakref-$WEAKREF_VERSION.tgz" | tar -zx >> "$DIR/install.log" 2>&1 +mv Weakref-$WEAKREF_VERSION "$DIR/install_data/php/ext/weakref" +echo " done!" #PHP YAML echo -n "[PHP YAML] downloading $PHPYAML_VERSION..." diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index e8d0d80e2..10cd3b4ef 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -333,11 +333,16 @@ namespace pocketmine { console("[ERROR] You have the native PocketMine extension, but your version is lower than 0.0.1.", true, true, 0); ++$errors; }elseif(version_compare(phpversion("pocketmine"), "0.0.4") > 0){ - console("[ERROR] You have the native PocketMine extension, but your version is lower than 0.0.4.", true, true, 0); + console("[ERROR] You have the native PocketMine extension, but your version is higher than 0.0.4.", true, true, 0); ++$errors; } } + if(!extension_loaded("Weakref") and !extension_loaded("weakref")){ + console("[ERROR] Unable to find the Weakref extension.", true, true, 0); + ++$errors; + } + if(!extension_loaded("curl")){ console("[ERROR] Unable to find the cURL extension.", true, true, 0); ++$errors; diff --git a/src/stubs/weakref.php b/src/stubs/weakref.php new file mode 100644 index 000000000..b53b50abd --- /dev/null +++ b/src/stubs/weakref.php @@ -0,0 +1,127 @@ +