❌

Reading view

I built AmunCode Config β€” a lightweight configuration and environment-loading library for PHP

Hey everyone!

I've been working on a small PHP library called AmunCode Config, and I'm sharing its first stable release.

The idea is simple: provide a lightweight, framework-independent way to load environment variables, load PHP configuration files, and access configuration values without introducing a large framework or unnecessary abstractions.

What does it provide?

The package currently has four main classes:

  • EnvironmentLoader β€” loads .env files using PHP dotenv, with optional or required file loading.
  • Env β€” retrieves environment variables from $_ENV, $_SERVER, and getenv(), with automatic value normalization.
  • ConfigurationLoader β€” discovers and loads PHP configuration files from a directory.
  • Config β€” provides dot-notation access to configuration values, including retrieving, updating, and recursively merging configuration arrays.

A quick example

use AmunCode\Config\Config; use AmunCode\Config\EnvironmentLoader; // Load environment variables. $environment = new EnvironmentLoader(); $environment->load($root); // Load PHP configuration files. $config = new Config($root . '/config'); // Retrieve configuration values. $appName = $config->get('app.name', 'My Application'); $dbHost = $config->get('database.host'); // Update configuration. $config->set('app.debug', true); 

A few design decisions:

  • Environment loading and configuration loading are separate operations.
  • Environment variables are not overwritten by .env values when already defined.
  • Empty environment values are preserved rather than silently replaced by defaults.
  • The package doesn't automatically define a global env() helper.

Technical details

  • PHP 8.4.1+
  • Symfony Finder
  • PHP dotenv
  • Composer package
  • MIT License
  • PHPUnit tests and GitHub Actions CI

Installation

composer require amuncode/config 

Source code: https://github.com/AmunCode-OSS/Config

Documentation and usage examples are available in the repository README.

I'd appreciate feedback from other PHP developers, particularly on the API design, class responsibilities, and whether anything important is missing or could be simpler.

Thanks for taking a look!

submitted by /u/AmunCode to r/PHP
[link] [comments]
  •  

What an AI agent needs from a PHP framework to write code you can actually trust

I'm the author of Kinetis ( https://kinetis.dev/ ), a PHP framework for persistent workers. I wrote up an experiment: AI agents built a small JSON API from a fresh skeleton in about 15 minutes, with 50 tests, a clean PHPStan run and an independent review.

My takeaway: speed isn't the hard part, trust is. What made this run's output checkable:

  • The agent read the installed package versions and vendor source, not what it remembered from training.
  • The reviewer cited a file and line for every claim.
  • The endpoint code is declarative (readonly DTO + backed enum), so there's little to get wrong and little to review.

Full write-up and video: https://kinetis.dev/blog/posts/rest-api-in-15-minutes-kinetis-orbitron.html

Would you trust this workflow in a real codebase? What would you want a framework to expose to agents?

submitted by /u/Normal_Tadpole_8061 to r/PHP
[link] [comments]
  •  

What a joke, php-baremetal emulated on the web

It almost seems like a joke, php-baremetal that brings php to microcontrollers with the new sdk that will be released soon it will be possible to emulate it on the web,

We are working with solutions that allow us to emulate microcontrollers online and the first tests are fantastic.

to give you an example today it is already compatible with the official emulator of espressif https://espressif.github.io/esp-emulator/

in this case the firmware is executed bit by bit as normal firmware made for esp32

Funny how you go back to origins, right?

submitted by /u/One-Mongoose-6961 to r/PHP
[link] [comments]
  •  

I got tired of running 5 terminal tabs for every Laravel project, so I built a lightweight desktop cockpit

Hey everyone!

If you work on multiple Laravel projects locally, your daily routine probably looks like this:

  1. Terminal 1: php artisan serve
  2. Terminal 2: npm run dev (Vite)
  3. Terminal 3: php artisan queue:work
  4. Port 8000 is mysteriously blocked by a background process from yesterday.
  5. Digging through seeders or old .env files trying to remember the test admin login.
  6. Switching projects means killing everything and repeating the whole cycle.

To solve this friction, I built DevDock β€” a lightweight desktop app that gives you a single unified cockpit for all your local projects.

What it does:

  • πŸ“ Instant Project Discovery: Point it at your projects folder and it scans and detects all your Laravel applications, their framework versions, Vite configurations, and PHP requirements in milliseconds.
  • ⚑ 1-Click Full Stack Launch: Starts your Artisan backend, Vite frontend, and background workers together. Ports are auto-allocated so you never get a port collision again.
  • πŸ”€ Per-Project PHP Isolation: Assign different PHP versions (8.1, 8.2, 8.3) to different projects without messing with your system PATH.
  • πŸ” Project Vault: Keep your local admin logins, test credentials, and dev notes pinned directly to each project with 1-click copy buttons.
  • πŸ“„ Unified Live Console: Watch live streaming logs for all running services in one filterable window instead of jumping across terminal tabs.
  • πŸͺΆ Ultra-Lightweight: Uses under ~38 MB of RAM at idle β€” starts instantly and doesn't drain your laptop battery.

πŸš€ Looking for Beta Testers!

I'm currently opening this up for early feedback from other developers. I'd love to know:

  1. How do you currently handle running multiple local projects (Herd, Valet, manual terminals)?
  2. What feature would make this an instant daily tool for you?

All feedback, feature requests, and honest critiques are welcome!

submitted by /u/Desperate-Charge2302 to r/PHP
[link] [comments]
  •  

Looking for beta testers: Laravel on AWS Lambda, in your own AWS account (Arco Cloud)

Hi r/PHP πŸ‘‹

I'm opening the beta of Arco Cloud and I'm looking for Laravel devs who want to try running their apps on AWS Lambda, without managing the AWS side themselves.

What it is

Arco is an open-source CLI (https://github.com/multi-api/arco) that deploys Laravel to AWS Lambda Web Functions with FrankenPHP + Octane. Arco Cloud is the dashboard on top: connect your AWS account and GitHub repo, push, and it deploys. Your app runs in YOUR AWS account. We never proxy your traffic or hold your data.

What you get in the beta

β€’ Push to deploy, with queues, scheduler, storage and cache set up for you

β€’ X-Ray tracing: every request and job broken down step by step (boot, routing, each SQL query, AWS and HTTP calls)

β€’ Monitoring: errors grouped by type, live log search and metrics

β€’ Alerts on Slack and email when something fails

β€’ AWS cost per environment

β€’ Run artisan commands from the browser

β€’ Failed jobs and one-click dead-letter queue redrive

β€’ Managed Aurora DSQL databases (IAM auth, no passwords)

β€’ Private networks with a static outbound IP

β€’ Team 2FA, and a Laravel starter template to get going in minutes

How to join

  1. Sign up at https://staging.arcocloud.app

  2. Click "Request beta access" and tell me a bit about your project

  3. I review every request myself, and I'll personally help you move your first app

What I'm asking in return: honest feedback. What's confusing, what's missing, and what would make you switch from Vapor, Bref, Forge or your own setup.

Questions are welcome here, in our Slack (https://join.slack.com/t/arco-equipo/shared\_invite/zt-4fi2aejbq-fzwl8U\_4qeqSOxO6TtNoPg) or on GitHub Discussions (https://github.com/multi-api/arco/discussions).

Thanks! πŸ™

submitted by /u/jgamboa-cl to r/PHP
[link] [comments]
  •  

After patching php2shell, how do you check nothing is still running the old PHP?

Debian restarts php-fpm when PHP updates, and a reload replaces the workers. But queue workers, supervisord programs and PHP in containers keep the old binary in memory until someone restarts them, and package scanners still report the CVE as fixed.

I hit this patching client servers last week, so I wrote a small open source check that lists PHP processes still running a deleted, pre-upgrade binary and checks the installed version against the vendor’s fix: github.com/asifh0ssain/stillmapped

How are others handling this? Do you restart workers as part of every PHP update, or rely on deploys to do it?

submitted by /u/asifhoss to r/PHP
[link] [comments]
  •  

Designed Once, Usable Everywhere: why PHP 8.6 adds SortDirection and Time\Duration to the standard library

u/timwolla wrote up the reasoning behind two small PHP 8.6 additions: a SortDirection enum and a Time\Duration class.

The short version: a GitHub search found 150+ mutually incompatible SortDirection enums, and PHP's own stdlib expresses durations in at least six different units and formats. Putting one canonical type in core gives libraries a common language and removes the glue code between them.

The post also covers:

  • Why the RFCs were intentionally kept minimal, with a clearly stated future scope
  • Using new namespaces (Random\, Dom\, Uri\, Time\) to replace legacy APIs without breaking BC
  • The in-discussion Time\Instant / Time\Clock RFC that builds on Duration
  • How to help: testing pre-releases, accepting the new types via union types in your libraries, and weighing in on internals
submitted by /u/elizabethn to r/PHP
[link] [comments]
  •  

The PHP Foundation raised ~$71k in one-time donations in October

I would add an image but apparently the sub doesn't allow it (or Reddit is being unhelpful to me). The usual volume of one-time contributions each month tends to be less than $1k. So roughly ~$70k was raised directly due to PHP2Shell.

You can see this by going to https://opencollective.com/phpfoundation#category-BUDGET and by adjusting the filters of the Contributions section. Set it to This Year and click the bar graph icon.

The reoccurring contributions also went up, but I'm not sure how to interpret that as it's down in November already. Maybe they are yearly contributions? Maybe the reoccurring contributions show up on the day of the month they are withdrawn and it's only Nov 2? Not sure.

submitted by /u/MorrisonLevi to r/PHP
[link] [comments]
  •  

The php2shell drama showed us where our priorities really are.

Nothing highlights PHP's core demographic quite like Ondrej getting a full year of funding in a week for legacy builds while the PHP Foundation barely gets a nod. We'll pay anything to keep PHP 5.6 on life support, but won't throw a dime at the heroes building the core language. Priorities, I guess!

submitted by /u/Antique_Mechanic133 to r/PHP
[link] [comments]
  •  

Released Commentify 4.4

Commentify 4.4 is out, with over 18k installs, MIT, Laravel Livewire comments for any Eloquent model. Tailwind or Bootstrap, nested replies, markdown, likes, reports, guests, optional Filament admin. PHP 8.3+, Laravel 12 or 13, Livewire 4.

What changed:

  • Filament: a modal used to reuse the first record's comments component. The Livewire thread is now keyed to the record and the thread name, so the modal shows the record you opened and two threads on one model do not collide. CommentsEntry::make() drops that thread on an edit or relation manager form.
  • Notifications: with the flag on, a reply notifies the parent author. A top-level comment notifies the commentable's user when that relation exists. The notification is queued and waits until the transaction commits. The mail button is included only when the comment URL is on your app.url host, so a request referer cannot send the recipient off your app.
  • Minimum PHP is now 8.3.

Install guide:

https://docs.commentify.pro/installation

submitted by /u/usamamuneer to r/PHP
[link] [comments]
  •  
❌