Framework

1> 初始化

  • 前提:服务器上已经装有 Apache/Nginx 和 MySQL
  • 进入 hush-framework/hush-app/bin 目录(Linux 下需执行 chmod +x hush)
  • 执行 ./hush sys init

    • 以上过程是完全自动化的
    • 看到 "Initialized successfully" 则表示成功

2> 配置 Apache/Nginx 站点

Apache 站点配置如下(Windows):

  1. NameVirtualHost *:80
  2.  
  3. <VirtualHost *:80>
  4.  
  5. DocumentRoot "E:/web"
  6.  
  7. ServerName web
  8.  
  9. <Directory />
  10.  
  11. AllowOverride All
  12.  
  13. Allow from all
  14.  
  15. </Directory>
  16.  
  17. </VirtualHost>
  18.  
  19. <VirtualHost *:80>
  20.  
  21. DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/backend"
  22.  
  23. ServerName hush-app-backend
  24.  
  25. <Directory />
  26.  
  27. AllowOverride All
  28.  
  29. Order deny,allow
  30.  
  31. Allow from all
  32.  
  33. </Directory>
  34.  
  35. </VirtualHost>
  36.  
  37. <VirtualHost *:80>
  38.  
  39. DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/frontend"
  40.  
  41. ServerName hush-app-frontend
  42.  
  43. <Directory />
  44.  
  45. AllowOverride All
  46.  
  47. Order deny,allow
  48.  
  49. Allow from all
  50.  
  51. </Directory>
  52.  
  53. </VirtualHost>
  54.  
  55. Listen 8001
  56.  
  57. <VirtualHost *:8001>
  58.  
  59. DocumentRoot "E:/web/platform/Demos/info-demos/server/www/server"
  60.  
  61. ServerName Demos-app-api
  62.  
  63. <Directory />
  64.  
  65. AllowOverride All
  66.  
  67. Order deny,allow
  68.  
  69. Allow from all
  70.  
  71. </Directory>
  72.  
  73. </VirtualHost>
  74.  
  75. Listen 8002
  76.  
  77. <VirtualHost *:8002>
  78.  
  79. DocumentRoot "E:/web/platform/Demos/info-demos/server/www/website"
  80.  
  81. ServerName Demos-app-web
  82.  
  83. <Directory />
  84.  
  85. AllowOverride All
  86.  
  87. Order deny,allow
  88.  
  89. Allow from all
  90.  
  91. </Directory>
  92.  
  93. </VirtualHost>

Nginx 站点配置如下:

  1. server {
  2. listen 80;
  3. server_name hush-app-backend;
  4. root /path/to/hush/hush-app/web/backend;
  5. location / {
  6. index index.html index.htm index.php;
  7. if (!-e $request_filename) {
  8. rewrite ^(.*)$ /index.php?$1 last;
  9. break;
  10. }
  11. }
  12. location ~ .*\.php$ {
  13. include fastcgi_params;
  14. fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
  15. fastcgi_pass 127.0.0.1:9000;
  16. fastcgi_index index.php;
  17. }
  18. }
  19.  
  20. server {
  21. listen 80;
  22. server_name hush-app-frontend;
  23. root /path/to/hush/hush-app/web/frontend;
  24. location / {
  25. index index.html index.htm index.php;
  26. if (!-e $request_filename) {
  27. rewrite ^(.*)$ /index.php?$1 last;
  28. break;
  29. }
  30. }
  31. location ~ .*\.php$ {
  32. include fastcgi_params;
  33. fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
  34. fastcgi_pass 127.0.0.1:9000;
  35. fastcgi_index index.php;
  36. }
  37. }
  38.  
  39. server {
  40. listen 8001;
  41. server_name zjgx-app-api;
  42. root /path/to/Demos/info-demos/server/www/server;
  43. location / {
  44. index index.html index.htm index.php;
  45. if (!-e $request_filename) {
  46. rewrite ^(.*)$ /index.php?$1 last;
  47. break;
  48. }
  49. }
  50. location ~ .*\.php$ {
  51. include fastcgi_params;
  52. fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
  53. fastcgi_pass 127.0.0.1:9000;
  54. fastcgi_index index.php;
  55. }
  56. }
  57.  
  58. server {
  59. listen 8002;
  60. server_name zjgx-app-web;
  61. root /path/to/Demos/info-demos/server/www/website;
  62. location / {
  63. index index.html index.htm index.php;
  64. if (!-e $request_filename) {
  65. rewrite ^(.*)$ /index.php?$1 last;
  66. break;
  67. }
  68. }
  69. location ~ .*\.php$ {
  70. include fastcgi_params;
  71. fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
  72. fastcgi_pass 127.0.0.1:9000;
  73. fastcgi_index index.php;
  74. }
  75. }

4> 修改本地 hosts 文件

为了便于调试,建议开发者修改本地的 hosts 文件来访问站点:

  1. 127.0.0.1 hush-app-frontend
  2. 127.0.0.1 hush-app-backend

重新启动 Apache/Nginx 服务器,就可以在浏览器中访问应用界面。

Quick Development Guide

主要命令

  • 注意:执行 ./hush 即可看到所有命令
  • hush sys init:系统初始化,建议仅在首次安装的时候使用
  • hush sys uplib:更新依赖类库,当类库有更新的时候使用
  • hush sys newapp:根据当前应用框架的代码生成新应用
  • hush sys newdao:生成新的数据库模块类(Model)
  • hush sys newctrl:生成新的控制器类(Controller)
  • hush check all:检查所有运行目录的路径和权限
  • hush clean all:清除模板缓存以及文件缓存
  • hush doc build:生成 Hush 基础类库和应用框架的文档
  • hush db backup [database]:备份指定数据库,[database] 是根据 database.mysql.php 文件中的 $_clusters 变量指定的,比如:default:0:master:0:ihush_apps 代表 $_clusters['default'][0]['master'][0] 的数据库配置,ihush_apps 代表数据库名
  • hush db recover [database]:恢复制定数据库,[database] 的规则和 hush db backup [database] 命令相同

PHP Framework安装的更多相关文章

  1. Robot Framework安装及配置

    Robot Framework安装及配置 需要按照的软件有Python.WxPython.robot framework.robotframework-ride.robotframework-sele ...

  2. robot framework 安装

    一.安装 Python 2.7 pip 和 setuptools (Python 的套件管理程式,最新版的Python 2.7.13已包含) Robot Framework (此工具本身) wxPyt ...

  3. Robot Framework 安装及环境配置

    Robot Framework 安装及环境配置 Robot Framework 介绍 Robot Framework是一款python编写的功能自动化测试框架.具备良好的可扩展性,支持关键字驱动,可以 ...

  4. (一)Robot Framework安装

    准备工作: Python 2.7 (目前不能良好支持python3) pip 和 setuptools (Python 的套件管理程式,最新版的Python 2.7.16已包含) Robot Fram ...

  5. Robot Framework安装部署详细教程

    (转自“义甬君”) Robot Framework安装准备 说实话,在我玩了这么多自动化工具后,感觉Robot Framework所需的环境和安装过程是相对比较繁琐和复杂的.要真正搭建一套可以使用的R ...

  6. robot framework 安装配置

    robot framework 是一款专门用作自动化测试的框架,提供了丰富的内置库,与第三方库,也支持用户自己编写的库,robot framework +library 可以 用来做ui的自动化测试, ...

  7. Play Framework安装和配置

    安装环境: jdk 1.7; play 1.3.1; eclipse 安装指南:http://play-framework.herokuapp.com/zh/install 安装Play Framew ...

  8. Robot Framework安装

    Robot Framework(中文站/社交化知识社区,源码)是一款Python编写的通用开源功能测试自动化框架,以作验收测试和验收测试驱动开发(ATDD),它是一种使用表格测试数据语法的关键字驱动的 ...

  9. zend framework安装中出现的问题与总结

    1.按照官方的教程来做http://framework.zend.com/manual/current/en/user-guide/skeleton-application.html 但其中有些步骤没 ...

随机推荐

  1. http://blog.163.com/zhangmihuo_2007/blog/static/27011075201392685751232/

    http://blog.163.com/zhangmihuo_2007/blog/static/27011075201392685751232/

  2. 叠罗汉III之推箱子

    有一堆箱子,每个箱子宽为wi,长为di,高为hi,现在需要将箱子都堆起来,而且为了使堆起来的箱子不到,上面的箱子的宽度和长度必须小于下面的箱子.请实现一个方法,求出能堆出的最高的高度,这里的高度即堆起 ...

  3. tcp抓包 Wireshark 使用

    fidder主要是针对http(s)协议进行抓包分析的,所以类似wireshark/tcpdump这种工作在tcp/ip层上的抓包工具不太一样,这种工具一般在chrome/firefox的开发者工具下 ...

  4. Haproxy安装及配置

    1.安装 # wget http://haproxy.1wt.eu/download/1.3/src/haproxy-1.3.20.tar.gz # tar zcvf haproxy-1.3.20.t ...

  5. ios开发多线程--GCD

    引言 虽然GCD使用很广,而且在面试时也经常问与GCD相关的问题,但是我相信深入理解关于GCD知识的人肯定不多,大部分都是人云亦云,只是使用过GCD完成一些很简单的功能.当然,使用GCD完成一些简单的 ...

  6. Oracle下的IF EXISTS()

    妈蛋..作为一个使用了SQL SERVER有4 5年的程序猿,开始用Oracle真他妈不习惯.写法真他妈不一样.比如像写个像IF EXISTS(SELECT * FROM sys.tables WHE ...

  7. SpringMVC 中的Interceptor 拦截器

    1.配置拦截器 在springMVC.xml配置文件增加: <mvc:interceptors>  <!-- 日志拦截器 -->  <mvc:interceptor> ...

  8. slot signal机制

    有一个比较 经典的实现:http://sigslot.sourceforge.net/很精简的 signal slot的实现,跨平台.webrtc项目在用,我在自己项目里也用了.这个源码有2000多行 ...

  9. Java-HTTP连接时如何使用代理(一)—— System.Property方式

    在发起HTTP请求(openConnection() 或者 openStream())之前,加上以下2行代码: System.setProperty("proxyHost", PR ...

  10. 下拉刷新控件(4)SwipeRefreshLayout官方教程(上)如何在应用中使用它

    http://developer.android.com/training/swipe/add-swipe-interface.html 1,在布局xml和代码中使用它 2,在menu中添加它 The ...