❌

Normal 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]

A CMS built on top of a blogging platform.

Seasoned developer here, new to Wordpress. While there is lots to like with Wordpress, and the FSE environment, some of the architectural decisions baffle me.

  1. While I understand the need for backward compatibility, mangling the "wp-posts" database table to contain everything under the sun, many of which are not "posts" at all, is clumsy at best.

  2. Storing pages/scripts/stylesheets/etc in the database (yes the "posts" table), means a developer cannot reasonably use a source code control system like git to manage source code - an absolute requirement when bugs are introduced and things need to be backed out.

  3. On top of these issues, every version of every page/script/stylesheet is stored in the database. Not in a way that you can easily revert back to a known/tagged version, but in a way that just bloats the database in a way that you are only using a small fraction of it at runtime, the rest is just dead baggage.

submitted by /u/GullibleInitiative75 to r/Wordpress
[link] [comments]

Diversidad y humanismo

6 November 2026 at 23:00

En 1974 tuve una breve conversaciΓ³n de mesa con un residente de primer aΓ±o de pediatrΓ­a de la Escuela de Medicina de la Universidad de Tulane. Me decΓ­a mi compaΓ±ero de entrenamiento que le parecΓ­a una medida apropiada que todo panameΓ±o que quisiera viajar a Cuba en los aΓ±os sesenta y setenta tuviera que tener la aprobaciΓ³n del gobierno de los Estados Unidos y que esta constara en su pasaporte. Estaba convencido de la bondad de la autoridad extranjera que nos custodiaba y exponΓ­a la posibilidad de que una persona educada como yo regresara a Nueva Orleans, donde habΓ­a una poblaciΓ³n hondureΓ±a importante, despuΓ©s del viaje a la isla y de la fanfarria revolucionaria de aquellos aΓ±os, y saliera electa para el Senado. El problema era real, porque Fidel Castro, asΓ­ como lo leen, habrΓ­a descubierto mis cualidades para sembrar el comunismo entre la poblaciΓ³n latina desde esa posiciΓ³n de liderazgo. Era 1974. Esa trama solo cabe en la cabeza de una persona β€œculturalizada”, que no es lo mismo que culta, acostumbrada a ver comunismo por todas partes, hasta en el comedor de su casa.

ΒΏPor quΓ© sorprendernos, entonces, de oΓ­r en la propaganda polΓ­tica de la pasada campaΓ±a en ese paΓ­s sandeces como β€œel socialismo se toma AmΓ©rica”, cuando todavΓ­a se alimenta la confusiΓ³n entre socialismo y comunismo? ΒΏPor quΓ© se repiten falsedades como que β€œlos socialdemΓ³cratas del Partido Azul son comunistas radicales”? En ese marco narrativo y en ese proceso psicolΓ³gico de meter miedo y amedrentar que vivimos en el siglo XX, la cultura popular fue sumergida en la ignorancia sobre la vida en la ribera norteΓ±a del golfo de MΓ©xico. La ΓΊnica democracia estaba precisamente en la frontera norte con LatinoamΓ©rica, donde tambiΓ©n se excluΓ­an de las lecciones de democracia la esclavitud y sus crΓ­menes, la discriminaciΓ³n y sus injusticias y la planificaciΓ³n de asesinatos polΓ­ticos. Entonces, ΒΏpor quΓ© sorprendernos del miedo acΓ‘ abajo ante el hecho de que el 3 de noviembre el pueblo norteamericano conservΓ³ su derecho a pronunciarse en las urnas y lo hizo con vigor sobre el encarecimiento de los alimentos, los precios de la gasolina, el deterioro de la educaciΓ³n y la salud, el desprecio por las leyes y la letra de la ConstituciΓ³n y la corrupciΓ³n para el enriquecimiento de amigos y familiares multimillonarios?

Curiosamente, son las mismas voces agoreras que no se han pronunciado sobre el autoritarismo antidemocrΓ‘tico, el abandono de compromisos sanitarios y de alimentaciΓ³n a nivel mundial, las amenazas de tomarse paΓ­ses y vΓ­as marΓ­timas, el irrespeto de Trump cuando miente o se refiere en tΓ©rminos despectivos a gobernantes extranjeros y el maltrato fΓ­sico y emocional a migrantes y a ciudadanos de determinados paΓ­ses, a quienes denigra o asesina sin pruebas. A esos migrantes se les condena a vivir sin seguro social, sin seguro mΓ©dico y sin acceso a alimentos baratos. Sin embargo, en 2022 pagaron 96.7 mil millones de dΓ³lares en impuestos y 25.7 mil millones de dΓ³lares en cheques para el seguro social. Bien lo ha dicho Anne Applebaum. Estas elecciones fueron por algo mΓ‘s fundamental que el control del Congreso. Los norteamericanos salieron a votar para decidir si los Estados Unidos seguirΓ‘n siendo una democracia, como lo soΓ±aron hace 250 aΓ±os sus fundadores. El presidente Trump ha tratado de manipular esa democracia desde la presidencia mediante la redistribuciΓ³n de distritos para afectar los resultados electorales en los lugares donde los votantes le son adversos. Un esfuerzo agΓ³nico por controlar a su antojo, justo cuando la plata perdiΓ³ su dueΓ±o y su brillo.

El poder demostrado por el Partido DemΓ³crata se debe a su diversidad. Distribuidos en un nΓΊmero significativo en todos los cargos de elecciΓ³n estΓ‘n hombres y mujeres norteamericanos con ancestros de varios continentes, diversas religiones y creencias, colores y lenguas. No extraΓ±a que la libertad religiosa que reclamamos los catΓ³licos para practicar nuestras oraciones y nuestros ritos se la neguemos a los judΓ­os o a los musulmanes y hasta divulguemos falsedades sobre sus motivos. Entre los elegidos hay trabajadores humildes y profesionales que superaron la pobreza para alcanzar sueΓ±os de justicia y libertad. Al menos se eligieron 17 mujeres para los cargos de gobernadoras, 13 de ellas del Partido DemΓ³crata; 25 mΓ©dicos para diversos cargos de elecciΓ³n, 20 de ellos tambiΓ©n demΓ³cratas; y 9 indios americanos, todos demΓ³cratas. Todos estΓ‘n preocupados por que se pueda acceder sin restricciones al bienestar, la salud y el trabajo. La atenciΓ³n mΓ©dica cΓ‘lida y pronta, la seguridad social para el retiro, las escuelas pΓΊblicas excelentes, los beneficios y cuidados para los veteranos de guerra, la seguridad frente al desempleo, las bibliotecas pΓΊblicas y el seguro para proteger tus depΓ³sitos bancarios son los programas β€œsocialistas” a los que se teme.

El 3 de noviembre resultΓ³ ser una fiesta para hablar en alta voz. El temor a que se acallara esa voz fue vencido por la convicciΓ³n. Como quiera decirse, el voto fue con Trump en la papeleta. Aun frente a este espectΓ‘culo anunciado, la fuerza por la libertad, el amor por la justicia y el disgusto por la corrupciΓ³n no esperaban que de las cenizas de la institucionalidad resurgieran estas aspiraciones. El escenario fue vibrante.

El autor es neonatΓ³logo y pediatra.

Banderas de Estados Unidos con el Capitolio al fondo. / Getty Images

Mexico's Senate Approves ISP Rules To Disconnect Persistent Online Pirates

By: BeauHD
6 November 2026 at 22:30
An anonymous reader quotes a report from TorrentFreak: On Tuesday, Mexico's Senate approved (PDF) a reform of the Federal Copyright Law that ties ISP liability to having a policy to terminate repeat infringers. [This policy has to be published permanently on their website and in their terms of service, and it must include a basic way to notify users. In other words, what can be terminated is the Internet connection itself, not just an account. According to Mexican business outlet EL CEO, this means that access providers such as Telmex and Izzi will need such a policy.] The Senate approved the amendments with roughly two-thirds of the vote, as the opposition voted against. The Chamber of Deputies already approved the same text in October, so the decree now goes to President Claudia Sheinbaum. Her government proposed the changes in May to bring the law in line with the USMCA trade agreement between Mexico, the United States and Canada. [...] Providers that don't comply risk facing liability. Under the new rules, any ISP that fails to meet its safe harbor conditions becomes liable for its users' infringements if it knowingly contributes to, induces, or causes the infringement. The same goes for an ISP that can control the infringing user and profits directly from the infringement. In both cases, the Mexican Institute of Industrial Property (IMPI) can fine the provider up to roughly 4.7 million pesos (~$250,000), depending on the infringement. The law doesn't explicitly define the term repeat infringer, nor does it say how many piracy accusations it takes before a subscriber can be cut off. According to Aurora Lopez-Portillo, director of legal services at IP firm ClarkeModet, each provider has to decide its own threshold. She told EL CEO that ISPs should also check whether the accusations actually hold up, while giving users a chance to respond, even though the law doesn't require that. During Tuesday's Senate debate, some lawmakers in the opposition raised similar concerns. Senator Gabriel Elizondo warned that families can share a single connection, so the pirating activities of one person could leave an entire household offline. Previously, opposition lawmakers proposed requiring a court order before Internet service could be suspended, but that proposal was not adopted. [...] There, failing to meet the safe harbor conditions, including the repeat infringer policy, is the first requirement for liability. If an ISP also contributes to infringement with knowledge of it, or can control the infringer and directly profits from it, it can be held responsible. The new repeat infringer rules will take effect 180 days after their publication in Mexico's official gazette, which hasn't happened yet as far as we can see. How Mexican ISPs will define a repeat infringer, and how many accusations it takes, has yet to be seen.

Read more of this story at Slashdot.

Built an embeddable, zero-dependency DevTools overlay for React & Next.js to inspect fetch requests and browser storage in-app

Hey r/reactjs!

I got tired of constantly opening browser DevTools, filtering out noisy browser extensions, and switching between tabs just to check local storage or quick fetch responses during local development.

To solve this, I built React Dev Companion β€” a lightweight, zero-dependency developer tools overlay that embeds directly into your React / Next.js application UI.

πŸ’‘ Key Features:

  • Real-Time Network Interception: Intercepts native window.fetch non-invasively to capture HTTP methods, endpoints, and status codes.
  • Storage Inspector: Switch between localStorage, sessionStorage, and cookies to view, inject, or delete keys in real-time.
  • Zero Extra Dependencies: Designed to keep bundle overhead minimal.
  • Dev-Only Friendly: Easy to mount conditionally (e.g., inside Next.js Root Layout or Vite main component).

πŸ” Quick Example (Next.js App Router):

```tsx 'use client'; import { DevCompanion } from 'react-dev-companion';

export default function RootLayout({ children }: { children: React.ReactNode }) { return ( <html lang="en"> <body> {children} {process.env.NODE_ENV === 'development' && <DevCompanion />} </body> </html> ); } ```

We set up a strict CI/CD pipeline using GitHub Actions, TypeScript, Conventional Commits, and Husky to keep the codebase clean.

πŸ™ GitHub Repository: https://github.com/Kickz1nn/react-dev-companion
πŸ“– Dev.to Article: https://dev.to/kickz1nn/building-an-embeddable-zero-dependency-devtools-panel-for-react-nextjs-3ic6

I'd love to hear your thoughts, feedback, or any features you'd like to see added next!

submitted by /u/Kickz1nn to r/reactjs
[link] [comments]

Open-sourced the core of my React desktop app: local SQLite, Node server inside a Tauri shell, Ollama assistant. Free download.

Burrow is a personal-data desktop app (budget, journal, todos, habits, notes). The stack is a Vite and React frontend, a Node server that owns a single SQLite database, and a Tauri shell that packages the two into a Windows installer for x64 and ARM64.

Things in the repo that might interest React devs:

- A hard JavaScript bundle budget enforced in CI, with the number pinned in a test so it cannot creep.

- Visual regression baselines regenerated on a side branch in CI rather than committed from dev machines.

- Modules are isolated under src/modules and server/modules with a small shared envelope for API errors.

- The assistant UI streams from a local Ollama server, so no API keys anywhere in the app.

It went free this week and the core is AGPL. Links in the comments.

submitted by /u/Revibed69 to r/reactjs
[link] [comments]
❌