Dylan K. Taylor
342b48b758
VersionString: Use the correct bitwise operators
2019-04-12 18:32:15 +01:00
Dylan K. Taylor
8c19f6cac8
EnumTrait: throw InvalidArgumentException from fromString()
...
this is more in line with expected behaviour, since this might be used to process arbitrary user input. Only calling an undefined magic static method should throw an Error.
2019-03-31 16:07:42 +01:00
Dylan K. Taylor
1fd4077907
MainLogger: Always use CRITICAL for logException()
2019-03-29 15:28:11 +00:00
Dylan K. Taylor
2091354927
UUID: add type docs
2019-03-27 15:39:41 +00:00
Dylan K. Taylor
d8c81c0a11
UUID: remove useless default values
...
these are overwritten by the constructor, so they have no use here.
2019-03-27 15:39:06 +00:00
Dylan K. Taylor
23071d257e
Extract process-related functions from Utils into a separate Process class
2019-03-24 18:57:32 +00:00
Dylan K. Taylor
1ea5316a37
Whose idea was it to make this public...
2019-03-24 18:38:26 +00:00
Dylan K. Taylor
01904adf49
Improve enum implementations, move some components to traits
...
The reason this uses a trait is because `self` refers to the including class in a trait, which offers a small amount of automatic type safety.
If we had templates or generics, this would be a generic class instead.
2019-03-13 15:10:31 +00:00
Dylan K. Taylor
f5dbbea5f5
Utils: added recursiveUnlink()
2019-03-03 17:39:23 +00:00
Dylan K. Taylor
6c8fa8ae28
More nullable and void typehints
2019-03-02 10:29:11 +00:00
Dylan K. Taylor
c26544475e
More PHP 7.1 nullables
2019-02-22 12:55:34 +00:00
Dylan K. Taylor
d9bbe99b83
Merge branch '3.6'
2019-02-14 17:25:21 +00:00
Dylan K. Taylor
6f36fa504b
TextFormat: make clean() less confusing, deduplicate some regex
2019-02-14 16:52:39 +00:00
Dylan K. Taylor
6424dc9c82
Merge branch '3.6'
2019-02-14 16:04:32 +00:00
Dylan K. Taylor
c433fad0a7
another /u modifier
2019-02-14 13:50:56 +00:00
Jack M. Taylor
205e13d880
Config: add getPath() ( #2758 )
...
Config->getPath() returns the path of the config i.e. the place where the config file is located.
2019-02-14 10:58:19 +00:00
Dylan K. Taylor
8fad5a6e30
TextFormat: use mb_scrub() in clean()
...
this redacts invalid characters to prevent them appearing in places that might break the client.
2019-02-13 20:01:36 +00:00
Dylan K. Taylor
7a6f279825
TextFormat: fixed clean() not being unicode-aware
2019-02-13 17:06:44 +00:00
Dylan K. Taylor
b7973ef782
Merge branch '3.5'
2019-02-05 16:58:34 +00:00
Dylan K. Taylor
5da48f429f
Fixed some remaining one-line field declarations, added type docs
2019-02-05 14:03:27 +00:00
Dylan K. Taylor
d23e32622e
Clean up internal inconsistency in Color
2019-02-05 13:52:34 +00:00
Dylan K. Taylor
b6ecab1d49
Merge remote-tracking branch 'origin/3.5'
2019-01-29 12:53:38 +00:00
Dylan T
71d17c50d6
Fixed internal IP detection ( #2711 ), closes #2702
2019-01-29 12:51:53 +00:00
Dylan K. Taylor
519f6e2668
Merge branch '3.5'
2019-01-26 12:08:21 +00:00
Dylan K. Taylor
c83b7d9b69
Utils: fixed getNiceClosureName() not processing namespaced closures properly
2019-01-26 12:08:07 +00:00
Dylan K. Taylor
bbc8bc4df5
Move some error handling stuff to SPL
2019-01-17 19:16:03 +00:00
Dylan K. Taylor
1f54760dae
Config: Make load() private
2019-01-10 18:03:15 +00:00
Dylan K. Taylor
b9ce6537a8
Sync composer dependencies (master)
2019-01-09 00:22:42 +00:00
Dylan K. Taylor
4f50119b74
LoginPacket: Cater for more error cases
...
This now doesn't crash unexpectedly at the first sign of broken data.
2019-01-07 14:45:44 +00:00
Dylan K. Taylor
3380aa3ac2
Config: Assert only whitespace precedes .properties key, fixes #commented properties not being skipped
2019-01-07 12:25:05 +00:00
Dylan K. Taylor
3ae722867c
Merge branch '3.5'
2019-01-06 20:19:18 +00:00
Dylan K. Taylor
2cdf97b7b5
CrashDump: Scan full stack trace to determine plugin involvement
2019-01-06 18:07:29 +00:00
Dylan K. Taylor
adc1069ed2
Merge branch '3.5'
2019-01-04 23:28:44 +00:00
Dylan K. Taylor
4b9a142a5d
Import global functions and constants for enhanced performance
...
This is better for performance because these then don't need to be reevaluated every time they are called.
When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.
However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
Dylan K. Taylor
e1064a9e36
Merge branch '3.5'
2019-01-04 00:37:48 +00:00
Dylan K. Taylor
d71a543d10
Fixed a bunch of things PHPStan finds unpalatable
...
close #2614 , fix a bunch of docs bugs, fix sendCreativeContents() crash on Human holders, move some inline variable declarations
2019-01-04 00:23:09 +00:00
Dylan K. Taylor
aaaddd1fd6
Terminal: stick a RESET on the end when writing a newline
2018-12-29 11:54:44 +00:00
Dylan K. Taylor
d86107e22a
Terminal: Added write() and writeLine() to allow easily emitting Minecraft-formatted text to the console
2018-12-29 11:28:25 +00:00
Dylan K. Taylor
498bffb34f
Fixed --enable-ansi and --disable-ansi not being respected on threads
...
this causes some breakage to the behaviour of Terminal, and for that reason this is going on 4.0.
Terminal::hasFormattingCodes() will no longer auto-detect whether colour codes are supported.
2018-12-29 11:23:32 +00:00
Dylan K. Taylor
e5cb48bec2
Merge branch 'release/3.5'
2018-12-22 13:31:18 +00:00
Dylan K. Taylor
1455c38dbe
Utils: fixed crash in getCoreCount(), closes #2600
...
this should just default to 2 instead of shitting its pants.
2018-12-22 13:27:11 +00:00
Dylan K. Taylor
a2e4fdc8a2
Merge branch 'release/3.5'
2018-12-20 20:02:16 +00:00
Dylan K. Taylor
34a899e28b
Clean up Utils error handling functions (internal)
2018-12-16 17:50:00 +00:00
Dylan K. Taylor
b80868040e
Utils: fixed getTrace() including itself in trace when no alt trace is given
...
it always seemed a little strange that crashdump trace would pop 4 frames when only 3 are written in the comment...
2018-12-16 17:15:16 +00:00
Dylan K. Taylor
05e968d9fd
Merge branch 'release/3.4'
2018-12-04 18:40:54 +00:00
Dylan K. Taylor
762405d16a
Add daverandom/callback-validator as a dependency
2018-12-04 17:14:37 +00:00
Dylan K. Taylor
b0060caaf7
Config: don't catch-all in save()
2018-11-25 16:35:59 +00:00
Dylan K. Taylor
3031128520
Merge branch 'release/3.4'
2018-11-11 19:52:05 +00:00
Dylan K. Taylor
788b278fc3
Utils: fixed handling of non-anonymous closure functions
2018-11-11 19:43:00 +00:00
Dylan K. Taylor
67a5f3f557
Register MainLogger as SPL global, remove hard MainLogger dependency from many areas, break a bunch of cyclic dependencies
2018-11-05 19:01:59 +00:00