{"id":15095680,"url":"https://github.com/showx/phpshow","last_synced_at":"2025-04-15T00:31:25.587Z","repository":{"id":57049992,"uuid":"124049749","full_name":"showx/phpshow","owner":"showx","description":"phpshow,简单易用的php框架","archived":false,"fork":false,"pushed_at":"2020-08-10T03:10:52.000Z","size":1576,"stargazers_count":14,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T12:37:49.591Z","etag":null,"topics":["cms","codeigniter","framework","php","phpframework","phpshow","swoole","thinkphp"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/showx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-06T08:56:50.000Z","updated_at":"2022-05-20T08:16:23.000Z","dependencies_parsed_at":"2022-08-23T19:10:21.069Z","dependency_job_id":null,"html_url":"https://github.com/showx/phpshow","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showx%2Fphpshow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showx%2Fphpshow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showx%2Fphpshow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/showx%2Fphpshow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/showx","download_url":"https://codeload.github.com/showx/phpshow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248984231,"owners_count":21193712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","codeigniter","framework","php","phpframework","phpshow","swoole","thinkphp"],"created_at":"2024-09-25T15:41:09.630Z","updated_at":"2025-04-15T00:31:25.054Z","avatar_url":"https://github.com/showx.png","language":"PHP","readme":"\n```\n      _               _\n _ __ | |__  _ __  ___| |__   _____      __\n| '_ \\| '_ \\| '_ \\/ __| '_ \\ / _ \\ \\ /\\ / /\n| |_) | | | | |_) \\__ \\ | | | (_) \\ V  V /\n| .__/|_| |_| .__/|___/_| |_|\\___/ \\_/\\_/\n|_|         |_|\n```\n# phpshow\nphpshow,轻量简单易用的高性能php框架，默认启动workerman模式，抗大并发能力。\n\n# 服务器环境\n1. Nginx\n2. php7以上\n\n### 相关扩展\n\n1. pcntl\n2. libevent\n3. seaslog(选用)\n4. swoole(选用)\n\n## 安装\n统一使用phpcomposer安装\ncomposer require showx/phpshow\n\n## 协议\nphpshow 的开源协议为 Apache-2.0，详情参见[LICENSE](LICENSE)\n\n## php配置\n### 项目config/site.php配置\n详见参考事例\n\n```\nreturn [\n    //框架里的模式 [0普通启动|1 workerman模式];\n    'type' =\u003e 1,\n    // 绑定的地址\n    'host' =\u003e '0.0.0.0',\n\t// 启动的端口\n    'port' =\u003e 8080,\n\t//进程worker数量\n    'count' =\u003e 4,\n    //数据库池的数量\n    'mysql_pool_num' =\u003e 6,\n    //调试模式\n    'debug' =\u003e 1,\n    //开发模式 [dev 查看加载异常|dev2 查看接口使用内存等]\n    'dev' =\u003e 1,\n    'dev2' =\u003e 0,\n];\n```\n\n\n### php.ini\n建议短标记\n1.  short_open_tag = On  ;php短标记打开 \u003c? ?\u003e,模板要使用这样的标记\n\n### nginx配置\nnginx正常模式\n``` \nserver{\n    ...\n\tlocation / {\n\t\tif ( !-e $request_filename) {\n\t\t\trewrite ^(.*)$ /index.php?s=/$1 last;\n\t\t\tbreak;\n\t\t}\n\t\ttry_files $uri $uri/ /index.html;\n\t}\n\tlocation ~ [^/]\\.php(/|$) {\n\t\tfastcgi_pass 127.0.0.1:9000;\n\t\tfastcgi_index index.php;\n\t\tinclude fastcgi_params;\n\t\tfastcgi_split_path_info       ^(.+\\.php)(.*)$;\n\t\tfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n\t\tfastcgi_param PATH_INFO       $fastcgi_path_info;\n\t}\n\t...\n}\n```\n高性能workerman模式\n```\nserver {\n\tserver_name xxx.com\n\tlocation / {\n\t\tproxy_pass http://172.20.0.3:8080;\n\t    proxy_http_version 1.1;\n\t    proxy_set_header X-Real-IP $remote_addr;\n\t}\n}\n\n```\n\n# 框架教程\ncomposer之后\n./vender/showx/phpshow/app 项目示例\n./vender/showx/phpshow/src  核心代码文件\n\n简单的mvc模式\n主要逻辑在于/app文件夹中\n入口在/public文件夹(详情查询./vender/showx/phpshow/app)\n\n### 路由\n路由采用简单的定义方式 $url/{$ct}/{$ac},http://www.baidu.com/index/index,默认ct和ac为index.\n支持path_info /index.php/index/index\n\n### 配置文件  \n配置文件主要饮食site(基础配置)database(数据库配置)route_rule(路由规则配置)\n放在app项目下的config文件夹\n\n## app项目\n```\n├── config 配置目录\n│   ├── cron.php\n│   ├── db.php\n│   ├── signkey.php\n│   └── site.php\n├── control 控制类\n│   ├── IndexController.php\n├── index.php   程序入口\n├── model 模型类\n│   ├── IndexModel.php\n├── public 静态文件目录\n│   ├── favicon.ico\n│   ├── index.html\n│   ├── index.php   普通模式下的入口\n│   └── robots.txt\n├── runtime  临时缓存与日志目录\n│   └── Log\n└── view  模板目录\n    ├── footer.php\n    ├── header.php\n    ├── index.php\n```\n\n\n新建composer.json文件\n```\n\tautoload\": {\n        \"psr-4\": {\n            \"app\\\\\": \"app/\"\n        }\n    },\n```\n增加本地项目的autoload\ncomposer require showx/phpshow\n在app里使用php index.php start启动服务器\n\n\n### 核心类的介绍\n1. \\phpshow\\request 获取数据类\n2. \\phpshow\\response 输出类\n3. \\phpshow\\loader 核心加载类\n4. \\phpshow\\control 基层控制器\n5. \\phpshow\\model\t基层模型\n\n### 工具库\n1. \\phpshow\\lib\\redis redis类\n2. \\phpshow\\lib\\http http请求类\n3. \\phpshow\\lib\\mysql 数据库驱动\n4. \\phpshow\\lib\\debug 页面调试\n5. \\phpshow\\lib\\jwt jwt会话验证\n6. \\phpshow\\lib\\log 日志类\n7. \\phpshow\\lib\\pool 进程池\n8. \\phpshow\\helper\\util 辅助函数库\n\n### 模型层\n继承\\phpshow\\model即可调用相关函数\n1. insert1 新增数据\n2. update1 更新数据\n3. get_one 获取一条数据\n4. get_all 获取所有数据\n5. get_sql_one 获取指定sql的一条数据\n6. get_sql_all 获取指定sql的全部数据\n\n### 模板引擎\n使用纯php输出，模板里简单用\u003c? ?\u003e 作为标签\nvue带领大家，前后端分离，没需要用到模拟引擎\n\n### 简单缓存\n使用\n\u003cli\u003e 设置缓存 \\phpshow\\loader::set($key,$value);\u003c/li\u003e\n\u003cli\u003e 获取缓存 \\phpshow\\loader::get($key); \u003c/li\u003e\n\n## 建议与反馈\n联系本人 9448923#qq.com","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowx%2Fphpshow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshowx%2Fphpshow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshowx%2Fphpshow/lists"}