@itsjoshbruce@phpc.social
@itsjoshbruce@phpc.social avatar

itsjoshbruce

@itsjoshbruce@phpc.social

Time Lord. Agile Coach, User Experience designer, and software developer. Designing the human experience all around. :)

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

ramsey, to php
@ramsey@phpc.social avatar

Opinions/thoughts/advice on monorepos with . Is anyone working within this problem space? What tools do you use?

I know is a . Are the tools they use specific to them, or can others use them?

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@ralphschindler @ramsey: Not sure about now, but Google was “famous” for using a monorepo for all things.

Article referencing Symfony and splitsh/lite: https://blog.logrocket.com/hosting-all-your-php-packages-together-in-a-monorepo/

1/

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@ralphschindler @ramsey To the original question: Debated for years.

Every time I get close enough to make the leap, I reconsider.

For the most part, I write less code (lots of deleting as well), or extract more stable code into separate repos that now change once every few years - instead of being needlessly versioned, despite no changes to that specific code.

Much more smaller libraries that do much less stuff.

Or, changing the architecture instead of tooling to workaround with it. 2/2

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@ralphschindler @ramsey: (not needed, but I’ll say it anyway) I approve this message.

itsjoshbruce, (edited ) to random
@itsjoshbruce@phpc.social avatar

I love deleting code more than I appreciate writing elegant code.

Especially when I can do it without losing functionality. It’s like the ultimate refactor win for me.

Just thought I’d share.

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Experimentation in the following continues:

  1. Less code
  2. Fewer packages (1 package that depends on 50 = 51 packages)
  3. Still have robust dynamic sites

No more databases (not even flat-file). No more admin panels (that’s changing, kind of). Now I’m contemplating abandoning the belov’d front controller + router.

If you would have told the 2005 version of myself this is where I’d be 20 years later, I would’ve laughed in your face before panicking that someone would take away my precious.

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

Oh. And probably the most valuable one that sparked off this experimentation:

  1. Let the server be the server.

It’s interesting how much code we write to do what the server can do out of the box.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@bobmagicii: That’s fair. I appreciate the work folks do. And, to give credit where due, the PSL has a lot going for it.

The other day I contemplated a package. It wouldn’t install because it and another package depend on different versions of the same underlying package.

I decided to just install the underlying package. Now, I’m pretty sure I’ll just remove that package entirely, because I can easily get there without it.

itsjoshbruce, to php
@itsjoshbruce@phpc.social avatar

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.

#PHP
#WebDevelopment
#SoftwareEngineering

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@bobmagicii: Interesting. Do the permission names correspond to an action (method) on the controller?

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

@oliver: Right on. Is it the user or the request falling through the middleware checks?

johannarothman, to hiring
@johannarothman@mastodon.sdf.org avatar
itsjoshbruce,
@itsjoshbruce@phpc.social avatar
itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@johannarothman: Happy to share. I saw it for the first time over a decade ago. I’m surprised it’s still up.

I’ve definitely tried a lot of things for the portfolio, so to speak. Haven’t really found the one I should double down on. It probably doesn’t help that what seems to work for me is not in the spotlight of any kind.

More of a “in the shadows player.” lol

I am playing with the tagline: Give me credit, and tell your friends.

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

Part 9 of Time: Mastering the Mundane has been made available for purchase on Leanpub: https://leanpub.com/master-the-mundane

Part 9 is about Collaboration, which often gets conflated with Delegation (Part 7).

Contribute to this project on the Open Collective: https://opencollective.com/mastering-the-mundane/projects/book-mastering-the-mundane

#TimeManagement
#SelfManagement
#MasteringTheMundane

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

Time: Mastering the Mundane is on Scribl: https://www.scribl.com/books/EEDEB8/Time

We use Crowdpricing, so price is based on downloads and reviews, which means, as of this writing, it’s free.

We opted into Crowdpricing Everywhere; so, it should become available “everywhere” soon.

I found a couple of typos while recording the audiobook; corrected files should be coming soon.

The book is typeset for print and roughly half of the raw audio is recorded.

#TimeManagement
#SelfManagement
#MasteringTheMundane

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

The main book page for Time Mastering the Mundane has been updated: https://mastering-the-mundane.com/books/time-mastering-the-mundane/

Currently recording the raw audio for the audiobook and podcast variations. Have about a third recorded, and one Part through initial edits.

Found a couple of minor typos while recording. Corrected on the Leanpub version, and waiting for Scribl to let me know how to update it with them.

Print version is typeset.

So, still going as expected.

#MasteringTheMundane
#TimeManagement
#SelfManagement

itsjoshbruce, to php
@itsjoshbruce@phpc.social avatar

Learning how to do a thing.

Pretty sure it’s possible; never tried and haven’t been pulled to do so.

PHP creates sessions. Using cookies, it creates a cookie named: PHPSESSID (or similar).

I’d like to customize this; clean and simple.

Goal: I’d like to not have the PHPSESSID cookie. Not finding it.

Thinking:

  1. Disable session cookie
  2. Implement SessionHandlerInterface
  3. Set mine as the save handler
  4. Pass my session cookie in response header

Feel like I’m missing something.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@derickr @bhhaskin: Well done!

I didn't know session_name was a thing, and definitely clean for changing the key.

I think this will do the trick of step 1 - change the cookie key. And, step 2 - set custom ID:
session_name($sessionName);

/** Custom ID logic */

session_id($customId);

session_start();

No custom class implementing session handler interface is necessary...at least that I'm aware of as of now

Thank!

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@bhhaskin @derickr: Good looking out, and fair.

I'll go with the simple approach first. Make sure it works locally, then deploy it to production and verify it will also work there before getting too far into the rest of the solution.

Nothing sucks more than "it works on my machine" - and, your server being like "I'm not your machine. [insert maniacal laughter here]"

jitterted, to random
@jitterted@sfba.social avatar

Using in my apps has let me turn the "no logic in HTML templates" all the way up to 11.

I am now very aware (and suspicious) of any logic being evaluated, or even things like string concatenation, being done in HTML templates.

I may have to write a tool to warn me (or fail a test!) if I start using th:if, th:unless, or anything that looks like a method call in my Thymeleaf templates.

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

@jitterted: One of the things I love about the HTML builder I wrote is you literally can’t. It’s so lovely.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@jitterted: Sure! Thanks for asking: https://github.com/8fold/php-html-builder

Part of the inspiration was also removing tokenized parsing of HTML. So, instead of “get PHP out HTML” it was “get HTML out of PHP” - it’s basically just string concatenation. lol

Very little code (a few hundred lines), and should be easy to port without becoming a full-blown project. A stable and complete build. I haven’t needed to tinker with it for years.

qcoding, to random
@qcoding@iosdev.space avatar

I'm working on my talk for @swiftcraft and am thinking of this for my closing slide:
Principles ⇒ Practices ⇒ Tools

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@qcoding @swiftcraft: I tend to agree.

Would add Values before Principles. But that’s me, literally: https://joshbruce.com/essays-and-editorials/the-self/

itsjoshbruce, to random
@itsjoshbruce@phpc.social avatar

I have an affinity for: Wait until the last responsible moment.

I've been contemplating Continuous Deployment on my personal site for years: https://joshbruce.com

But, before I did, I embraced the @jezhumble line: If it hurts, do it more often, and bring the pain forward.

I could deploy my sites in less than a minute using my phone by the time I hit the ceiling of the manual process I used.

Becca and I are ramping up on TIA: https://the-irreverent-agilists.com

#TheIrreverentAgilistts
#Agile
#XP

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

Last but not least, the TIA site.

It's a private repo, so no link.

It's on the same server but a different user directory.

So, I cloned the php-deployer script and set up an environment file (using JSON, not .ENV).

Then I did what feels like the clunky part; setting up GitHub webhooks, mainly because I'm using tokens specific to the repo doing the push.

And voila: https://the-irreverent-agilists.com

If you'd be interested in a longer (and more in-depth) write-up on how I did this, let me know.

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

It's worth noting I could have done it through GitHub Actions, but I decided against that.

In part because I don't want to be even more tightly coupled to GitHub and its infrastructure.

If I switch to some other remote Git solution, if it has webhooks, I should be able to update the script in short order (there are zero dependencies for the script I wrote, and CI through GitHub Actions says it would work in PHP 7.3, I haven't tried going farther back).

That was my Saturday. How was yours?

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

ps. The time from merge to visible so far has been less than 1 second. (Locally, the script runs in about 300ms and uses one exec call.)

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