Framework

1> 初始化

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

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

2> 配置 Apache/Nginx 站点

Apache 站点配置如下(Windows):

NameVirtualHost *:80

<VirtualHost *:80>

    DocumentRoot "E:/web"

    ServerName web

    <Directory />

        AllowOverride All

        Allow from all

    </Directory>

</VirtualHost>

<VirtualHost *:80>

    DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/backend"

    ServerName hush-app-backend

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

<VirtualHost *:80>

    DocumentRoot "E:/web/platform/Demos/hush-framework/hush-app/web/frontend"

    ServerName hush-app-frontend

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Listen 8001

<VirtualHost *:8001>

    DocumentRoot "E:/web/platform/Demos/info-demos/server/www/server"

    ServerName Demos-app-api

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Listen 8002

<VirtualHost *:8002>

    DocumentRoot "E:/web/platform/Demos/info-demos/server/www/website"

    ServerName Demos-app-web

    <Directory />

        AllowOverride All

        Order deny,allow

        Allow from all

    </Directory>

</VirtualHost>

Nginx 站点配置如下:

server {
listen 80;
server_name hush-app-backend;
root /path/to/hush/hush-app/web/backend;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 80;
server_name hush-app-frontend;
root /path/to/hush/hush-app/web/frontend;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 8001;
server_name zjgx-app-api;
root /path/to/Demos/info-demos/server/www/server;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/backend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
} server {
listen 8002;
server_name zjgx-app-web;
root /path/to/Demos/info-demos/server/www/website;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location ~ .*\.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/hush/hush-app/web/frontend$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
}

4> 修改本地 hosts 文件

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

127.0.0.1 hush-app-frontend
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. 创建CancellationTokenSource对象用于取消Task

    虽然使用线程池ThreadPool让我们使用多线程变得容易,但是因为是由系统来分配的,如果想对线程做精细的控制就不太容易了,比如某个线程结束后执行一个回调方法.恰好Task可以实现这样的需求.这篇文章 ...

  2. HADOOP NAMENODE对Image和edits的处理

    1.SNN CheckPoint的处理流程 配置中配置做CheckPoint的两个条件,一个是文件大小editlog大于多大就做,另一个是时间维度,多长时间做一次. (1)SNN首先检查是否需要进行c ...

  3. JavaPersistenceWithHibernate第二版笔记Getting started with ORM-001用JPA和Hibernate实现HellowWorld(JTA、Bitronix)

    一.结构 二.model层 1. package org.jpwh.model.helloworld; import javax.persistence.Entity; import javax.pe ...

  4. mysql 支持中文,防止程序乱码的方法

    1. 查看你的mysql的字符设置 mysql> show variables like 'character%'; +--------------------------+---------- ...

  5. windows xp 无法连接wpa无线网络

    其实以前一直是可以的,不知为什么前几天忽然就不能加入原有的无线网了.我的无线网是WPA加密的,采用DHCP分配IP(但针对特定MAC地址分配静态IP). 在网上找了许久,有的网友认为应该把无线网卡(那 ...

  6. Linux实施一次性任务

    一.定义 at命令:定时任务,指定一个时间执行一个任务,只能执行一次. 二.选项 三.示例 1. 使用 student 用户,创建一个任务,2 分钟以后执行,在/home/student/at.txt ...

  7. Linux下安装mysql-5.6.4 的图文教程

    在开始安装前,先说明一下mysql-5.6.4与较低的版本在安装上的区别,从mysql-5.5起,mysql源码安装开始使用cmake了,因此当我们配置安装目录./configure --perfix ...

  8. USACO Section 3.2: Factorials

    这题注意要保存%10000的数. /* ID: yingzho1 LANG: C++ TASK: fact4 */ #include <iostream> #include <fst ...

  9. USACO Section 2.4: Bessie Come Home

    因为题目给了边的信息,所以比较适用bell-man的方法 /* ID: yingzho1 LANG: C++ TASK: comehome */ #include <iostream> # ...

  10. c++异常 连续抛出异常

      今天天遇到这样一个问题,连续两次抛出异常,但是只有一个catch,会导致core这个时候会导致core, 单线程编程中可能很少遇到这样的问题,但是多线程中是很容易遇到的, 举个例子:catch代码 ...