The more I'm thinking about it, the more I consider it.
I want to add a map for my bicycle rides, but I can't find any good PHP maps. The PHP versions of Leaflet on GitHub are no good. They don't work at all. They just gives you errors like "can't load class" or something like that.
So even if I am against it only to challenge myself, I consider using Leaflet in JS for airikr.me/biking.
Or do you have any solution in PHP that works out of the box?
My first #PHP was 8.0, still in school, and I confess that I began learning it with the prejudice of it being a junky, terrible language everybody was making fun of. Fast forward ~1 year later, after finishing my internship, where I used full stack #Laravel mainly, and having discovered that not only it wasn't that bad, but really a pleasure to work with. Not perfect, but perfectly suitable for its use cases and, what's perfect anyway? So reading this has been a joy. :D https://developerjoy.co/blog/php-doesnt-suck-anymore
@array@hydrian@blu256 Do you assign data to Dto/Model classes (for better editor integration) or just keep it as a HashMap of some kind? In PHP I've been lazy and just keep everything as an array, even though for type support casting to a Model class would be better.
@ntha@hydrian@blu256 No, my models declare the attributes (mapped to the database ones), with constructors and getters/setters. That way I can pass the model objects through, for example, factories and interfaces (I use generics) up to the views. In this I was clearly "inspired" by the way say Laravel implements the MVC model. I'm just a noob so take this with a grain of salt, I'm probably doing more than one thing wrong or at least, not the best way possible. ;)
@ctietze@joby@deanatoire Pretty sure yes. If you wanted to do that, there's some complex and rarely used HTTP headers that you'd have to handle manually, then work on the streams yourself. That would definitely be slower, but assuming my benchmarks are still vaguely correct, it wouldn't be orders of magnitude slower.
Unless that's a common issue for your use case, it's probably not worth the trouble.
Who will I see at #PHPTek next week? I’m giving a keynote on Thursday, and I’m super nervous. It’s only the second keynote I’ve ever given, and the first one was over 10 years ago. 😬😰 #PHP
@awoodsnet I would have loved to attend both, but some jerk is speaking at the same time as your first one, and I gotta attend that one. Looking forward to the dotfiles talk though!
Today I installed #php 8.3 on my VServer ( #Alpine Linux) and tried to switch to that version with ln -fs /usr/bin/php83 /usr/bin/php .
Previously I used php 8.2.x
The problem is, #Friendica 's Admin Page says this:
The phpinfo() included in the admin area also says 8.2.18 and I have deleted the php-fpm82 service and added and started the php-fpm83 service and also restarted the php and apache and mariadb services and rebooted the server..
@noidea I've always used Apache2 with the PHP module because of the reduced amount of moving parts, and many Friendica administrators have had success serving their node using php-fpm and nginx as a web server/reverse proxy.
I read it's possible to use Apache and php-fpm together, but it isn't a very popular use case and I wouldn't be able to recommend it.
[Wed May 08 17:36:06.972634 2024] [so:warn] [pid 13101] AH01574: module php_module is already loaded, skipping
Led me to uninstalling the package php82-apache2 , which seemed to be still loaded. After that the other one (php83-apache2) seemed to be in use. (maybe some "reload" would have helped, too, i don't know..)
Then I had to install php83-session to be able to log in.
Now it looks okay in the admin page:
I was looking at this Sass (SCSS) compiler, written in #PHP, and I noticed something very odd.
Under “requires (dev)," it requires two packages, sass/sass-spec and thoughtbot/bourbon, both of which appear to be empty packages, containing only a composer.json file, which has no dependencies.
What’s the purpose of these packages? They otherwise appear suspicious, to me, but I can’t see that they're doing anything nefarious right now—they just appear pointless.
@ramsey@seldaek that's a bit of a shortcoming in packagist.org we should probably address. scssphp composer.json actually contains a custom package repository definition which defines thoughtbot/bourbon has something that doesn't exist on packagist.org and because it's only in require-dev which is only loaded from root composer.json, that means that custom definition will always be used, and never the package that's linked to on packagist.org.
Please, web app developers, consider how your users will upgrade. If your upgrade process is "remove the old one, unzip the new one", then it's not an upgrade process. It's an encouragement to never upgrade.
@Crell@acelaya I've used Ansistrano - https://ansistrano.com/ - for a few projects, that run on small vps', to automate steps I used to do manually. Not sure if applicable to this question though 😅
Proposal for a conference talk: How to configure #PHPStorm and all its tooling extensions (xdebug, phpstan, php-cs-fixer, etc.) to use a docker container consistently.
I need to remember that Mastodon exists! I’m currently writing a bunch of content to do with PHP and this would be the perfect place to talk about that.
I’m currently trying to decide whether #php#reflection is an interesting enough topic that people may like an in-depth course/series on it. It seems to be something a lot of people are vaguely aware of, but don’t really know the details.
It’s been so long since I did anything with authenticated users, curious about “modern” patterns and standards.
Specifically, an authenticated user wants to do something. What patterns and standards are you using for permissions?
I’m seeing middleware mentions. But, curious what else is out there. Not looking for “use Framework X” and should be testable. Doesn’t need to be web-specific as I’m just looking for patterns and standards.
@itsjoshbruce it's the request (route or route group middleware). Authenticated user is set early to the container and then various areas are protected based on the user's roles. Of course, there are more detailed checks later in the flow (e.g. parts of the interface are hidden or different depending on role/permissions). Middleware is stopping the unintended actions, like playing with URLs to access what's not supposed to be seen or actioned on.
Dear #PHP community! Could someone with power please raise an RFC to make the strict parameter of the in_array() built-in function true by default? It's really annoying to remember putting true as the third parameter every time, and not doing it might potentially lead to weird bugs. Thanks!
@Yinshi Да я вообще не понимаю, что это блин такое. То есть оно в массиве, но не совсем, потому что '1' == 1. Аррргх! К счастью, теперешний PHP всё же по большей части, что называется, здорового человека, но вот такие штуки прям выбешивают иногда.