Download the PHP package yuinijika/anon without Composer

On this page you can find all versions of the php package yuinijika/anon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package anon

Anon Framework Next Skeleton

Anon Framework Next 是一个现代化的 PHP 后端 API 框架。本仓库是它的应用骨架(Skeleton)。

默认骨架刻意保持轻量,初始化时只保留少量最基础的示例路由和一个简单控制器,方便你像使用 ThinkPHP 一样,创建项目后直接开始改业务代码,而不是先清理一堆复杂 demo。

核心架构设计

框架采用了分离式架构:

目录结构

快速开始

1. 创建项目

2. 环境与项目配置

框架推荐将结构化配置写入 anon.config.php,将密码、密钥、环境差异值保留在 .env* 中。

直接修改根目录下的 .envanon.config.php 即可。

默认骨架里的 anon.config.php 会刻意保持精简,只预置:

像数据库、队列、日志、更完整的 Auth 选项这类配置,不会默认全部塞进去;需要时再按文档逐步加回去即可。

框架同时支持类似 Vite 的环境文件分层加载:

框架启动时会优先读取 anon.config.php,未配置的项目会继续回退到 .env 中的旧环境变量,便于平滑升级。

3. 启动开发服务器

框架内置了轻量 CLI 工具,你可以直接启动本地开发服务器:

服务器默认监听 http://127.0.0.1:8000

默认示例

创建项目后,骨架默认只提供 5 个非常基础的示例接口:

它们分别演示了:

例如:

默认示例控制器在 app/controller/Index.php,默认路由在 app/route/main.php

你通常只需要直接修改这两个文件,就可以开始写自己的项目。

如果你需要更完整的开发示例,例如:

建议直接查看 vitepress/docs/guide/architecture/router.md,这些示例会统一维护在文档中,而不是继续塞回默认骨架。

推荐起步方式

如果你想像 ThinkPHP 那样快速上手,建议按下面的顺序开始:

  1. app/route/main.php
  2. app/controller/Index.php
  3. 按需调整 anon.config.php
  4. 需要数据库、认证、队列时,再逐步接入对应能力

一个最小路由示例:

常用命令

anon 命令行工具提供了一些实用的代码生成器,帮助你快速搭建业务骨架:

推荐在控制器目录中使用这种更接近 ThinkPHP 的分层方式:

如果你喜欢字符串控制器写法,也可以直接这样注册路由:

如果你的控制器就是标准 CRUD,也可以直接使用:

如果你只想保留部分资源动作,也可以这样:

更新动作同时支持 PUTPATCH

按需扩展

框架本身已经支持:

但这些能力不再默认堆在骨架首页示例里,而是建议你在真正需要时再接入。这样初始化项目会更干净,也更接近传统 PHP 框架的使用习惯。

生产部署建议

推荐在生产环境使用 .env.production 或由部署平台注入环境变量,并在发布完成后立即构建运行时缓存:

如果你更新了以下内容,建议重新生成缓存:

推荐发布顺序如下:

当前 route:cache 仅支持控制器路由;如果你的生产路由中仍然包含闭包,需要先改为控制器动作再进行缓存。

官方文档

详细的框架使用指南(包括配置、容器、路由、中间件、数据库、Auth、Queue 等),请查看仓库中的 vitepress/docs

许可证 (License)

本项目遵循 MIT 许可证。


All versions of anon with dependencies

PHP Build Version
Package Version
Requires yuinijika/anon-core Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yuinijika/anon contains the following files

Loading the files please wait ...