Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "php 7.4"
-
I showed a friend of mine a project I made in two days in Docker and Symfony php. It is a rather simple app, but it did involve my usual setup: Nginx with gzip/cache/security headers/ssl + redis caching db + php-fpm for symfony. I also used php7.4 for the lolz
He complained that he didn't like using Docker and would rather install dependencies with composer install and then run it with a Laravel command. He insisted that he wanted a non-docker installation manual.
I advised him to first install Nginx and generate some self-signed certificates, then copy all the config files and replace any environment-injected values (I use a self-made shell script for this) with the environment values in the docker-compose files.
Then I told him to download php-fpm with php 7.4 alpha, install and configure all the extensions needed, download and set up a local Redis database and at last re-implement a .env file since I removed those to replace them with a container environment.
He sent an angry emoji back (in a funny way)
God bless containerized applications, so easy to spin up entire applications (either custom or vendor like redis/mysql) and throw them away after having played with them. No need to clutter up your own pc with runtime environments.
I wonder if he relents :p9 -
!rant
Best day of my life ❤️.
Arrow functions will be added to PHP 7.4:
https://twitter.com/nikita_ppv/...22 -
Finally finished the longest ticket I've ever worked on in my life. The ticket title and description was a pretty simple and straightforward one: "Upgrade from PHP 7.4 to 8".
If it was only so simple in real life. Our application is mostly done with API Platform framework, which is based on top of Symfony framework which is based on top of PHP language.
Once I did PHP 7 => 8 upgrade I needed to upgrade API Platform 2 => 3. But of-course that couldn't have been done as before that I needed to upgrade from Symfony 5 => 6.
This all was literally an equivalent of touching into a wasp nest - it took me a bit over 5 months and 800 hours of work and there was literally not a single source file left untouched.
In the process of all of this I've ran into literally dozen undocumented feature-breaking changes, broken backwards-compatibility promises and inside out architectural changes - from both the frameworks and the language itself.
Upgrading just one major version of anything SHOULD NOT be so hard. And to top it all up just to think I will need to do this again in a year or two..
Experiences like these really set my hate for time-based model of releases and the state of today's development in general.6 -
Difference between 2023-01-01 00:00:00 and 2023-12-31 23:59:59 is 11 months, 29 days, 23 hours, 59 minutes, 59 seconds ; so almost a year (by one second)
Difference between 2023-01-01 00:00:00 and 2023-01-31 23:59:59 is the same, almost a month by 1 second.
Same for february (even with 28 being the last day).
But then, 2023-03-01 00:00:00 and 2023-03-31 23:59:59 gives me :
1 month, 2 days, 23 hours, 59 minutes, 59 seconds.
WHY, are there fucking 34 days in March ? Is this a bug ? Is it confused with February being the previous month ?
Why would PHP do this to me ?
Why the hell is it always so painful to work with dates, it's not even like I'm stretching the standard library or using raw timestamps to hack things together
I used the diff method of PHP 7.4 DateTime, is someone wants to try it24 -
Okay, so...
We have backend app written in phalcon 3.4.
I got task to prepare new test enviroment, based on ubuntu 20.04, php 7.4 and 'copy-paste' our Phalcon backend there.
Soooo.. That backend was outsourced and I have exacly 0 Phalcon expirience.
Phalcon 3.4 does not support php 7.4
Last 2 days Im tearing my hair out to port it over to Phalcon 4, with honorable mention why the fuck memcache didnt just want to work, and finally its working.
Now Im taking the heat that making new test enviroment takes more than few hours.
Fuck off, let me do this shit, and understand its not just apt-getting dependencies for fuck sakes.2 -
After the fun I had with the XEN Orchestrator UI ( https://devrant.com/rants/2554182/ ) I build an exporter that normalizes XEN / Proxmox API output and writes it into a nice spreadsheet.
Took PHP 7.4 for a spin. Sweet jesus, lot of nice stuff.
Been nearly a year since I did something larger than small scripts in PHP, but felt really at home again.
The type hinting and arrow functions made writing the exporter a breeze.
DTOs with typed properties spared me quite a bit of headache when normalizing the different APIs...
Utilizing *sort with fn arrow function is a pretty nice and concise one liner with the spaceship operator.
And I have now a nice spreadsheet...
Thanks at the PHP folks.1 -
PHP 7.4
Anonymous functions in PHP can be quite verbose, even when they only perform a simple operation. Partly this is due to a large amount of syntactic boilerplate, and party due to the need to manually import used variables. This makes code using simple closures hard to read and understand.
https://wiki.php.net/rfc/...7 -
Just finished building app with Laravel and vue.js with routers, vuex and coupled js, running on php 7.4 using typed properties
Next 2 projects Wordpress and Typo3.....
Why is world so cruel....1 -
Okay so i did an internship in Laravel for 6 months. I started there and i had zero experience with it. Later, i started to learn more about it and i realized their Laravel version was at 5.8 and their bootstrap was at 3.4. It annoyed me so much but i wasn't allowed to update it to a better version.
What happened is, i installed Linux on my laptop and had to install some things. I accidentally did composer update and updated the whole thing. I updated it to Laravel 7.4 and i thought, well, that's good right, it will not effect the whole project right? No it wasn't right. I got Teams messages from my colleagues. They normally don't really respond to me, ignoring me but this time, they responded quickly. It was wrong what i've done because the code on the server wasn't working anymore and it was pretty bad they said. So i had to get the last version in Gitlab and i should not do composer update again.
Also, i was annoyed because i couldn't use so many font awesome icons. They all didn't work! I had to make this dropdown menu with an arrow down but even that didn't work, so i used a transparent image to do it because that was my only option to have a good arrow. I wanted to update that as well but nope, not allowed.
Oh yes, i'm not done yet.
They have put so much CSS on the project, that i couldn't even use bootstrap columns. I struggled with that and seriously, no help. The pages were styled really weird and it was dramatic.
When i asked for help, for some PHP code for example, no one responded for days and i was angry about that. Later at the end of my internship, they told me I wasn't the one who was responding and that i should have asked for help and i had to start the conversation. They really just said that? Yes, they did and i'm not happy about that. It costed me some points on my end essay, because they haven't been doing their best.
I wanted to learn more about PHP, but ended up doing all the frontend. I like it, but it's not what i originally wanted to do. So basically, i learned stuff in frontend but almost nothing in backend. It saddens me and hope to get a better internship next schoolyear.
I really had to rant about this, oops.1 -
#Suphle Rant 6: Deptrac, phparkitect
This entry isn't necessarily a rant but a tale of victory. I'm no more as sad as I used to be. I don't work as hard as I used to, so lesser challenges to frustrate my life. On top of that, I'm not bitter about the pace of progress. I'm at a state of contentment regarding Suphle's release
An opportunity to gain publicity presented itself last month when cfp for a php event was announced last month. I submitted and reviewed a post introducing suphle to the community. In the post, I assured readers that I won't be changing anything soon ie the apis are cast in stone. Then php 7.4 officially "went out of circulation". It hit me that even though the code supports php 8 on paper, it's kind of a red herring that decorators don't use php 8 attributes. So I doubled down, suspending documentation.
The container won't support union and intersection types cuz I dislike the ambiguity. Enums can't be hydrated. So I refactored implementation and usages of decorators from interfaces to native attributes. Tried automating typing for all class properties but psalm is using docblocks instead of native typing. So I disabled it and am doing it by hand whenever something takes me to an unfixed class (difficulty: 1). But the good news is, we are php 8 compliant as anybody can ask for!
I decided to ride that wave and implement other things that have been bothering me:
1) 2 commands for automating project setup for collaborators and user facing developers (CHECK)
2) transferring some operations from runtime to compile/build TIME (CHECK)
3) re-attempt implementing container scopes
I tried automating Deptrac usage ie adding the newly created module to the list of regulated architectural layers but their config is in yaml, so I moved to phparkitect which uses php to set the rules. I still can't find a library for programmatically updating php filed/classes but this is more dynamic for me than yaml. I set out to implement their library, turns out the entire logic is dumped into the command class, so I can neither control it without the cli or automate tests to it. I take the command apart, connect it to suphle and run. Guess what, it detects class parents as violations to the rule. Wtflyingfuck?!
As if that's not bad enough, roadrunner (that old biatch!) server setup doesn't fail if an initialization script fails. If initialization script is moved to the application code itself, server setup crumbles and takes the your initialization stuff down with it. I ping the maintainer, rustacian (god bless his soul), who informs me point blank that what I'm trying to do is not possible. Fuck it. I have to write a wrapper command for sequentially starting the server (or not starting if initialization operations don't all succeed).
Legitimate case to reinvent the wheel. I restored my deleted decorators that did dependency sanitation for me at runtime. The remaining piece of the puzzle was a recursive film iterator to feed the decorators. I checked my file system reader for clues on how to implement one and boom! The one I'd written for two other features was compatible. All I had to do was refactor decorators into dependency rules, give them fancy interfaces for customising and filtering what classes each rule should actually evaluate. In a night's work (if you're discrediting how long writing the original sanitization decorators and directory iterator), I coupled the Deptrac/phparkitect library of my dreams. This is one of the those few times I feel like a supreme deity
Hope I can eat better and get some sleep. This meme is me after getting bounced by those three library rejections