❌

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

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

No les parece que la comunidad de running es de las más fuertes en la City?

No les parece que la comunidad de running es de las más fuertes en la City?

En ciudad de Panamá es muy fácil y accesible pertenecer a una comunidad de running, los eventos están por todos lados y la variedad de carreras lo hace aún más interesante. Algún runner que lo valide ?

submitted by /u/Master-Led-Events to r/Panama
[link] [comments]
  •  

Diversidad y humanismo

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

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]
  •  
❌