一、结构介绍
结构的名字grape,中文名叫葡萄,因为最近一个同事经常带葡萄到公司给我们吃,受到启发想到了这个名字。
1)本结构需要在PHP5.5中运行,如果要在5.4中运行,有些地方就要做些修改
2)结构中会用到MongoDB,所以需要在php中额外引用php_mongo.dll文件,查看安装方法。
3)还用到了性能工具xhprof,全文检索工具Coreseek(改造了sphinx),如果使用都需要额外的配置,如果不使用可以关闭
4)整合了微信的部分API接口,点击查看《微信公众平台开发系列》
5)整合了grape-skin(葡萄皮)静态结构,作为管理后台的页面样式与特效
6)后台管理demo帐号是admin,密码是123456
7)虚拟目录结构引用如下:
<VirtualHost *:80>
DocumentRoot "D:/htdocs/grape/public/admin"
ServerName admin.grape.net
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/htdocs/grape/public/api"
ServerName api.grape.net
</VirtualHost>
二、目录结构
依托网上的开源框架InitPHP,略微修改了InitPHP的部分源码,使得结构更符合我自己的项目需要,并扩展了几个功能,例如全文检索配置、分页等。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAACfCAIAAACjjroMAAAJEUlEQVR4nO2d0U8URxzH78+Ahz7VwANRAomm2QTah3KkL6VteNBUJRbZl/qg+ABtmgqXYM6I6ZYKsTGcJi0Eo5fYUi/RaKAYTn0SbWKvXlpENCIcSokxq9FOH/Zud3Z3Zm8X7rc7szvfzMPdMrt3fpyb3Zvvfn8XQ0LAigX9BsIvgRhcAjG4Kom4dt+I3ip4WN61QcR30r160zfqZAViXBtBPHeh1/y0R3sgEBPlAfFw/7Hh/mPD/cnXT1Ovn6Zezo8U7hxf/P2bv349ONyfRGKioMiKeGpqKplMErse+/rEwPc30b8z5IZQ7b6R8zN/gr9l3mRCfO3atbq6upqaGlrvQwd/QCuT5IZQ7b6RM1fuOL5cRo5pkhRFjklKHiGE8ooUkzMZORYrbskrUrFbTM5oO2J9TNvxY5aOx5gMxBrfnTt3OiD+Qv4RPf6Z3MorI5uR4YgxaHlFLqEy9jD3MbZnZAOs9t/g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YRdADPFF4UHMcMSiMElEINLIAaXQAwugRhcAjG4mEBcLnfnSbTlCHuyzCdxkbvzpNAhZqlmpqZyiH0XF7k7TwojYvjcHSVlRy5951At0564sf+MXuXFRe6OkrKjI6ZUy7Ts5dOaHBe5O0oEzGkU2/e1IfZrWZmL3F3kEcPn7igpO+zyyxKrI0XyyBOFPqEoLM/F8Lk7ak1LfSHeGqsjV8skzuDg1h4XuTs2bjnZqLjI3QnE5bTp3J1AXE4idycEK4EYXAIxuARicAnE4BKIwcUE4nK5u80o+CgOF7m7zYh/xL7k7jbz7Y5/xL7k7iKPGDp3Z/4hO+QiekdawwxOXOTu8FHsFL2jbA8FYgSbu8MQu4ze2f2k4MRF7s4ZMSl6Z/wKWCgQw+fuHCcKbIKmbOcfMXzuDv8hOxS50x2LuTvGFI7cHdNiYo0i3BKIwfU/x9CgDoCyv4cAAAAASUVORK5CYII=" alt="" />
1)app:放置的是控制器、试图、拦截器、缓存文件、视图编译文件与特定的配置文件,app下可以有多个项目文件,上面的admin和api隶属于两个项目中
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJ0AAADwCAIAAACVLvEFAAAMe0lEQVR4nO2dz2sbZxrH/WdYh542OAeTNRY0B4G9vUS+bdjigw0xOXkuzWXVQ9zLxhHYCOKlcwglENbNxSZQBAvtClJiHGribk8x3YuI2U3cpMQ4dpJDKGJp993DSJp3Zt53fs+87/vo++E96MfMSOjDvBrNfPU8YwxQZEz1GwCFAK80gVea5Ox1eWY63w2CdKT0unfrw+FgjDXr48GR6/sEyUjjtf3J7/i7L548aNbH//vLt8f7tzeuXHJuwKtaBF53d3dbrZZshb21D3vHd3rHd9517eOD1vNH198+22/Wx4/3b//41eryzLRzA17V4ve6s7MzOTk5MTEhW+Hh2nTv3T/5sfLHPzTr4xtXLi3PTDtj48qlZn1c/F17aNfG+lgd9yGr07HiPg6i8Xh1pC4sLIR5/ct07/jv/Pj1l2fDeXh5Zjp0Hj60LfvQudmxBqYc1QNr0Y+D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21rOqPRaRuGnrPkmv1fXQ9h2Ag2xvNTsw6ID58q8llT4KWu+KZHX4Xakjc6YZ3mKXksq/JQ13yT3Grad4Dwc7E9H1Gt81OabuDZzQROxj5ukRTuzfzxiDPCKfFMKDPDKkG9KjhleQVLglSbwShN4pQm80gReaQKvNIFXmoyuV/2CUXlC32vOwSjuKq3OGOlVUeEnp9mL2zZCZ4z0qrTwkxkF2Ez1WnThJ77VqLfvKLwWRhmFn9yrsZKuWnpjsFdWaOGnoVi/R3gtjDIKPw3EusmJPvBaGKUUfnLCMJbl0wqvxVFS4SdvX0NPSEn7UphGekXhp0iM9BqfkQ1GEfc6ssArTeCVJvBKE3ilCbzSBF5pAq80GV2vyDeZTZ75JsHfWDXFSK+K8k0dK1j9Q1eM9KpBY7vAZVnNMNWrunyTg8qaW3Ew1StTlm/yPqkrBntlavJN3uouumKwVyX5JiOkMnO9qsg3ib5ndcVUrwryTf5yeForNtIr8k2RGOk1Psg3AVLAK03glSbwSpP/A27q1bPK/a9fAAAAAElFTkSuQmCC" alt="" />
2)conf:全局配置文件,包括数据库配置、缓存配置、自动载入配置等,查看InitPHP框架配置。
3)initphp:框架initphp库文件,大部分是原先的,有几个地方做了调整。查看InitPHP框架全部文档。
4)library:包括控制器通用文件、数据层逻辑、数据字典、表单控件编写、服务层逻辑、第三方代码以及简单的测试,这里我把library单处拎出来和app、initphp等平级。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMMAAAFCCAIAAADDhv40AAAWHUlEQVR4nO2d0W8TV77H/WckD/vUKjygFCUSfbAUui84b0Vd+QEkEE+ZuwVuVyT3NhRYSK01m72E7fRelqKUQpDWCGk30qrZWmIFSgSqU56IaFeymrbEAUQwMUQtDQOEnvsw9vjMzDkzY+c3njPx96OjlePMONPks3MG++PjBAOAgkTUBwA2CDAJ0ACTAA0hmjTQ1+P5/byW0PKMsXk9mUjq89VbWj68IwIhQmDSjZNbrcEYy6Q63EO0H0zaUKzXpMn9r/Ff3r11JZPq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dATw47bdoIRBdeCExDOSaETx46b00K6NLbj/AOTQieOHbfdJOmExYXeMCl8YthxO2c3V3AtCL1hUujEsuOuXlDzH9ohexulI8vGFXdooOMGNKDjBjSo+LobiCMwCdAAkwANMAnQAJMADTAJ0ACTAA0wCdCgokkDfT2BtxW9hBtweWQst0VKtB33VmswxjKpDvfwewyYpArRddz7X+O/vHvrSibVUe24d2+vlm5ik2SlW4PAJFKi6ri32jvu4Sd3CplUh5lvD/T1VDtumBQfouq4exwd96G338qkOsZ2bx/o6zHH2O7tmVSH+5rJHmXntURS1zVbQ1I3jV+S2xl9IzKhJaKO+1iPoOOuzW4DfT2NzG68QI7lk+1LcjuzOJhESTQdN2OsfPNCKZcu37zAGJs8+IbHcO3q8Y4AgUn1VNIxnWF2IyWajpsxVsql2drXpVyaMebVccOkmBBNx12eGTOKIzs2JYziSHnmFGNM3HELNGLNm2Sb3eb1JGY3SqL5t1spl7ZMqp6W3B23WCPGbFF2QybZ32Wp45xESQTPJ5Wmhisze43iyO3P+oziSGV67+LUsDFXH94aATWJ4DnuUi796odM5frQjk2JyvWhV99nSrn0+YEufrT+qMA6icCkQrb7l7tnVor6F6ffWSnqbPFMIdvd+sMAtERg0v3ZiUK2mx/3ZydafxiAFhVbABBHYBKgASYBGmASoOH/AaUwEp7ofz9GAAAAAElFTkSuQmCC" alt="" />
5)logs:日志文件,可以打印出数据库查询语句,也可以做一些调试信息
6)public:项目的入口文件,全局变量配置,摆放静态资源(CSS、JS等)。如下图所示,admin文件夹中有静态资源文件,css、js等,并有自己的index.php入口文件,rpc文件是InitPHP框架中的RPC调用配置。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAL0AAADfCAIAAAAsiUU2AAARZUlEQVR4nO2d3W8TVxqH/WckF70qggtEo1iCC0tJe4NzV9QqF60E4iqz3cJuVbPapAVBME2abkyZ0BCy4TMrQiNRd/lo3aULSwSqAe0FEW0lK6Ek5mMxJgaLJM4kDj17MfbMmZkzHz6e8ZwZv4+O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IzS6Q8pY5eGMDbuaLkV1liM0ukJ0XELxBCLl4P1zEnjLE4E3NcS1fLEJbhhjh9YWVNYbVdYex7biE6negy+WGsctLLFus914i9VjR2LV8sQhtGWLVD8HjPxCv+MlvdclGxTptuWHi7nrvJVGPFY1dyxeLUJYhVo0A0ktlv4B3OSRvNGUcibvrvZdMPVamdS1fLEJZhtjAG9KMogJvtLuDNyRcyxeL0JYhxvt3PKSuGlNKi1a9Ie+u8171XdHY5c9TtGWIlfNXXjUtUU85LXtD3p38XvVd0djl729sKkPsLvVYYdTl74ttKkPsLuBNzbGpDLG7gDcAYA3wBqABvAFo+D8H7gFUxHPP2AAAAABJRU5ErkJggg==" alt="" />
7)tool:放置了MySQL数据库示例代码,简易api调试工具,memcache操作工具
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAALYAAABTCAIAAAC9G2piAAAHM0lEQVR4nO2cf2gbVRzAnyiyf5wlSLfgnP/UStc/KkFmyR9hBWkpaqVhqz1q0f6xQ8cqEhRrRJZ1WRc0w+voStFjG5t1f0jGRBvs3NnhSCZudu3ArRLd6o/RiH9kf+gSdPL847Lk3eW9e5c0uctt3w9fSnq59/rI++TdS+7bL8IAYAiyewBAvQOKABxAEYADKAJwqL4ios9T9T5vExeRGK9Z7wCVyhU5+/7mQmCMR7vcpVG9caqAIjZQoSKxnU3kr79dnB3tcv9z81Q6OREd7FQfMBRJSd6K5xkUsQG6InNzc5FIhNXm7N7NufRULj11Y0lKL0SWz4xkriVHu9zp5MSlT0Oiz6M+AEXuDCiKKIrS2tra3NzManN6ryd341sy3n5+y2iXOzrYKfo8akQHO0e73KX7EhHdxiulMMY4XjyimX7qcVDEBvSKqH709/cbKbLLk0ufJOPWzWuFC43o85i+0MTFgir539RnDI6DIlajUaTghyAIBop8scuTWz5SiFigzSBKWhOKxEVCBOIp1nFQxA6KipB+GCsSC7TmliQ1YoG23PIUNdILkfIV8Uop9nFQxA6KikQikWaCsbExVpvpnU25pUhuKRILtKkPSoPhB+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sbFJmezwqykryanJ7P6iKoKKBIvQGKVAVQpHqAIo7DZkXIp0woYnXuKi1TQHuf7y4owmazIoKsCLIyE20ng9HU8txVyq06XQoSKFIDqBeaWLQjm8VqXFWCdEtsyF1VnyaOMccAilQPA0ViyuWJ6eTKfPTyzI5YtEPf0q7c1bxvtIKwoEgtoG9Xwx2ZLCZDDpcoYlnuaiGnMCVJ+nxD1hhAkepBVUQOd2Qy+VUkLCuZDJ6gKGJV7irxf7mU/S25u5VgFakBVEUmwt0rmSwZ0WA3pyObc1crGINTsU0R8uuQpCKvZLKFVWQlkw1TFLEmd7UcQJFa0C7IQUURgnJQUQqhKLJuFQkHaKtIHeWuYoxBkdoQjCrtgqyLYKC7NCweGMAC8kUADqAIwAEUATiAIgAHqLsKcIC6qwAHqLtqAvPff0BRzdXg4LqroIg1OLju6t3xLSoLqLtqAlDEMlZXdzUuIq8Uz9+mIXPGtGlhups4JlrRa1mxclQNeyveC4qLarYA/Y6Sk4qxOqjWGfFiqROjTyijJqJyW1FzXQ1yVA170wyGfFY3yU4qxuqcuqsaA2iP6YmovFYY49L3sFEComFvTF8pijilGKtz6q6aUYSyIJuZ1JLLhMWK1HcxVmfVXTVeD6hFVMsQi5HTqstRXYUizizG6qy9CO+SQdn0cVtRc10NclRroEh9F2N1bN1VwCocVHcVsAdH1V0F7ADqrgIcYDIADqAIwAEUATiAIgCH/wG8QYQUOr+lbQAAAABJRU5ErkJggg==" alt="" />
三、配置文件
1)conf文件
1.全局的配置放在了外面的conf文件,而在每个app下面的项目中也有一个conf文件,这里面是配置一些这个项目下需要的配置项。
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJcAAACCCAIAAADE5s0GAAAG+0lEQVR4nO2dz0sjZxjH82cotKeKHsSKgd1DQNuL8VZp8aCgeHIu3Uvdg/bS1YASWEvnIIsgdb0kCEugsO3AloqyYrZ7WtlegqFVVxdDNK4HWYay27eHyY93fr/jvJN555nnw3uYTF7fZPLhfTPJfPOYIEj0SYT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BHCUaNFCEeNSUZwSUYkoqBFCKBFCKBFCKBFCKBFCKBFCKBFCKBFCPwPjOhIqDe66lQAAAAASUVORK5CYII=" alt="" />
2.全局配置内容和InitPHP配置中的基本相同,但我在封装的时候多了几个。
is_xhprof:性能分析工具,点击查看工具配置。
sphinx:全文检索工具,点击查看工具配置。
autoload:自动载入文件,载入的是library文件夹中的一些php文件。自动载入的命名是有规则的,例如下面的第一个配置,自动载入library/controller文件夹中的adminController.php文件。
/*********************************自动载入配置*****************************************/
$InitPHP_conf['autoload']['controller'] = array(
'path' => LIB_PATH . '/controller',
'files' => array('admin', 'api')
);
$InitPHP_conf['autoload']['helper'] = array(
'path' => LIB_PATH . '/helper',
'files' => array('url', 'dict/const', 'dict/enum')
);
自动载入的逻辑代码写在了InitPHP里initphp.php文件中:
private static function _autoload() {
$config = self::getConfig();
$autoloads = $config['autoload'];
foreach ($autoloads as $key=>$autoload) {
if(empty($autoload['files']) || empty($autoload['path']))
continue;
$path = $autoload['path'];
foreach ($autoload['files'] as $file) {
require_once $path . '/' . $file.ucfirst($key).'.php';
}
}
//是否打开性能测试
if($config['is_xhprof']) {
require_once LIB_XHPROF_PATH . "/xhprof_lib/utils/xhprof_lib.php";
require_once LIB_XHPROF_PATH . "/xhprof_lib/utils/xhprof_runs.php";
}
}
2)定义全局常量
1.defined.php
文件位于public下面,这个文件中将定义些目录常量,域名常量,API密钥,微信配置等,并引入全局入口文件。
<?php
/**
* 常量定义
* @author: pwstrick
*/
define('ROOT_PATH', dirname(dirname(__FILE__)));
define('LIB_PATH', ROOT_PATH . '/library');
define('LIB_THIRD_PATH', LIB_PATH . '/third');//第三方类库目录
define('LIB_XHPROF_PATH', LIB_THIRD_PATH . '/xhprof');//性能测试工具
define('SCRIPT_PATH', 'scripts');//开发使用scripts,部署使用optimize
define('UPLOAD_PATH', ROOT_PATH.'/upload');//上传路径
define('UPLOAD_HTTP', 'http://upload.grape.net'); /**
* API客户端密钥
*/
define('API_IOS_KEY', 'DF_A98=D^&7$^%*9CNAhj0UO!!LM11');
define('API_ANDROID_KEY', 'KU98&)dsf8%@kji89dfadJK-800i122');
define('API_UNKNOW_KEY', 'jfdsfd798hj+@(*kb66578-223q670933'); /**
* 微信配置
*/
define('WEIXIN_APPID', 'xx');//TODO
define('WEIXIN_SECRET', 'xx');//TODO
define('WEIXIN_TOKEN', 'xx');//TODO
define('WEIXIN_NOTIFY_URL', 'http://xx');//TODO
define('WEIXIN_MCHID', 'xx');//TODO
define('WEIXIN_KEY', 'xx');//TODO header("Content-Type:text/html; charset=utf-8");
require_once(ROOT_PATH . '/initphp/initphp.php'); //导入配置文件-必须载入
require_once(ROOT_PATH . '/conf/comm.conf.php'); //公用配置
2.index.php
index文件夹是各个项目的入口文件,同样位于public下面,里面有特定的配置常量,引用defined.php文件,并运行InitPHP开发框架。
<?php require_once(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'defined.php');
define('APP_NAME', 'admin');
define('APP_PATH', ROOT_PATH.'/app/'.APP_NAME);
require_once(APP_PATH . '/conf/comm.conf.php'); //APP配置
InitPHP::init();
GitHub地址: