您好,登錄后才能下訂單哦!
TODO:macOS上ThinkPHP5和Semantic-UI集成
1. 全局安裝 (on OSX via homebrew)Composer 是 homebrew-php 項(xiàng)目的一部分
2. 把Xcode升級(jí)到8.1后繼續(xù)安裝Composer
3. 使用composer創(chuàng)建TP5項(xiàng)目MWL-Dispatch
composer create-project topthink/think MWL-Dispatch
4. 配置apache,設(shè)置Virtual hosts,
在httpd.conf中找到“#Include /private/etc/apache2/extra/httpd-vhosts.conf”,去掉前面的“?!?,并保存。
找到
<Directory />
AllowOverride none
Require all denied
</Directory>
改成
<Directory />
AllowOverride none
Require all granted
</Directory>
5. 對(duì)項(xiàng)目runtime文件夾設(shè)置寫對(duì)權(quán)限
sudo chmod -R a+w ./runtime/
6. 在httpd-vhost.conf添加配置
<VirtualHost *:80>
DocumentRoot “/Users/wuyong/data/ludong/xcx/php/MWL-Dispatch/public”
ServerName mwl-dispatch.com
ErrorLog “/private/var/log/apache2/mwl-dispatch-error_log”
CustomLog “/private/var/log/apache2/mwl-dispatch-access_log” common
</VirtualHost>
7. 自動(dòng)創(chuàng)建模塊,把根目錄的build.php拷貝到application下,然后在項(xiàng)目目錄下運(yùn)行php think build –module test,一定要在根目錄下執(zhí)行這個(gè)目錄,不然會(huì)出現(xiàn)“Could not open input file: think”
8. 從GitHub下載Semantic-UI,把相應(yīng)的css,js拷貝到public文件夾下,同時(shí)把googleapi的字體下載到本地,這樣可以減少網(wǎng)站打開(kāi)的加載速度,很多人決定Semantic慢也許就是因?yàn)橐虞dgoogle字體導(dǎo)致的,也有建議把fonts.googleapis.com改成fonts.useso.com,個(gè)人感覺(jué)還是慢,還是沒(méi)有本地的加載快。
本例的源碼分享在GitHub(https://github.com/SomeTODO/MWL-Dispatch)上,會(huì)不斷完善并且使用起來(lái)。
wxgzh:ludong86
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。