PHP

jaapio, Dutch
@jaapio@phpc.social avatar

I'm gonna make you feel old... Remember #php 5 was released in 2004.
To me this means that I have been writing php for 20 years now. How about you?

robertvanlienden,

@heiglandreas You legacy-lover

Crell,
@Crell@phpc.social avatar

@jaapio I remember when was 3 was still cool and popular.

Yes, I'm that old.

Crell,
@Crell@phpc.social avatar

Should a serializer differentiate between null and uninitialized? Right now does not, and... I am not convinced that it should.

Discussion: https://github.com/Crell/Serde/pull/25

heiglandreas,
@heiglandreas@phpc.social avatar
Crell,
@Crell@phpc.social avatar

Based on the discussion here and in the PR, I've gone ahead and completed the PR to support null values in #Serde. If you use it currently, please review and make sure it doesn't break more than I already know it does. 🙂 #PHP I'll probably merge in a week or so, baring any contrary reviews.

https://github.com/Crell/Serde/pull/25

outofcontrol,
@outofcontrol@phpc.social avatar

Still follow some #PHP folks on Twitter that aren’t on Mastodon, like #Laracasts, Christoph Rumpel and #LaravelDaily. If they are on Mastodon, not under one of those bot accounts, would love to know.

ramsey,
@ramsey@phpc.social avatar

@outofcontrol There’s a @laravelnews account here.

denniskoch,
@denniskoch@phpc.social avatar

@outofcontrol would love to see some more faces from the community here too.

mglaman,
@mglaman@phpc.social avatar

MATT, WHAT HAVE YOU DONE?

At @midcamp, I gave a lightning talk about the greatest and worst idea I have had for four years.

An interoperability layer for to keep running legacy code.

mglaman/drupal-bridge is coming soon!

what if you could migrate from D7 -> D10 without rewriting all of your code? what if we only needed to migrate data and refactor legacy code over time? how many Drupal 7 sites could this unblock?

Picture of Drupal 7 taxnomy_menu module installed on Drupal 10
Screenshot of Drupal 7 module's database table being created (okay, this kind of just worked without trickery)

mglaman,
@mglaman@phpc.social avatar

@geerlingguy @stpaultim LET THE GAME BEGIN!

Yeah. I figured if we could say "just migrate to the new data tables but your existing code will just work" it'd be huge.

db_select(term_data) catches that table name and translates to new entity base table for example

rimu,
@rimu@mastodon.nzoss.nz avatar

@mglaman Mostly a drop in, like upgrading from D6 to D7 was. Also porting a Drupal module to Backdrop is mostly automated by the Coder module.

A pretty attractive option.

Crell, (edited )
@Crell@phpc.social avatar

Hey . When you use union and intersection types, do you include spaces?

(RT for reach, etc. This is survey data for @phpfig. If you know of any official policies by major projects already, please note/link in the replies.)

Girgias,
@Girgias@phpc.social avatar

@Crell @phpfig Not that my opinion is worth much because I don't do accessibility, but I don't use spaces and seeing spaces in a type is just really weird to me.

SenseException,
@SenseException@phpc.social avatar

@Girgias @Crell @phpfig Interesting POV: You don't have two or more types combined but a totally new type.

noidea,

Hello ..

Today I installed 8.3 on my VServer ( 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, 's Admin Page says this:

version 8.2.18
php.ini /etc/php82/php.ini

and in SSH, the php --version command says that:

PHP 8.3.6 (cli) (built: Apr 11 2024 15:12:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies

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..

Has somebody got an idea what I am missing?

hypolite,

@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.

noidea,

It seems okay now.

This message :

[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:

version	8.3.6
php.ini	/etc/php83/php.ini

thanks.

And the php-fpm packages are now removed..

ramsey,
@ramsey@phpc.social avatar

Who will I see at 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. 😬😰

omnicolor,
@omnicolor@phpc.social avatar

@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!

sarah,
@sarah@phpc.social avatar

@ramsey I’ll be there! My whole team is coming.

ramsey,
@ramsey@phpc.social avatar

#Tidelift lowers the amount paid out to #PHP package maintainers because demand with enterprise app developers is low.

Received the following in an email:

“Unfortunately, the reality is that we haven’t had as much traction with enterprise app developers using PHP as we have with other ecosystems; our customers tend to build their applications with mostly Java, JavaScript, and Python with smaller amounts of C# and Go. (1/3)

ramsey,
@ramsey@phpc.social avatar

“As a result, we will be reducing the income for packages to a base level of $25/mo per package. This is more in line with other ecosystems where we have limited customer demand. These changes will go into effect with the next lifter payout on April 3rd. (2/3)

Crell,
@Crell@phpc.social avatar

@ramsey The original server side language that was doing serverless before it was cool, and enterprise just shrugs.

Seriously, PHP screwed itself on marketing (or lack thereof).

sarah,
@sarah@phpc.social avatar

Are you a developer or a WordPress/Laravel/Symfony/Drupal developer?

Understanding the underlying language will make you more effective and considerably more flexible/employable.

Understanding the language helps you read the framework code and make sense of complex things. It lets you adopt new tech. And it empowers you to switch from one project to another without fear.

Be a language developer.

sarah,
@sarah@phpc.social avatar

@rvxlab @tappenden the way it goes is simple: we provide a concrete example of a design decision that shouldn’t have been made and is poor programming. You endorse that decision as good for programming, and beat up on “best practices”. We all walk away frustrated.

I’m not new to the community: I’ve had this conversation before. I’m not going to make the same mistake twice.

We should simply “agree to disagree” and not end up screaming at strangers on the internet.

rvxlab,

@sarah @tappenden I understand where you’re coming from and please note that my question comes from a place of curiosity. In no way did I intend to come across a way of “my way is the right way” or anything like that. I’m sorry.

I agree on letting this conversation be and go our separate ways. Please have a nice night.

carbontwelve,
@carbontwelve@notacult.social avatar

My method of installing different #PHP versions with homebrew is now broken; the versions install but trying to run php results in :"Library not loaded: /usr/local/opt/libvmaf/lib/libvmaf.1.dylib"

Ugh.

Pol,
@Pol@mathstodon.xyz avatar

@carbontwelve Alternative and long term viable solution: Nix.

carbontwelve,
@carbontwelve@notacult.social avatar

@danielsiepmann I thought so too, so I uninstalled and reinstalled.

I'm using shivammathur/php to get some older versions of PHP and none of them install and function at the moment.

alexanderschnitzler, German
@alexanderschnitzler@mstdn.social avatar

Hier haben doch letzte ein paar Leute über verschiedene Localization-Tools gesprochen, innerhalb und außerhalb der IDE. Wer war das und was waren die Tools?

ErHaWeb,
@ErHaWeb@phpc.social avatar

@koehnlein @alexanderschnitzler ok, jetzt gebe ich mich geschlagen. Hab das gerade mal durch einen Online XML-Parser gejagt und das Ergebnis ist, wie du sagst, tatsächlich schon hier jeweils identisch. Danke dir für die Aufklärung!

alexanderschnitzler,
@alexanderschnitzler@mstdn.social avatar

@koehnlein @ErHaWeb 🙈🙈🙈

Nun, mit etwas Zeit und einem klaren Kopf muss ich zustimmen. Und ich denke was mich gestern verarscht hat ist ein ViewHelper hier im Projekt, der die Übersetzungen nicht escaped, anders als f:translate. So war ich der festen Überzeugung, dass es mein CDATA war, was zu interpretierbaren HTML-Tags führte, ist aber nicht der Fall.

Mea culpa!

dgoosens, (edited )
@dgoosens@phpc.social avatar

Database abstraction layer...

Wondering how many people actually ever had to switch database systems (like from MySQL to PostgreSQL) in PRODUCTION ?

#php (but other languages are welcome)

dgoosens,
@dgoosens@phpc.social avatar

@GrahamDowns

well DBAL & PDO do come with a undeniable benefit in regards of security... very important IMHO

abstraction layer means you don't want to care about the underlying database system...
in that case, I agree with you and one ought to be cautious

but what I'm trying to figure out is whether it would make sense to dissociate the "access layer" part and the "abstraction layer" part

GrahamDowns,

@dgoosens I agree. Invariably your abstraction layer ends up being very tightly coupled to the underlying database technology anyway.

IMO being able to rip out SQL Server and replace it with, say, Oracle without too much effort is a pipe dream. You could probably do it without changing the client (much), but invariably you'll end up re-doing at least 60% of your data access layer. Which is where most of your business logic will be, despite what the "ideal world" tells you you should do. :)

syntaxseed,
@syntaxseed@phpc.social avatar

I have a #PHP 8.0 project where comparing legacy hashed passwords suddenly stopped working.

I think it's because older accounts are using blowfish ($2a$) and a salt of 21 characters but whatever it was falling back to stopped working because it wants a 22 character salt.

My client now has users with passwords I'm not sure how to validate because I can't replicate the hash.

I guess my next step is to just regenerate & email new passwords. But I don't like it.

shudder, (edited )

@syntaxseed @afilina The easiest solution would be exec wrapper compiled with old versions of crypt_blowfish.c + crypt_blowfish.h (this one might be omitted, but requires editing .c).
For example this
https://gist.github.com/shudd3r/87b06610422bd8f15f9be8a912c64a7e
...would accept crypt() args through command line and output hash.

Though I'm not sure if escaping quotes in password makes it safe enough.

syntaxseed,
@syntaxseed@phpc.social avatar

@shudder @afilina I appreciate that, but it's not worth the special trouble to do all that for this project. 😅

Edent,
@Edent@mastodon.social avatar

Hey, #PHP friends - what's the easiest way to compare the speed & memory use of two different functions?

The functions themselves are quite simple (a dozen or so lines) so I can't really be bothered to set up a whole XDebug environment.

Is there an online tool which will give me a rough answer?

derickr,
@derickr@phpc.social avatar

@Edent In between the "Install" and "Related Settings and Functions" on https://xdebug.org/docs/install is:

a. "4. Verify that Xdebug is now loaded.", which shows how to test whether Xdebug works.

b. "Xdebug 3: Diagnostics

This video teaches you how to troubleshoot …"

c. "What's Next?" https://xdebug.org/docs/install#what-is-next

Additionally, the profiler separately also has a 3 episode tutorial: https://xdebug.org/docs/profiler#related_content

What else do you expect in a Quick Start? Is it just the name you're missing, or something else?

Crell,
@Crell@phpc.social avatar

@Edent phpbench is my go to tool.

7php,

If you are a PHP Usergroup or a PHP Conference or a PHP package creator, get in touch with me!

I want to interview and host you on 7PHP!

#php

mikestreety,
@mikestreety@hachyderm.io avatar

@7php I'd be happy to talk if I fit into your target. I run the development team for a small web agency - we use PHP with our CMS (TYPO3). I have created several internal packages and published a few extensions for TYPO3.

7php,

@mikestreety definitely helpful to me. Thank you. Please bear with me for slow contact, but I have you on my list to followup soon. Cheers 🖖

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • DreamBathrooms
  • magazineikmin
  • ethstaker
  • InstantRegret
  • tacticalgear
  • rosin
  • love
  • Youngstown
  • slotface
  • ngwrru68w68
  • kavyap
  • cubers
  • thenastyranch
  • mdbf
  • provamag3
  • modclub
  • GTA5RPClips
  • normalnudes
  • khanakhh
  • everett
  • cisconetworking
  • osvaldo12
  • anitta
  • Leos
  • Durango
  • tester
  • megavids
  • JUstTest
  • All magazines