85 Commits

Author SHA1 Message Date
Dylan K. Taylor
9b03b082ab
Added --version option 2024-01-09 13:04:14 +00:00
Ayesh Karunaratne
db3bb55a2b
Change PHP_DEBUG constant usage to ZEND_DEBUG_BUILD
In PHP 8.4, the type of `PHP_DEBUG` changes from `int` to `bool`.
See [PHP.Watch: PHP 8.4: `PHP_ZTS` and `PHP_DEBUG` constant value type changed from `int` to `bool`](https://php.watch/versions/8.4/PHP_ZTS-PHP_DEBUG-const-type-change).

This changes the constants to `ZEND_DEBUG_BUILD`, which contains the same value but as a `bool` across all PHP versions.

closes #6222
2024-01-09 12:30:24 +00:00
Dylan K. Taylor
50592dc269
Merge branch 'stable' into minor-next 2023-11-09 18:05:38 +00:00
Dylan K. Taylor
e3700cab50
ZlibCompressor: use libdeflate for level 0 compression
this is supported since libdeflate 1.15 and ext-libdeflate 0.2.0.
Everyone should be using these versions by now anyway, and if they aren't, they should update.

libdeflate's level 0 compression is over 20 times faster than zlib, so this is a nice performance improvement.
2023-11-09 18:05:07 +00:00
Dylan K. Taylor
d3b7861d1a
Constify bootstrap options 2023-11-02 16:15:57 +00:00
Dylan K. Taylor
9c1ab943bc
Bump ext-pmmpthread min version to 6.0.7 2023-08-08 17:43:31 +01:00
Dylan K. Taylor
9ef835c82d
Merge remote-tracking branch 'origin/legacy/pm4' into stable 2023-07-21 11:07:32 +01:00
Dylan K. Taylor
9b43ddecbd
Drop usages of Process:kill() with subprocesses parameter
we don't need this any more with console reader improvements, and this was not working correctly anyway.

closes #5234
2023-07-20 17:10:39 +01:00
Dylan K. Taylor
0240d35c05
AsyncTask and AsyncPool no longer tolerate uncaught errors in tasks
Since task execution depends on tasks executing sequentially on a particular worker in some cases (e.g. PopulationTask must be preceded by GeneratorRegisterTask), it doesn't make sense to continue task execution if an error occurs.
Moreover, a task crashing may render the whole server unstable, as it leaves the server in an undefined state. This is the same kind of problem we fixed with scheduled tasks in PM3.

In versions past, pthreads was unreliable enough that random tasks would crash without an obvious reason, forcing us to accommodate this. I still don't know the origin or frequency of said issues, but I think it's time to rip the band-aid off and solve these problems for real.
2023-06-22 13:29:36 +01:00
Dylan K. Taylor
af1f7e098b
Require pmmpthread 6.0.1 2023-06-03 21:42:43 +01:00
Dylan K. Taylor
4aba9d9725
Absorb pocketmine/classloader into the core code
the only use for this class is to facilitate random runtime plugin loading, and it's not complete even for that purpose.

Since nothing but PM uses pocketmine/classloader anyway, it doesn't make sense to have it outside the core. As with LogPthreads, it's just adding more maintenance work.
2023-05-22 22:52:48 +01:00
Dylan K. Taylor
3116fb8187
... 2023-05-20 01:47:50 +01:00
Dylan K. Taylor
e0630fbb25
pmmpthread support 2023-05-20 01:29:26 +01:00
Dylan K. Taylor
ee9ce8a4f4
Merge branch 'minor-next' into major-next 2023-05-17 15:45:03 +01:00
Dylan K. Taylor
c7dff9ea40
bootstrap: remove ext-parallel bootstrapping code
I have no intention of using parallel, so this code is not necessary.
2023-05-17 14:11:43 +01:00
Dylan K. Taylor
043350753b
Drop PHP 8.0, 8.1 is now minimum version 2023-05-17 13:53:57 +01:00
Dylan K. Taylor
222415859a
Require pthreads ^5.1
This version of pthreads has a substantially improved API, improved
performance, improved memory usage, and much less magical and broken
behaviour.
2023-01-23 20:02:33 +00:00
Dylan K. Taylor
f948cb0086
PocketMine.php: refuse pthreads 5.0 2023-01-21 15:30:36 +00:00
Dylan K. Taylor
8bf85d4a18
bootstrap: avoid using is_writable() to check for data directory access permissions
closes #5440
2022-12-06 14:13:37 +00:00
Dylan K. Taylor
a3306914cc
bootstrap: do not require the plugins dir to be writable
on a modern installation, the plugins folder does not need to be writable by the server. Perhaps DevTools should be checking this for /genplugin, but it's not required otherwise.
2022-12-06 13:58:50 +00:00
Dylan K. Taylor
c19880e045
bootstrap: fix PHPStan error 2022-11-04 20:50:27 +00:00
Dylan K. Taylor
9a0ead6deb
Validate paths in --data and --plugins
closes #2861
2022-10-21 14:28:22 +01:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
f39d2a9be3
bootstrap: update JIT warning 2022-09-20 14:43:05 +01:00
Dylan K. Taylor
1b852ac290
bootstrap: do not complain about xdebug if mode is 'off'
if xdebug.mode=off, the performance impact is the same as if xdebug wasn't loaded.
2022-08-19 16:45:40 +01:00
Dylan K. Taylor
4e956d5d1d
Replace remaining disallowed operators 2022-01-20 19:23:19 +00:00
Dylan K. Taylor
a94b88424e
Merge branch 'stable' into next-minor 2021-12-10 19:15:57 +00:00
Dylan K. Taylor
0ace807756
Merge commit 'b081394125f90c14d6894b24e2edb32f3284b3a0' into stable 2021-12-08 23:59:51 +00:00
Dylan K. Taylor
889d048ca3
Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
Dylan K. Taylor
503c888838
bootstrap: use phpversion() for checking extension presence
fixes 2 PHPStan errors on level 7
2021-12-07 22:50:16 +00:00
Dylan T
cc4bb91fcb
Implemented IPv6 support (#4554) 2021-11-08 20:03:28 +00:00
Dylan K. Taylor
8c16ecaa5b
Merge branch 'stable' 2021-11-01 21:08:32 +00:00
Dylan K. Taylor
1c18c731ef
bootstrap: check for zlib raw support in leveldb 2021-10-29 19:15:12 +01:00
Dylan K. Taylor
dd0c2fed82
Process: add subprocess parameter to kill()
fix CommandReader subprocess lingering on a crash and fucking up the console
2021-10-02 16:56:24 +01:00
Dylan K. Taylor
54174eefa0
Make sure COMPOSER_AUTOLOADER_PATH is always declared
Sacrifice dynamic composer autoloader path to do this, because we don't
need it anyway - it was a misconceived feature from the days when I used
the same workspace for PM3 and PM4 both.
2021-10-02 15:27:17 +01:00
Dylan K. Taylor
11d2e1ef08
Require ext-chunkutils ^0.3.0 2021-09-07 22:53:50 +01:00
Dylan K. Taylor
c605b54591
Accept dev versions of chunkutils2 2021-09-07 22:52:00 +01:00
Dylan K. Taylor
b4b3c21d30
Merge branch 'stable' 2021-08-19 15:39:16 +01:00
Dylan K. Taylor
a012e7ccc0
VersionInfo: make static methods more constant-like
if we could have class constants declared at runtime, these would be constant.
2021-08-16 16:37:36 +01:00
Dylan K. Taylor
2b5667a56b
Move PHP minimum to 8.0 2021-07-26 20:29:39 +01:00
Dylan K. Taylor
e0a9fb6eac
Merge remote-tracking branch 'origin/stable' 2021-07-19 00:16:04 +01:00
Dylan T
32d7b1e6af
Start using webmozart/pathutil for joining paths (#4287) 2021-06-29 19:40:43 +01:00
Dylan K. Taylor
0d775f8731
Require ext-chunkutils2 at ^0.2.0 2021-03-23 22:23:17 +00:00
Dylan K. Taylor
c61f66d973
Removed ext-ds dependency 2021-02-11 15:40:37 +00:00
Dylan K. Taylor
169650dc5b
MainLogger: accept timezone as a constructor parameter
this makes it easier to unit-test, as well as making it independent of Timezone.
2021-02-04 21:50:06 +00:00
Dylan K. Taylor
27b1951df7
MainLogger: accept main thread name as a constructor parameter 2021-02-04 20:55:50 +00:00
Dylan K. Taylor
709b4154d7
MainLogger: Require useFormattingCodes as a constructor parameter
this avoids needing to call Terminal::init() before starting a MainLogger. Since it inits the formatting codes anyway when log messages are first recorded, it shouldn't be necessary to pre-initialize it.
2021-02-04 19:16:22 +00:00
Dylan K. Taylor
ae75d73f48
Extract MainLoggerThread unit from MainLogger
MainLogger is no longer a Thread, as per the recent changes to pocketmine/log-pthreads.
2021-02-04 16:28:49 +00:00
Dylan K. Taylor
4c0d3d68af
Bump PHP requirement to 7.4.0 2021-01-12 21:53:41 +00:00
Dylan K. Taylor
d76883a5f8
Merge branch 'stable' 2020-12-29 18:00:09 +00:00