-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8 Support #872
Comments
Memo: Prado::using can be made able to autoload enums, too (see #876 as an example) |
Today prado 4.2.2 has been released supporting php 7.4, that is EOL since 4 months. |
We finally incorporated the bug fix for Cron. Thankfully. I was hoping to get the New asset manager into the 4.2.2 release but alas. That's ok. TIFF-EXIF is taking some time to get it right/write. (read/write... that's the point of the EXIF implementation. not funny?). There are some methods throughout that were conditionally coded for PHP 7, I specifically remember TAuthManager having a security function that needed support for older systems. |
Man, I was hoping to get more bug fixes into this release. |
Don't worry, there's always time for 4.2.3 |
#879 has been merged and now master is php8-only. public function repeaterItemCreated($sender,$param)
{
static $itemIndex=0;
$item=$param->Item;
if($item->ItemType==='Item' || $item->ItemType==='AlternatingItem')
{ In this case ItemType will be an object and you can't really compare it to a string, even if it's a string BackedEnum. |
…s of precision From being pushed to upgrade from PHP 8.0 to PHP 8.1+ today, I moved to 8.2. There were a few minor errors and this patches those errors.
…me stamp) for PHP 8.2 Dropping PHP 8.0 support, ensuring 8.2 support, the $time variable was giving an implicit float to int conversion error that needed to be explicitly defined. This was an error in PHP 8.2
PHP 8.2 Classes must define properties. These classes accidentally did not define their test classes.
…ling on validation of non-existing properties in PHP 8.2
PHP 8 supports parameters being flagged as sensitive so they do not show up in the stack trace. While simple setters are just formality, TAuthManager::login has many moving parts and could throw an error, validation of users may throw an error in a developers application (esp DB Users), and TDBConnection -setting the password on construct- could fail on some malfunctioning class-wide behavior.
… for PHP 8.2 Dropping PHP 8.0 support, ensuring 8.2 support, the $time variable was giving an implicit float to int conversion error that needed to be explicitly defined. This was an error in PHP 8.2
PHP 8.2 Classes must define properties. These classes accidentally did not define their test classes.
…alidation of non-existing properties in PHP 8.2
PHP 8 supports parameters being flagged as sensitive so they do not show up in the stack trace. While simple setters are just formality, TAuthManager::login has many moving parts and could throw an error, validation of users may throw an error in a developers application (esp DB Users), and TDBConnection -setting the password on construct- could fail on some malfunctioning class-wide behavior.
FYI. PRADO on PHP 8.2 is working without error on my instance with latest merge. @ctrlaltca, You've been doing a lot of great update work, btw. I and we all appreciate it! I'm glad that the only 8.2 issue was basically a single implicit float => int conversion/loss of precision error (from my own hand). |
Is there any way to automatically format all the comments to "80 + n" (until next white space)? maybe 75 or 70 as the limit depending on how it looks. I think standardizing this would be great. Preserve double spaces. Can PHP CS Fixer buff the comments too? I also like the format of putting 3 spaces after an @ param (or other @ item) on any text that wraps so in can be identified more easily with the prior @ item. |
Looks like it's not possible: |
I was considering writing a little php script that reads "/**", puts paragraphs together, chunks them, an rewrites the comments in a specified length per line until white space. Also adding a few spaces to @ items when they wrap. We have well formatted PHP-doc. I don't see what is so difficult about this other than some people have ill formatted php-doc that might make it impossible. |
Along with PHP 8 support I wanted to go through Yii2 and draw out some of their core enhancements that we should have. Our behaviors update, Event handlers supporting invokable and closure, TEventHandler, and the TExceptions update (for chaining exceptions, TExitException, and TUserException) is basically all the best stuff back ported. We have a few extra features too, like global events, dynamic events, priority based events handlers rather than append/prepend, and one-to-many TClassBehavior. Their TExceptions is compliant with PHP's Exception whereas Prado has no actual error code just a code-message. The actual PHP Exception code doesn't fit our model (yet). I suggest maybe overloading the "ErrorMessage_what_is_wrong" like this "error message_what_is_wrong=30" and then TException looks for the "=". If found, it pulls the error-message-code apart and we have the error code encoded into the error message code with backward compatibility. I'd like some feedback before going ahead with such an update. |
I think we could use the Yii3 VarDumper. it does closures. |
What is the process for back porting, say, the the Helpers of Yii2 back to Prado? Author names are kept and added to I am presuming. What about license text? copyright yiisoft. Obviously there would need to be minor changes to make the code "Prado oriented", and Yii is the child of Prado. So Is there a process for back porting? Their helpers are awesome. Prado could have a "Helpers" folder in Util for converters and helpers and such. We already have the Utf8Converter and TBitHelper. TBitHelper is new and can go into Prado\Util\Helpers but what about TUtf8Converter? Here is a list of helpers that would be great to back port:
They've done a lot of advanced work we can use. They don't have the TBitHelper. :) |
https://www.yiiframework.com/license Both Prado and Yii are using a BSD-3 clause license, so you are free to reuse their code as you prefer as long as you maintain their copyright notice |
In version 8.1 php added official support from enums.
Prado makes extensive use of TEnumerable to fake enums.
Switching to native enums could make the code less weird to new developers and static analyzers.
I know it's too early to require php 8.1, so the change should be backwards compatible for the time being.
The text was updated successfully, but these errors were encountered: