[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-6618":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":31,"discoverSource":32},6618,"yaf","laruence\u002Fyaf","laruence","Fast php framework written in c, built in php extension","http:\u002F\u002Fpecl.php.net\u002Fpackage\u002Fyaf",null,"C",4516,1361,438,100,0,2,4,31.4,"Other",false,"master",true,[25,26,27,5],"c","php","php-framework","2026-06-12 02:01:27","# Yaf - Yet Another Framework  \n[![Build status](https:\u002F\u002Fci.appveyor.com\u002Fapi\u002Fprojects\u002Fstatus\u002Fawii6wf2ocmy202p\u002Fbranch\u002Fmaster?svg=true)](https:\u002F\u002Fci.appveyor.com\u002Fproject\u002Flaruence\u002Fyaf\u002Fbranch\u002Fmaster) [![Build Status](https:\u002F\u002Fgithub.com\u002Flaruence\u002Fyaf\u002Fworkflows\u002Fintegrate\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Flaruence\u002Fyaf\u002Factions?query=workflow%3Aintegrate)\n\nYaf is a PHP framework with high performance, it is written in c and built as a PHP extension\n\n## Requirement\n- PHP 7.0+  (master branch))\n- PHP 5.2+  ([php5 branch](https:\u002F\u002Fgithub.com\u002Flaruence\u002Fyaf\u002Ftree\u002Fphp5))\n\n## Install\n### Install Yaf \nYaf is a PECL extension, which means you can simply install it by:\n\n```\n$pecl install yaf\n```\n### Compile Yaf in Linux\nOf course, you could also install it by hand:\n```\n$\u002Fpath\u002Fto\u002Fphpize\n$.\u002Fconfigure --with-php-config=\u002Fpath\u002Fto\u002Fphp-config\n$make && make install\n```\n\n## Document\nYaf manual could be found at: http:\u002F\u002Fwww.php.net\u002Fmanual\u002Fen\u002Fbook.yaf.php\n\n\n## For IDE\nA documented prototype script could be found at: https:\u002F\u002Fgithub.com\u002Felad-yosifon\u002Fphp-yaf-doc\n\n## Tutorial\n\n### layout\nA classic application directory layout is:\n\n```\n- .htaccess \u002F\u002F Rewrite rules\n+ public\n  | - index.php \u002F\u002F Application entry\n  | + css\n  | + js\n  | + img\n+ conf\n  | - application.ini \u002F\u002F Configure \n- application\u002F\n  - Bootstrap.php   \u002F\u002F Bootstrap\n  + controllers\n     - Index.php \u002F\u002F Default controller\n  + views    \n     |+ index   \n        - index.phtml \u002F\u002F View template for default controller\n  + library \u002F\u002F libraries\n  + models  \u002F\u002F Models\n  + plugins \u002F\u002F Plugins\n```\n### DocumentRoot\nYou should set `DocumentRoot` to `application\u002Fpublic`, by doing this, only the public folder can be accessed by user:\n\n### index.php\n`index.php` in the public directory is the only way in of the application, you should rewrite all request to it(you can use `.htaccess` in Apache+php mod) \n\n```php\n\u003C?php\ndefine(\"APPLICATION_PATH\",  dirname(dirname(__FILE__)));\n\n$app  = new Yaf_Application(APPLICATION_PATH . \"\u002Fconf\u002Fapplication.ini\");\n$app->bootstrap() \u002F\u002Fcall bootstrap methods defined in Bootstrap.php\n    ->run();\n```\n### Rewrite rules\n\n#### Apache\n\n```conf\n#.htaccess\nRewriteEngine On\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule .* index.php\n```\n\n#### Nginx\n\n```\nserver {\n  listen ****;\n  server_name  domain.com;\n  root   document_root;\n  index  index.php index.html index.htm;\n \n  if (!-e $request_filename) {\n    rewrite ^\u002F(.*)  \u002Findex.php\u002F$1 last;\n  }\n}\n```\n\n#### Lighttpd\n\n```\n$HTTP[\"host\"] =~ \"(www.)?domain.com$\" {\n  url.rewrite = (\n     \"^\u002F(.+)\u002F?$\"  => \"\u002Findex.php\u002F$1\",\n  )\n}\n```\n\n### application.ini\n`application.ini` is the application config file\n```ini\n[product]\n;CONSTANTS is supported\napplication.directory = APPLICATION_PATH \"\u002Fapplication\u002F\" \n```\nAlternatively, you can use a PHP array instead: \n```php\n\u003C?php\n$config = array(\n   \"application\" => array(\n       \"directory\" => application_path . \"\u002Fapplication\u002F\",\n    ),\n);\n\n$app  = new yaf_application($config);\n....\n  \n```\n### default controller\nIn Yaf, the default controller is named `IndexController`:\n\n```php\n\u003C?php\nclass IndexController extends Yaf_Controller_Abstract {\n   \u002F\u002F default action name\n   public function indexAction() {  \n        $this->getView()->content = \"Hello World\";\n   }\n}\n?>\n```\n\n### view script\nThe view script for default controller and default action is application\u002Fviews\u002Findex\u002Findex.phtml, Yaf provides a simple view engine called \"Yaf_View_Simple\", which support the view template written in PHP:\n\n```php\n\u003Chtml>\n \u003Chead>\n   \u003Ctitle>Hello World\u003C\u002Ftitle>\n \u003C\u002Fhead>\n \u003Cbody>\n   \u003C?php echo $content; ?>\n \u003C\u002Fbody>\n\u003C\u002Fhtml>\n```\n\n## Run the Application\n\nhttp:\u002F\u002Fwww.example.com\n\n## Alternative\nYou can generate the example above by using Yaf Code Generator:  https:\u002F\u002Fgithub.com\u002Flaruence\u002Fphp-yaf\u002Ftree\u002Fmaster\u002Ftools\u002Fcg\n```\n.\u002Fyaf_cg -d output_directory [-a application_name] [--namespace]\n```\n\n## More\nMore infos could be found at Yaf Manual: http:\u002F\u002Fwww.php.net\u002Fmanual\u002Fen\u002Fbook.yaf.php\n","Yaf 是一个高性能的 PHP 框架，用 C 语言编写并作为 PHP 扩展构建。其核心功能包括快速的路由处理、自动加载机制以及内置的视图引擎等特性，这些都极大地提高了 Web 应用程序的开发效率与运行速度。Yaf 适用于需要高效处理大量请求的场景，如电子商务网站、在线服务平台等对性能有较高要求的应用环境。此外，通过遵循 MVC 设计模式，Yaf 提供了清晰的应用结构布局，便于开发者维护和扩展项目。","2026-06-11 03:07:57","top_language"]