ionzile/ions
Composer 安装命令:
composer create-project ionzile/ions
包简介
Application starter for the Ions PHP framework — a secure, structured host-app skeleton on Symfony HTTP + Illuminate, ready for `composer create-project`.
README 文档
README
A minimal host application for the Ions PHP framework (ionzile/core). This is the published starter — create a new app with one command.
Quick start
composer create-project ionzile/ions my-app
cd my-app
cp .env.example .env # set APP_KEY in .env (64-char hex): php -r "echo bin2hex(random_bytes(32)), PHP_EOL;" # sanity-check the setup (APP_KEY, writable var/, DB, security posture): php bin/ions doctor php bin/ions serve # dev server on http://127.0.0.1:8000 (--host/--port)
(serve wraps PHP's built-in server — php -S localhost:8000 -t public
works just as well if you prefer the raw command.)
Open http://localhost:8000 — you should see the welcome page. curl localhost:8000/api/ping returns JSON.
Serving behind nginx or Apache? public/.htaccess ships the Apache rewrite;
for the full nginx/Apache configs, PHP-FPM notes and the deploy checklist see
docs/deploy.md in ionzile/core.
Local HTTP dev: session cookies are
Secureby default (4.1). If you need session/CSRF over plainhttp://localhost, set'cookie_secure' => 'auto'inconfig/session.php.
Where things live
| Path | Purpose |
|---|---|
public/index.php |
Front controller (Kernel::boot() + Kernel::run()) |
bin/ions |
Console (php bin/ions list, make:*, migrate, queue:work, optimize, doctor) |
config/ |
One PHP file per namespace: app.php → config('app.*'), … |
routes/web.php, routes/api.php |
Route definitions (Ions\Bundles\Route) |
app/ |
Application code (App\ PSR-4): models in app/Models, controllers in app/Http/Controllers, API controllers in app/Http/Api, commands in app/Commands, service providers in app/Providers (auto-discovered — no app.providers entry needed; see docs/config.md in ionzile/core) |
database/ |
Standard data layout (4.4+): migrations/, seeders/ (Database\Seeders), factories/ (Database\Factories), schemas/, backups/. The two Database\… sub-namespaces are PSR-4-mapped in composer.json. |
views/ |
Twig templates |
public/uploads, public/lang |
Uploads disk root, translation files |
var/ |
Writable: cache/, logs/, templates/ (compiled Twig) |
Generators: php bin/ions make:command|make:middleware|make:service-provider|make:resource|make:request|make:job|make:event|make:listener|make:test <Name> scaffold the corresponding class into app/ (or tests/ for make:test) — see docs/console.md in ionzile/core.
Frontend assets
The skeleton ships no frontend tooling — pick a scaffold when you need one:
php bin/ions install:vue— Vue 3 + Vite (dev server with HMR, hashed builds inpublic/build/, loaded via thevite()Twig function).php bin/ions install:assets— plain CSS/JS starters inpublic/assets/, linked viaasset()with filemtime cache-busting. No node required.
See docs/assets.md in ionzile/core.
Testing
The skeleton ships runnable test scaffolding: pestphp/pest in require-dev,
a phpunit.xml pointing at tests/, and tests/ExampleTest.php. Run the
suite with vendor/bin/pest (or composer test).
The framework ships a host-app test kit: subclass Ions\Testing\TestCase,
point $basePath at this directory, and drive the full HTTP stack in-process
(no web server). See docs/testing.md in ionzile/core for the full guide.
final class PingTest extends \Ions\Testing\TestCase { protected string $basePath = __DIR__ . '/..'; // app root (from tests/) public function test_ping(): void { $this->get('/api/ping') ->assertOk() ->assertJsonPath('data.message', 'pong'); } }
actingAs($userIdOrUser) issues a real JWT for protected /api routes —
it requires APP_KEY (≥ 32 bytes) in the .env used by your tests.
Test fakes ship with the kit: Queue::fake(), Event::fake(),
Storage::fake() and Mail::fake() swap the real service for a recorder
with assertion helpers (assertDispatched, assertFired, assertStored,
assertSent, …) — see the Fakes section of docs/testing.md.
Production notes
- Set
APP_DEBUG=falseand runphp bin/ions optimize(route + config caches). - CORS is deny-by-default; configure
app.cors.originswhen serving cross-origin traffic. - Review
UPGRADE-4.1.mdinionzile/corefor the 4.1 security defaults this skeleton embraces. - Growing the app?
docs/best-practices.mdinionzile/coreis the opinionated structure guide this layout follows.
ionzile/ions 适用场景与选型建议
ionzile/ions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 106 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 02 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「framework」 「symfony」 「php」 「boilerplate」 「Skeleton」 「illuminate」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ionzile/ions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ionzile/ions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ionzile/ions 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Framework HLEB2 is the foundation of the web application. Provides ease of development and application performance.
The bundle for easy using json-rpc api on your project
Bundle Symfony DaplosBundle
Alfabank REST API integration
High-performance, opinionated PHP 8 web framework with O(1) routing, parallel async MySQL, type-safe asset bridge, and React-island frontend
Biblioteca PHP pura para pagamentos SISP/Vinti4 de Cabo Verde.
统计信息
- 总下载量: 106
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-28