PHPackages                             kcloze/ycf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. kcloze/ycf

ActiveLibrary[CLI &amp; Console](/categories/cli)

kcloze/ycf
==========

A simple PHP framework for api or cli application

292PHP

Since May 27Pushed 10y ago3 watchersCompare

[ Source](https://github.com/kcloze/ycf)[ Packagist](https://packagist.org/packages/kcloze/ycf)[ RSS](/packages/kcloze-ycf/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ycf framework
-------------

[](#ycf-framework)

- a very simple,micro PHP framework
- it can be run in Cli,PHP-FPM,Swoole
- composer install and name space auto load
- a solution for micro-services and blazing fast APIs

Requirements
------------

[](#requirements)

- PHP 5.3+

Installation
------------

[](#installation)

1. git clone  your-app
2. cd your-app and run: composer install
3. chmod -R 777 src/runtime/
4. edit src/config/settings.ini.php for mysql config or redis,add test table([https://github.com/kcloze/ycf/blob/master/pdo\_test.sql](https://github.com/kcloze/ycf/blob/master/pdo_test.sql))

How to run
----------

[](#how-to-run)

\###php-fpm
run in php-fpm: Open your browser and enter [http://youhost/index.php?ycf=hello&amp;act=hello](http://youhost/index.php?ycf=hello&act=hello)

if set nginx as follow,url can be simple:

```
        location / {
                if (!-e $request_filename){
                         rewrite ^/(.*) /index.php last;
                 }
        }

```

\###cli ####run in cli:

- php index.php ycf=hello act=hello

\###swoole run with swoole:

- php env in you path
- chmod u+x server.sh
- ./server.sh

Documentation
-------------

[](#documentation)

- in src/service/ ,you can add your business code here
- Naming Conventions:
- ---service class name :YcfYourname.php
- ---method name : public static function actionYourname()
- [DB Class Use](doc/db.md)
- if you need redis,shoud install phpredis extention()

\##How to use Task

```
public function actionTask()
    {
        // send a task to task worker.
        $param = array(
            'action' => 'test',
            'time'   => time(),
        );
        //var_dump(HttpServer::getInstance()->http);
        //$this->http->task(json_encode($param));
        for ($i = 0; $i < 1; $i++) {
            $taskId = YcfCore::$_http_server->task(json_encode($param));
        }
        echo $taskId . " hello ycf" . time();

    }

```

Benchmarks
----------

[](#benchmarks)

[benchmarks](doc/benchmarks.md)

Community
---------

[](#community)

mail: qq群: 141059677

\##License The ycf framework is open-sourced software licensed under the MIT license

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1489176?v=4)[kcloze](/maintainers/kcloze)[@kcloze](https://github.com/kcloze)

---

Top Contributors

[![kcloze](https://avatars.githubusercontent.com/u/1489176?v=4)](https://github.com/kcloze "kcloze (1 commits)")

---

Tags

apicliswoole

### Embed Badge

![Health badge](/badges/kcloze-ycf/health.svg)

```
[![Health](https://phpackages.com/badges/kcloze-ycf/health.svg)](https://phpackages.com/packages/kcloze-ycf)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
