Earlier quoted context omitted.
Its a quirky little language and the early versions weren't great. The language can be inconsistent in places, and embedding php in the html made for a rapid though sometimes trying experience. Its keeps backward compatibility which keeps those quirks in there. (though with new 7 series php versions older stuff is starting to break.) Someone wrote an article with a title like "php a language with terrible design" tha…
"and embedding php in the html made for a rapid though sometimes trying experience." Funny, that is React/JSX's biggest sell
Moving from Go to PHP Again
81–90 of 371 posts
Re: Moving from Go to PHP Again
#82Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. PHP files can be deployed independently, swapped out or updated live. No building/compiling of the php files needed. A single layer as opposed to 'modern architecture' where there's client side back/front end layers, api layer, logic, validator, data access, and ORM layers. Can extend itself as it runs. For example Wordpres…
I'm quite sure you can achieve this in golang with plugins[1]. That not as flexable as PHP, mainly because it involves a static type system and a compile phase (and more work in general).
Re: Moving from Go to PHP Again
#83Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. PHP files can be deployed independently, swapped out or updated live. No building/compiling of the php files needed. A single layer as opposed to 'modern architecture' where there's client side back/front end layers, api layer, logic, validator, data access, and ORM layers. Can extend itself as it runs. For example Wordpres…
I mean that's just how CGI works, most every HTTP server still supports CGI, nothing stops you from deploying that way. Unless you're using Java or the like of course, then it's not very convenient.
Re: Moving from Go to PHP Again
#84Earlier quoted context omitted.
I inherited a Symfony2 app and it was a bitch to deploy. It definitely had an asset pipeline. php app/console cache:clear --env=prod --no-debug php app/console assetic:dump php app/console cache:warmup --env=prod --no-debug chown -R apache:apache . # fix owner chmod -R u=rwx,g=rwx,o=rx app/cache # fix cache perms apachectl restart # bounce Apache, otherwise it can throw segfaults
That chown looks super suspect. Usually you wouldn't want the webserver to have write access to the web application it is executing; that's how you get backdoored.
Re: Moving from Go to PHP Again
#85[deleted]
To be clear, this just means that PHP has libsodium as an official language extension. Most modern languages have better package management than PHP and make pulling it in as a library trivial. This has nothing to do with homomorphic encryption, unless I'm missing something.
composer require some/library
That's PHP's package management. What's so non-trivial about that?Re: Moving from Go to PHP Again
#86Re: Moving from Go to PHP Again
#87Earlier quoted context omitted.
I inherited a Symfony2 app and it was a bitch to deploy. It definitely had an asset pipeline. php app/console cache:clear --env=prod --no-debug php app/console assetic:dump php app/console cache:warmup --env=prod --no-debug chown -R apache:apache . # fix owner chmod -R u=rwx,g=rwx,o=rx app/cache # fix cache perms apachectl restart # bounce Apache, otherwise it can throw segfaults
That chown looks super suspect. Usually you wouldn't want the webserver to have write access to the web application it is executing; that's how you get backdoored.
Re: Moving from Go to PHP Again
#88Is there any way to test php code the same way a compile phase does in other languages to catch obvious mistakes from hitting your users?
PHP Static Analysis Tool ( https://github.com/phpstan/phpstan ) is pretty good at surfacing that kind of thing.
Other potentially useful tools:
- PHP_CodeSniffer (https://github.com/squizlabs/PHP_CodeSniffer)
- GrumPHP (https://github.com/phpro/grumphp)
- PHP Mess Detector (https://phpmd.org/)
Re: Moving from Go to PHP Again
#89Earlier quoted context omitted.
You can create a mess of code, open security holes, and/or be hit with ‘gotchas’ in any web framework. PHP is much less complex than most.
These are things very specific to PHP. Yes, there are language-specific gotchas in many environments. But I'm criticising specific things that do exist and that I've seen causing issues in real deployments. Things that make PHP accessible make it also an excellent footgun.
Re: Moving from Go to PHP Again
#90Earlier quoted context omitted.
Perhaps because they don't want to incur technical debt to a language/runtime that could change at the whim of one company that probably doesn't have other companies' best interests in mind? The speed advantage of HHVM has also been largely erased. Some high-profile PHP sites migrated to HHVM before and up to ~2015, but I haven't heard of a single site doing that since PHP 7.0 came out.
> Perhaps because they don't want to incur technical debt to a language/runtime that could change at the whim of one company that probably doesn't have other companies' best interests in mind? How is Go any different?
Meanwhile, I can't think of any major online service that relies on Hack apart from Facebook and its subsidiaries.