40 Commits

Author SHA1 Message Date
Dylan K. Taylor
2b6dcbc2e2 BaseLang: fixed passing onlyPrefix to str_replace()'s count reference parameter 2020-06-22 20:34:23 +01:00
Dylan K. Taylor
e1a61cb51a BaseLang: get() never returns null 2020-02-05 20:38:45 +00:00
Dylan K. Taylor
fa82cb26d8 added native types to closures (phpstan-strict-rules) 2020-02-05 16:35:10 +00:00
Dylan K. Taylor
260ac47588 add some phpstan array types 2020-01-30 22:23:11 +00:00
Dylan K. Taylor
8bf469f7fc populate missing array value types in lang namespace 2020-01-30 20:55:03 +00:00
Dylan K. Taylor
c4793241f5 Mass removal of useless @param/@return PHPDoc annotations, pass 1 2020-01-21 15:10:18 +00:00
Dylan K. Taylor
0db7e57a15 lang: populate missing return type information 2020-01-19 17:04:25 +00:00
Dylan K. Taylor
77795ae3bc BaseLang::translateString() accepts float and int too (they can be casted to string) 2019-12-12 16:18:11 +00:00
Dylan K. Taylor
622f93df45 remove usages of deprecated {} string access, closes #3035 2019-07-22 16:39:33 +01: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
906d7eb176 Lang: Move TranslationContainer and TextContainer to \pocketmine\lang namespace
why the hell were they ever put in \pocketmine\event in the first place??

This change was suggested many months ago but I forgot all about it.
2018-02-04 20:03:30 +00:00
Dylan K. Taylor
1fd9994056 Merge branch 'master' into mcpe-1.2.5 2017-11-21 16:48:18 +00:00
Dylan K. Taylor
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
Dylan K. Taylor
372b97ba8f Revert "Patch %0 client translation exploit"
this bug was (FINALLY) fixed in 1.2.5.15

This reverts commit 378c3d7994b41849ba4d5608b0a9a5482e84cc25.
2017-11-01 16:17:17 +00:00
Dylan K. Taylor
f783789e5a fixed escape code unescaping in language files, close #1474 2017-10-18 20:43:35 +01:00
Dylan K. Taylor
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +01:00
Dylan K. Taylor
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
Dylan K. Taylor
2a7b736f18 Heap of bugfixes, cleanup and PHP 7 upgrades 2017-07-13 19:18:56 +01:00
Dylan K. Taylor
4d874e7e78 static analysis 2017-07-13 16:45:24 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Dylan K. Taylor
11e0387e19 Show an error if no language files found during setup, mitigates #380 2017-02-25 11:21:32 +00:00
Dylan K. Taylor
89216c3bd4 Use parse_ini_file instead of home-grown solution (#366)
* Use parse_ini_file instead of home-grown solution

* Updated PocketMine-Language submodule
2017-02-19 15:53:22 +00:00
Dylan K. Taylor
2d5567d9dd Removed InstallerLang mess, language improvements, updated PocketMine-Language submodule 2017-02-15 14:44:12 +00:00
Dylan K. Taylor
06c399fa05 Get MainLogger directly, in case translations are needed without a running server 2017-01-31 17:21:21 +00:00
Dylan K. Taylor
bd722bb85f fix misplaced doc 2016-12-15 09:22:51 +00:00
SOFe
175dd0efa6 PhpStorm inspections
Fixed some minor bugs and dropped some obsolete code

pocketmine\level\generator namespace is ignored in this commit
2016-12-14 21:49:35 +00:00
SOFe
3b7377370c Critical error upon missing submodules (#77)
* Critical error upon missing SPL

* Added checks for RakLib and PocketMine-Language

* It actually throws ClassNotFoundException, not simply returns false :(

Should I blame :shoghi:?
2016-11-06 11:46:39 +08:00
SOFe
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
dktapps
378c3d7994 Patch %0 client translation exploit 2016-09-30 19:19:44 +01:00
PEMapModder
754ff9b4c4 Fixes #3223 2016-04-04 17:59:23 +08:00
PEMapModder
6ae0f3c8d8 Cleaner (and maybe faster) INI parsing 2015-10-31 20:31:24 +08:00
Shoghi Cervantes
05a9ad57bd
Fixed BaseLang->get() 2015-04-12 12:41:38 +02:00
Shoghi Cervantes
e9963b603d
Fixed #2864, closes #2864 2015-04-12 12:17:53 +02:00
Shoghi Cervantes
e2bae92df8
Updated language files and command descriptions 2015-04-12 00:59:12 +02:00
Shoghi Cervantes
d1006de421
Added fallback to BaseLang, better use by plugins 2015-04-11 16:15:45 +02:00
Shoghi Cervantes
3cf42b558c
Fixed language selection 2015-04-11 15:37:44 +02:00
Shoghi Cervantes
5a0d1affcc
Base translations moved to submodule! 2015-04-11 15:31:22 +02:00
Shoghi Cervantes
3b6e10b759
More langs :D 2015-04-11 14:59:15 +02:00
Shoghi Cervantes
c29ae333a2
Translate format text 2015-04-11 02:15:46 +02:00
Shoghi Cervantes
0c041ebca3
Added base translation system 2015-04-11 01:32:08 +02:00