News for hackers. Stuff that matters.
Re:A look at modern PHP by marcosdumay on Tuesday May 05, 2020 @04:27PM (#23084617)
What do those mean?

> Hashing

> Encryption

> CLI commands with option/argument parsing, colored output, progress bars etc. (Do you mean a management console? All of them have it.)

Except for those, Django has every single one.

Re:A look at modern PHP by AegirLeet on Wednesday May 06, 2020 @12:15AM (#23087844)
Hashing: Support for securely creating and verifying cryptographic hashes, like you'd need for password hashing.

Encryption: Support for securely encrypting, signing, decrypting and verifying arbitrary payloads. In Laravel, you can do:

  $plaintext = 'foobar';
  $encrypted = $encrypter->encrypt($plaintext); // this will  encrypt the plain text, generate a MAC and combine everything into a base64 encoded payload
  $decrypted = $encrypter->decrypt($encrypted); // this will decode the payload, verify its MAC and decrypt it, giving you back the original plain text
  $decrypted === $plaintext; // true
As for CLI commands, I meant the ability to easily create your own commands. Here's [1] the relevant Laravel docs, for example. You can create commands and they will have access to all the things you can use in a HTTP context too, other than the actual HTTP stuff like the current HTTP request, because there obviously isn't one. So, for example, you could write a command that would use the ORM to perform some maintenance tasks on your database.

[1]: https://laravel.com/docs/7.x/artisan

Re:A look at modern PHP by marcosdumay on Wednesday May 06, 2020 @01:24PM (#23093757)
You mean, an crypto library exported by the framework instead of you specifically importing it? I don't see the gain (as a consequence, I have no idea if other frameworks do that).

RoR and Django both have extensible management commands, and all frameworks that I have ever seen allow you to create independent CLI commands (it's on PHP that the CLI is a second class citizen).

Re:A look at modern PHP by AegirLeet on Thursday May 07, 2020 @03:41AM (#23100685)
I think having good, secure, easy to use and hard to misuse crypto makes a ton of sense for any framework. The framework needs these internally anyway (to offer encrypted sessions for example), so you might as well expose them to the developer too.

I might have missed it, but I couldn't find any documentation on how to create custom commands in RoR. For Django I found [1] (through "python manage.py" from what I understand) and that does look like it's more or less the same as Laravel's "php artisan", with commands provided by the framework as well as the ability to add your own.

Anyway, I wasn't trying to attack RoR or Django, as those are actually the best alternatives to Laravel I know of. I worked on an existing Django project for a bit and while I don't like Python, Django seemed just fine to me for the most part. I did want to express my disagreement when it comes to the original claim of "any framework in any language can do what PHP frameworks can do" though.

[1]: https://docs.djangoproject.com/en/3.0/howto/custom-managemen...

Re:A look at modern PHP by marcosdumay on Thursday May 07, 2020 @06:27PM (#23109102)
> I did want to express my disagreement when it comes to the original claim of "any framework in any language can do what PHP frameworks can do" though.

Oh, a complete agreement on that.

This conversation sidelined from some people talking about Java, .Net, Go and Rust. None have anything similar to the big web frameworks. And while I'm not completely sure about Rust, I do believe that none even can have it.