GyaanSetu PHP

PHP, Laravel and WordPress.

28 articlesDeep, practical knowledge

Laravel 13, $fillable, $table ਅਤੇ $casts ਨੂੰ Native PHP Attributes ਨਾਲ ਬਦਲ ਰਿਹਾ ਹੈ

Laravel 13 ਮਾਡਲ ਕੌਂਫਿਗਰੇਸ਼ਨ ਲਈ ਬਿਲਟ-ਇਨ PHP attributes ਪੇਸ਼ ਕਰਦਾ ਹੈ, ਜੋ ਤੁਹਾਨੂੰ ਮੌਜੂਦਾ ਕੋਡ ਨੂੰ ਖਰਾਬ ਕੀਤੇ ਬਿਨਾਂ ਰਵਾਇਤੀ $table, $fillable ਅਤੇ $casts ਪ੍ਰੋਪਰਟੀਜ਼ ਨੂੰ typed, reflection-based annotations ਨਾਲ ਬਦਲਣ ਦੀ ਇਜਾਜ਼ਤ ਦਿੰਦਾ ਹੈ।

PHP · 4 min read

Cloudflare Workers Cut Video Site Thumbnail CPU to Zero

By moving thumbnail generation to Cloudflare Workers, the video-hosting platform eliminated all image-processing load on its origin servers, achieved a 96% edge cache hit rate, and consistently delivered sub-second image responses worldwide.

PHP · 3 min read

ਤੁਹਾਡਾ file exists() ਗੁਪਤ ਤਰੀਕੇ ਨਾਲ ਇੱਕ ਨੈੱਟਵਰਕ ਕਾਲ ਹੈ

ਤੁਹਾਡਾ file exists() ਗੁਪਤ ਤਰੀਕੇ ਨਾਲ ਇੱਕ ਨੈੱਟਵਰਕ ਕਾਲ ਹੈ। ਤੁਸੀਂ ਇਹ ਲਾਈਨ ਹਜ਼ਾਰ ਵਾਰ ਲਿਖਦੇ ਹੋ: if ( file exists( $path ) ) { ਇਹ ਸੁਰੱਖਿਅਤ ਲੱਗਦਾ ਹੈ। ਇਹ ਤੇਜ਼ ਲੱਗਦਾ ਹੈ। ਪਰ ਜੇਕਰ $path ਕਿਸੇ S3 bucket ਵੱਲ ਇਸ਼ਾਰਾ ਕਰਦਾ ਹੈ...

PHP · 2 min read

PHP Adds Native Polling API, Giving Fibers OS-Level Speed

The newly merged Polling API wraps epoll, kqueue and IOCP, letting the event loop resume fibers with a single system call. Benchmarks show concurrency overhead drops to zero and CPU usage stays flat even with dozens of streams.

PHP · 3 min read