@Crell@phpc.social avatar

Crell

@Crell@phpc.social

Anything worth doing is worth doing well.

Anything worth doing well is worth teaching others to do well.

Author of Thinking Functionally in PHP, now on LeanPub: https://leanpub.com/thinking-functionally-in-php

#tootfinder

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Crell, to random
@Crell@phpc.social avatar

No, goth lasagna is now its official name. I don't make the rules, I just eat them.

pwaring, to php
@pwaring@fosstodon.org avatar

Currently working on a rewrite of an old application (PHP 5.6, was probably written in an even earlier version) by building a new one in PHP 8.3 and migrating all the data across.

I don't usually recommend rewrites but occasionally it's more cost-effective than trying to fix really old code.

Even though I work with legacy code every day, the changes in 8.3 (and libraries that require it) make life so much nicer.

(I currently work with versions from 5.4 to 8.3)

Crell,
@Crell@phpc.social avatar

@pwaring Which changes in particular? 8.3 wasn't a particularly exciting release, especially compared to 8.0/8.1.

Crell, to random
@Crell@phpc.social avatar

How the rich are strangling Social Security.

https://youtu.be/GfZuB7XSFys

sirber, to php
@sirber@fosstodon.org avatar

What do you think of Codeigniter?

Crell,
@Crell@phpc.social avatar

@sirber The Laravel of the 2000s. That is not a complement.

OldGrumpyBitWrangler, to php
@OldGrumpyBitWrangler@mastodon.social avatar

An instance of a popular CMS is used for a website. While analyzing I'm coming across a a table in it's MySQL database where a column called "deleted" is defined as such:

deleted` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'A boolean indicating whether this data item has been deleted‘

🤦‍♂️

There should be a license allowing allowed to write software used by someone else. Like with drivers licenses it needs a points system for violations and license revocation.

Crell,
@Crell@phpc.social avatar

@OldGrumpyBitWrangler I have theories as to which CMS you're talking about... But I'll ask, what would you do instead? Isn't that the only way to do a boolean flag in MySQL, or have they fixed that more recently?

Crell,
@Crell@phpc.social avatar

@OldGrumpyBitWrangler OK, so your objection isn't to what the CMS is doing, just with their choice of database. Got it.

(I agree Postgres is the more robust option, but wasn't sure what issue you had with "deleted" flags. That's a common technique for that use case.)

enusbaum, to dotnet
@enusbaum@tootsmcgoots.io avatar

You know why PHP is still around? Because it's fucking simple.

The levels of abstraction in Web Frameworks like React/Angular or ASP.NET Core is a little silly. You have to navigate through 4-5 files of logic before you actually get to the rendering of a page.

PHP?

<?php echo "Hello World!"; ?>

If dotnet could give me a syntax and framework as simple as PHP, I think it'd dominate. Just one file (index.cs), not a zillion files and boilerplate.

Call it ASP.NET Min

Crell,
@Crell@phpc.social avatar

@enusbaum @b4ux1t3 @khalidabuhakmeh As someone transitioning from PHP to Kotlin/JVM, there is absolutely nothing in PHP that can come close to how grotesquely over-engineered Spring Boot and its various pieces are.

Crell, to random
@Crell@phpc.social avatar

@typo3blogs Looks like https://planet.typo3.org/ is offline?

Crell,
@Crell@phpc.social avatar

@supergarv Hm, I'm not in the Slack anymore. 😞

I'm a bit disappointed, since I wrote the code for it. We're about to start using it for Planet PHP, finally. I guess that means we don't need to worry about compatibility with TYPO3's installation...

Crell,
@Crell@phpc.social avatar

@supergarv Le Sigh. (Or Das Sigh, I guess?)

It was an RSS aggregator/repeater. The idea being anyone with a TYPO3 blog feed could get aggregated on the planet, then people could subscribe to just the one RSS feed to get everyone's blogs. If only typo3.com ever used it, then it wouldn't add anything, but the intent was for others to also feed into it.

"Planets" used to be a lot more common before the War on RSS began...

Crell,
@Crell@phpc.social avatar

@supergarv Keep an eye on https://planet-php.org/, which is kinda waining now but we're going to try and reboot it. Stay tuned.

Crell,
@Crell@phpc.social avatar

@supergarv We've discussed a little bit what Planet/Mastodon integration would look like. Right now I have no idea, but a simple repeater shouldn't be too hard, I think?

Crell, to space
@Crell@phpc.social avatar

Career goals. Absolute programming badasses.

Crell, to php
@Crell@phpc.social avatar

Silly me for thinking I couldn't find an ORM I dislike more than the ones I've used in . Then I found Spring Boot / JPA...

This is a whole new level of asinine...

Crell,
@Crell@phpc.social avatar

@josh I'm afraid to.

Crell,
@Crell@phpc.social avatar

@motofix I fully agree that building queries via string concat is the wrong approach.

But SQL is a robust, powerful, nuanced language, and adding 10,000 lines of code on top of them that ultimately is running 90% "read from one table into a record object, with 1:1 matching" but makes just writing a bloody SQL query 10x harder is also the wrong approach.

And if you're writing your own almost-SQL DDL on top of it to parse and translate, then you've just lost and should give up. (JPA or Doctrine)

Crell,
@Crell@phpc.social avatar

@motofix I've yet to be on a project (PHP or Kotlin) that has someone who is an actual master in the ORM... Which suggests that they're just too hard to master in the first place.

All ORMs are solving the wrong problem.

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

@derickr There is a user3 account associated with you that keeps spamming me even though I am not following it.
Please fix.

Crell,
@Crell@phpc.social avatar

@derickr @grmpyprogrammer I am getting it, too. It looks like it's reposting your blog entries or something?

Crell,
@Crell@phpc.social avatar

@grmpyprogrammer @derickr I believe so, yes.

ctietze, to php
@ctietze@mastodon.social avatar

A question for more experienced developers than me:

We have this setup where all requests go through a PHP script for authorization (think: cookie) checking before serving files.

That's fine with HTML, but less ideal for 5MB PDFs.

I'm trying to search for ways to use PHP to allow/deny access, but otherwise let the web server (Apache) do its job.

Is there such a facility to rewrite requests for auth, but then go on serve the static files?

Crell,
@Crell@phpc.social avatar

@ctietze I wrote about some of the options and their relative costs a long, long time ago: https://www.garfieldtech.com/blog/readfile-memory (It's on a very old version of PHP, but I don't think the basic feature has changed in 20 years.)

Basically, authenticate and then use readfile(). You'll be fine. Or authenticate and then use XSendfile (Apache), or equivalent (nginx).

Symfony as a response object that does this for you, as do good PSR-7 implementations.

Crell,
@Crell@phpc.social avatar

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

Crell,
@Crell@phpc.social avatar

@ctietze 12 YEARS and you're the first person to spot that... Humans really are bad at proof reading. 🙂

Fixed now, thanks.

ZachWeinersmith, to random
@ZachWeinersmith@mastodon.social avatar

Hey literature people--

So, I was reading HG Wells and I noticed something I hadn't thought about. He writes in a style that's very weird, and but for the Victorian/Edwardian language might even be considered experimental now? Like, in The War in the Air, it regularly alternates between goofy comedic scenes and scenes of horror and violence. And in between THAT there are digressions about economics and engineering technology. (1/n)

Crell,
@Crell@phpc.social avatar

@ZachWeinersmith Terry Prachett is an expert at mixing silly and social commentary.

John Norman is not; he just inserts redundant rants into his stories in odd places.

nyamsprod, to random
@nyamsprod@phpc.social avatar

@Crell I have a question ? https://github.com/thephpleague/csv/blob/master/src/Operator/Comparison.php I use an Enum in the case because to me the number of Comparison operator is finit BUT there is a case for using a class instead for better type hinting ? What do you think from a DX perspective ?

Crell,
@Crell@phpc.social avatar

@nyamsprod The constraints feel like an unbounded set from the looks of them, so I agree, classes are the better solution than enums in this case.

Crell, to random
@Crell@phpc.social avatar

My home town just voted overwhelmingly to adopt . It's the first city in Illinois to do so, but I don't expect it to be the last. We've been working on this for 2 years.

Whatever else happens tonight, this feels dammed good.

Crell,
@Crell@phpc.social avatar

@Phosphenes

For Illinois specific efforts: https://www.fairvoteillinois.org/ (I'm a board member.)

National orgs:
https://fairvote.org/
https://rankthevote.us/

Most states have a state level org at this point. Google for "Ranked Choice Voting $state" (for your state) and you should find one.

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