@afilina@phpc.social
@afilina@phpc.social avatar

afilina

@afilina@phpc.social

Legacy software modernization, project rescue, architecture, test automation, public speaking.

I'm supporting a tactical unit in Ukraine directly. You can help me do more: https://afilina.com/donate/ua-supplies

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

afilina, to random
@afilina@phpc.social avatar

I'm confused. Is there no way to simply override the PHP's default file:// stream wrapper? Why must I reinvent the default implementation just to make one small change? Has nobody even published an unofficial implementation that can be "good enough"? Filters are great, but I can't auto-append them to every stream, which also means that I can't change the opening part. unless I missed something (docs are a bit light there).

afilina,
@afilina@phpc.social avatar

I'm dealing with legacy, so I need to wrap things in a way where I don't to touch the original code at all.

afilina,
@afilina@phpc.social avatar

@SenseException I went through the wiki and examples, and I still have no idea what it does.

I basically just need the default stream wrapper as written in C, but in PHP, so that I have a starting point to make small changes, like prepend text or log some operations. I'm not trying to isolate or unit-test anything

afilina,
@afilina@phpc.social avatar

@cxj I need to intercept included files so that I can inject declare(ticks=1) at the top. Include and such aren't function.

afilina,
@afilina@phpc.social avatar

I am losing my mind. I created a stream wrapper that allows me to intercept the loading of every file... except when it's an include and similar, meaning I can't modify PHP files on the fly.

Now, I do use PHP 5.3, so maybe it's an old limitation that was never documented. Or maybe there's some obscure directive that is not ON by default. dg/bypass-finals suggests that it's supposed to work, but it assumes PHP >=7.1.

afilina,
@afilina@phpc.social avatar

@arnapou I adapted code from db/bypass-finals to make something more generic for my needs. I think PHP really ought to have a better way to implement custom stream wrappers without reinventing the wheel.

afilina,
@afilina@phpc.social avatar

@cxj Yes, it needs to be done at runtime without touching the real files. Otherwise, it will mess up later steps. I ended up writing a wrapper after all, but I used one from an open source project as a template.

afilina, to random
@afilina@phpc.social avatar
  • That's no moon!
  • Well, actually...
sarah, to random
@sarah@phpc.social avatar

Writing automated tests makes writing code easier.

The marginal time it takes to write the test is faster than the time manual testing takes.

Someone who says "we don't have time to write tests" is wrong.

afilina,
@afilina@phpc.social avatar

@sarah What they really mean is that they don't want to invest time to learn how to write good tests, or set up a pipeline to execute them, or figure out the full user expectations. There are also many people who start and then quit because it's not working for them, often due to lack of guidance from someone more knowledgeable.

I find that education, practice through small increments, and taking away the initial setup hurdles increases the chance of getting (and keeping) people into tests.

rskuipers, to random
@rskuipers@phpc.social avatar

Apparently it's necessary to check Facebook every 2 minutes during a movie in the cinema. I hate this generation.

afilina,
@afilina@phpc.social avatar

@rskuipers Hate Facebook, not people who they successfully got addicted to their garbage. Honestly, I feel like we traded tobacco addiction for "scroll to refresh" addiction. Almost nobody smokes around me anymore, but everyone scrolls like they're in urgent need of a fix.

afilina, to random
@afilina@phpc.social avatar

Is there any legitimate reason to use MUI? It causes complexity of an application to immediately skyrocket, in exchange for marginal gains. Even those are questionable and can be solved easily through better code design.

It really feels like maintaining a rocket when you can get everywhere you need by bike.

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

I'm spending most of my time in this project stripping MUI. The result is code I can actually reason about, which is also shorter and more maintainable.

Oh and also the result is more accessible HTML.

afilina, to random
@afilina@phpc.social avatar

Sometimes, the JetBrains AI Assistant is useful. Other times, it's as annoying as a random reply guy (or gal!) who keeps forgetting the constraints of the question.

derickr, to photography
@derickr@phpc.social avatar

📷 Tiny Gosling

🚩 Outer Circle, City of Westminster, United Kingdom

afilina,
@afilina@phpc.social avatar

@SenseException I see what you did there. @derickr

afilina,
@afilina@phpc.social avatar

@derickr @SenseException Ryan Gosling.

afilina, to random
@afilina@phpc.social avatar

When company security policies are so bad that I need a second laptop open on my desk to do all my research work.

heiglandreas, to random
@heiglandreas@phpc.social avatar

I wanted to do some work. But....

afilina,
@afilina@phpc.social avatar

@heiglandreas The cat God decided otherwise.

afilina, to random
@afilina@phpc.social avatar

Does anybody is russia realize that sending able bodies to the slaughter and use what workforce remains to build weapons isn't the brightest idea? Clearly, not a single member of my family back in russia even remotely cares. They're seeing war crimes as a legitimate job. Morons.

afilina, to random
@afilina@phpc.social avatar

Committing some OSHA violations with my SO.

afilina, to random
@afilina@phpc.social avatar

I finally got a React application to a state where I can dare to display a CI badge on the README. This was quite an adventure. Still plenty to refactor, but I'm getting to a point where making changes to the legacy is not scary anymore.

afilina, to random
@afilina@phpc.social avatar

I already had Copilot for Windows turned off, but this guide has extra steps to completely disable it (not just toggle off).

Can someone confirm that this is a far an I need to go? I'd ideally delete every file it's relying on, but I don't want to brick my PC.

https://www.tomsguide.com/computing/software/how-disable-copilot-in-windows-11

afilina, to random
@afilina@phpc.social avatar

Heh, russians started again with their low-quality phishing bait via e-mail. I haven't heard from them in some time. Did something bad happen to them recently that made them extra salty?

afilina, to random
@afilina@phpc.social avatar

On this day in 1989, China violently suppressed protests in Tiananmen Square, leading to a huge number of civilian casualties. To this day, they deny this fact and censor discussions on this topic.
https://en.m.wikipedia.org/wiki/1989_Tiananmen_Square_protests_and_massacre

afilina, to random
@afilina@phpc.social avatar

For the next 5 days, you can get an online ticket to the Ukrainian PHP fwdays'24 conference for ~€57. I'll be showing how to improve your code design.

Part of the profit will be donated to humanitarian funds or trusted volunteers.

https://fwdays.com/en/event/php-fwdays-2024

afilina, to random
@afilina@phpc.social avatar

Good job Oilers. Now onto the finals.

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