renoki-co/l1
Composer 安装命令:
composer require renoki-co/l1
包简介
Laravel integration for Cloudflare Workers services.
关键字:
README 文档
README
Extend your PHP/Laravel application with Cloudflare bindings.
This package offers support for:
🚀 Installation
You can install the package via Composer:
composer require renoki-co/l1
🙌 Usage
D1 with raw PDO
Though D1 is not connectable via SQL protocols, it can be used as a PDO driver via the package connector. This proxies the query and bindings to the D1's /query endpoint in the Cloudflare API.
use RenokiCo\L1\D1\D1Pdo; use RenokiCo\L1\D1\D1PdoStatement; use RenokiCo\L1\CloudflareD1Connector; $pdo = new D1Pdo( dsn: 'sqlite::memory:', // irrelevant connector: new CloudflareD1Connector( database: 'your_database_id', token: 'your_api_token', accountId: 'your_cf_account_id', ), );
D1 with Laravel
In your config/database.php file, add a new connection:
'connections' => [ 'd1' => [ 'driver' => 'd1', 'prefix' => '', 'database' => env('CLOUDFLARE_D1_DATABASE_ID', ''), 'api' => 'https://api.cloudflare.com/client/v4', 'auth' => [ 'token' => env('CLOUDFLARE_TOKEN', ''), 'account_id' => env('CLOUDFLARE_ACCOUNT_ID', ''), ], ], ]
Then in your .env file, set up your Cloudflare credentials:
CLOUDFLARE_TOKEN=
CLOUDFLARE_ACCOUNT_ID=
CLOUDFLARE_D1_DATABASE_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
The d1 driver will proxy the PDO queries to the Cloudflare D1 API to run queries.
🐛 Testing
Start the built-in Worker that simulates the Cloudflare API:
cd tests/worker
npm ci
npm run start
In a separate terminal, run the tests:
vendor/bin/phpunit
🤝 Contributing
Please see CONTRIBUTING for details.
🔒 Security
If you discover any security related issues, please email alex@renoki.org instead of using the issue tracker.
🎉 Credits
renoki-co/l1 适用场景与选型建议
renoki-co/l1 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 21.46k 次下载、GitHub Stars 达 161, 最近一次更新时间为 2023 年 10 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「php」 「sqlite」 「query」 「laravel」 「cloudflare」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 renoki-co/l1 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 renoki-co/l1 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 renoki-co/l1 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
The tenancy/tenancy database driver for sqlite
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Slimmed down concise interfaces and query builder for database queries and transactions which can be layered / decorated.
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 21.46k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 161
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2023-10-02