從GitHub上複製code裝mediawiki的一次經曆

來源:互聯網
上載者:User

尋找git源

去年有一段時間我寫了一個暢言的mw外掛程式,但是感覺當時那個寫得並不是很好所以打算最近重新整理下,不巧的是前幾天作死在c9上配置ss結果原來的帳號被封了,無奈重新註冊了一個,還得重新開workspace裝一遍。

於是這次就打算試試新玩法了,我在github上star了mediawiki的git庫,我就這次想拿它裝一次,去GitHub上翻到了那個repostiory(在 這裡 ),隨便翻了release,找到了一個1.26的release,但是好像只有壓縮包下載,這好像不是我想要的(當然也有commit id,應該可以拿這個clone下來,我沒試)。回來又翻了一下branch,看到了我需要的東西

這裡的release都有對應的branch,比如 REL1_3 這個就代表著是version=1.3的release

clone代碼,目錄非空?

我挑了一個1.26的(因為我參與維護的一個wiki站就用的1.26),複製了git地址,然後回來在c9的bash下敲

git clone git@github.com:wikimedia/mediawiki.git -b REL1_26 .  

後面的那個 . 代表我要把代碼clone到當前檔案夾而不是建個檔案夾放裡。但是卻始終給我報錯

fatal: destination path '.' already exists and is not an empty directory.  

目前的目錄非空。確實非空,因為c9的workspace目錄裡有幾個用來示範的檔案,還有一個 php.ini 用來讓使用者配置自己的php環境,其他的那兩個可以刪但php.ini不太想刪,刪完怕以後麻煩,goolge了一下stackoverflow上也有人遇到了這樣的情況,後來下面有一個解決方案,看完之後我有種想撞牆的衝動233333

git init .  git remote add -t \* -f origin   git checkout master  

原文在 這裡

need composer

完整的pull下來之後乍一看佔用大小足足佔了500m,蠻大的,後來維護群裡的一位大牛說可以用 --depth=1 來指定深度嘛,好吧我竟然忘了

本以為像往常一樣,直接開啟apache和mysql就可以跑了,沒想到開啟卻提示我錯誤

細一看是需要composer,後面引導了一個官網的頁面( 這裡 ),裡面有一段話說明了如何安裝

Fetch external libraries

Starting with MediaWiki 1.25, some external libraries that MediaWiki requires are no longer in this "core" git repository. We use composer to manage them. To install these needed libraries, you have a choice:

* Download and install composer , switch to your core directory and then run composer install --no-dev. Note that if you have an existing composer.lock file you will need to run composer update --no-dev instead.

* If you don't want to use composer, or if you want to use the same set of vendor libraries as used on the WMF production cluster, you can instead git clone https://gerrit.wikimedia.org/r/p/mediawiki/vendor.git to create a vendor/ directory inside the core folder of your MediaWiki installation. Make sure you use the right branch for your MediaWiki version (e.g. REL1_25 for 1.25).

按圖索驥,先下載composer

curl -sS https://getcomposer.org/installer | php  

然後按照mw官方說明compose

composer install --no-dev  

運行後會提示當前的compose進度,等走完就可以了

core版並沒有主題

從安裝第一步開始就感覺介面怪怪的,直到後面提示我沒有主題 裝完後開啟首頁提示了我重點 查資料才知道 mw從1.24起core就不帶主題了 ,於是到這個 用git的皮膚存放庫 裡clone了了預設皮膚 Vector 到 skins/ 目錄,在 LocalSetting.php 中把皮膚require進來

require_once "$IP/skins/Vector/Vector.php";  

然後再進,一切就搞定了√

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.