今日已更新 295 条资讯 | 累计 26278 条内容
关于我们

开发者

编程技术、框架工具、最佳实践

7339
篇文章

共 7339 篇 · 第 259/367 页

The Verge AI

All the gear a 20-year gadget blogging veteran packs when traveling

Through more than two decades of travel for both work and leisure, my packing list has evolved from a random assortment of gadgets and accessories thrown together at the last minute into a refined checklist of gear honed by trial and error. The right packing list, I've found, can be the difference between a good […]

Andrew Liszewski 2026-06-15 19:30 👁 6 查看原文 →
Dev.to

Building Lightweight PHP Microservices with webrium/core — No Framework Bloat Required

Do you really need a full framework to handle a few API endpoints or webhooks? Laravel and Symfony are excellent tools — for large applications. But when you're building a focused microservice, a webhook receiver, or a lightweight REST API, bootstrapping a full-stack framework means carrying hundreds of files, a massive autoloader, and a dependency tree you'll never fully use. That's the problem webrium/core was built to solve: a minimalist, zero-dependency PHP micro-framework written entirely from scratch, designed to stay out of your way. Installation composer require webrium/core That's it. No configuration files to publish, no service providers to register. The Entry Point Every webrium application starts with the same three lines: <?php require_once __DIR__ . '/vendor/autoload.php' ; use Webrium\App ; use Webrium\Route ; App :: initialize ( __DIR__ ); // ... your routes here App :: run (); App::initialize() sets the root path and loads the global helper functions. App::run() initializes error handling and dispatches the current request through the router. Routing The router supports all standard HTTP methods. Route handlers can be closures, a Controller@method string, or an [Controller::class, 'method'] array. Basic routes: Route :: get ( '/status' , fn () => [ 'status' => 'alive' ]); Route :: post ( '/items' , fn () => [ 'created' => true ]); Route :: put ( '/items/{id}' , fn ( $id ) => [ 'updated' => $id ]); Route :: patch ( '/items/{id}' , fn ( $id ) => [ 'patched' => $id ]); Route :: delete ( '/items/{id}' , fn ( $id ) => [ 'deleted' => $id ]); Route handlers return an array — the framework automatically encodes it as JSON and sends the correct Content-Type header. Dynamic parameters: Route :: get ( '/users/{id}/posts/{postId}' , function ( $id , $postId ) { return [ 'user_id' => $id , 'post_id' => $postId , ]; }); Named routes: Route :: get ( '/users/{id}' , fn ( $id ) => [ 'id' => $id ]) -> name ( 'users.show' ); // Generate the URL elsewhere: $url = rout

Benyamin Khalife 2026-06-15 17:56 👁 8 查看原文 →
Reddit r/programming

Reflection architectural pattern

Building software that can change itself without needing to be recompiled is a hard problem, and the reflection architectural pattern is a solid answer to that. I published an article diving into the reflection architectural pattern. If you've ever wondered how Spring Boot uses annotations to magically wire your dependencies, or how ORMs map database fields without explicit code, reflection is the answer. I break down how this pattern actually works, show practical examples, and discuss when you should and shouldn't use it. submitted by /u/Netunodev [link] [留言]

/u/Netunodev 2026-06-15 16:49 👁 6 查看原文 →
The Verge AI

Under-16 social media ban announced by UK government

The UK is the latest country to follow Australia in implementing a total social media ban for children under 16, Prime Minister Keir Starmer has announced. The ban, which could take effect from early next year, will be joined by wider measures that will also prevent children from talking to strangers in online games, livestreaming, […]

Dominic Preston 2026-06-15 16:19 👁 12 查看原文 →