如何启用Discuz!Q的composer
闃叉墜璐憋細
鍏堣涓涓嬫垜鐨勪簩寮娴佺▼
.gitignore 鏂囦欢鈥/frame
/public
/vendor
/config/config.php
淇 composer.json
require 瀛楁锛鈥require-dev 瀛楁鈥
淇 dzq 涓绘鏋讹紙閲嶈锛
鍏堟暣涓浠戒綘鐨 dzq 椤圭洰鏂囦欢澶癸紝闃叉鍑洪棶棰樹簡涔嬪悗鏁版嵁鏃犳硶杩樺師
鍏堣涓涓嬫垜鐨勪簩寮娴佺▼
鎴戠洿鎺ヤ粠鏈嶅姟鍣ㄦ妸鎵鏈変唬鐮佹墦鍖呬笅杞戒笅鏉ワ紝鐒跺悗鍦ㄦ湰鍦板垱寤虹殑 git 浠撳簱
.gitignore 鏂囦欢
鏁翠釜浠撳簱鎷変笅鏉ヤ箣鍚庯紝鍒繕浜嗗垱寤轰竴涓.gitignore 鏂囦欢锛
- # /framework/public/vendor/composer.lock/.idea/config/config.php/node_modules.php_cs.cache/public/s9e.js/public/storage/storage/install.lock/public/docs/public/api-docs/public/manual-h5/public/manual-admin/plugin/CustomIfram2
杩欎釜瑕佹敞閲婃帀锛堜笉蹇界暐锛夛紝鍚庤竟鎴戜細鍛婅瘔浣犲共浠涔堢敤
/public
鍓嶇浠g爜锛岃繖閲屾斁鐨勬槸浜х墿锛屼笉鏄墠绔簮鐮侊紝鐩存帴蹇界暐
/vendor
鏁翠釜 dzq 椤圭洰鎵闇瑕佺殑锛屽凡缁忎笅杞藉ソ鐨勬墍鏈 composer 渚濊禆锛屽洜涓哄悗杈瑰挶浠彲浠ヨ嚜宸卞鐞 composer 鍖呬簡锛屾墍浠ヨ繖閲岀洿鎺ュ拷鐣ユ帀
/config/config.php
閰嶇疆鏂囦欢锛岃繖閲屽洜涓洪渶瑕佷娇鐢ㄥ紑鍙戠増鐨勬暟鎹簱杩炴帴鍦板潃锛屾墍浠ュ拷鐣
鍓╀笅鐨勫唴瀹逛篃鏄洿鎺ュ拷鐣ュ嵆鍙紝鎴戜笉鍐嶅瑙i噴鍏朵粬鐨勭洰褰曠殑浣滅敤浜
淇 composer.json
鏈鍚庝竴鐗 DZQ 宸茬粡杩囧幓涓ゅ勾浜嗭紝澶ч儴鍒 composer 鍖呭凡缁忔湁浜嗘洿鏂扮殑鐗堟湰锛屼絾鏄儴鍒嗗寘鍙兘涓嶅吋瀹圭洰鍓嶇殑 DZQ3.0 鍚庣锛屾墍浠ユ殏鏃跺厛閿佸畾鐩墠宸叉湁鐨勫寘鐨勭増鏈
require 瀛楁锛
鐩存帴鏀规垚鎴戣繖鏍锋棦鍙
- "require": { "php": "^7.2.5", "ext-json": "*", "ext-pdo": "*", "discuz/core": "dev-3.0-dev", "doctrine/dbal": "2.13.2", "endroid/qr-code": "3.9.6", "ezyang/htmlpurifier": "v4.13.0", "league/omnipay": "v3.0.2", "lokielse/omnipay-wechatpay": "v3.0.11", "overtrue/wechat": "4.4.2", "qcloud/vod-sdk-v5": "v2.4.4", "qcloud_sts/qcloud-sts-sdk": "3.0.6", "s9e/text-formatter": "2.9.3", "zircote/swagger-php": "^3.2" },
鏀规垚杩欐牱锛
- "require-dev": { "friendsofphp/php-cs-fixer": "v2.19.0", "symfony/var-dumper": "v4.4.26" },
杩欐牱鏀硅繖涓や釜瀛楁鐨勪綔鐢紝鏄洿鎺ョ‖閿佸畾 composer 鍖呯殑鐗堟湰
淇 dzq 涓绘鏋讹紙閲嶈锛
- 鍦ㄤ綘鐨 dzq 鍚庣鐨勬牴鐩綍涓嬶紝鏂板缓涓涓枃浠跺す锛屽彨鍋氾細framework杩涘叆浣 dzq 鍚庣鏍圭洰褰曚笅鐨 vendor 鐩綍锛屾壘鍒 discuz 鏂囦欢澶癸紝鐒跺悗鎵惧埌 core 鏂囦欢澶广傛妸 core 鏂囦欢澶归噷鎵鏈夌殑鏂囦欢锛屽鍒跺埌 framework 鏂囦欢澶逛笅杩涘叆 framework 鏂囦欢澶癸紝鎵惧埌 composer.json 鏂囦欢鍦 "description" 瀛楁涓嬶紝鏂板姞鍏ヤ竴琛岋細"version": "dev-3.0-dev",淇濆瓨锛岄鍑
杩涘叆浣犵殑 DZQ 鏍圭洰褰曪紝寮鍚 cmd 缁堢锛岀劧鍚庤緭鍏 composer install锛屽鏋滅敓鎴愪簡涓涓柊鐨 composer.json.lock銆傚垯 composer 灏卞彲浠ユ甯镐娇鐢ㄤ簡