人生如夢 apache mod_rewrite …

讓不同使用者共用一個 codeIgniter 專案時,可以共用的.htaccess rewrite,
這問題已經卡了快超過一年…
終於試著解決了…
RewriteEngine on
RewriteCond $1 !^(index.php|images|robots.txt|assets|temp)
RewriteCond %{REQUEST_FILENAME} ^/home/(.+)/www/(.+)/(.*)
RewriteRule ^(.*)$ /~%1/%2/index.php/$1
成效:
網址 http://site.com/~user/project/index.php/controller/method/
首頁 /home/user/www/project/index.php
運作成功後可以在 $user 與 $project 變動的情況下,省略index.php  ,
透過 RewriteCond 分析 REQUEST_FILENAME 參數將路徑切割成 %1 = user %2 = project
再映對至index.php前的路徑。
debug心得:
由於實際在測時很難知道 rewrite 變數的實際值,所以可以建立一個 php 檔案印出 $_SERVER 並將變數內容導至該php ,
例如:
RewriteCond %{REQUEST_FILENAME} ^(.*)$
RewriteRule ^(.*)$ index.php?%1
這樣就能看到該變數的值了…再慢慢分析……阿阿阿
參考資源:
http://corz.org/serv/tricks/htaccess2.php 這裡面很多例子很豐富~

輕量級標記語言 Lightweight markup language

最近想要找一款可以用純文字編輯又可以轉換成網頁的文字格式,一開始想到的就是wiki百科了,

想要建立一個專案管理系統,又可以同時管理專案文件,但是又想要讓文件可以跟程式一起納入版本控制管理,

比較具有移植性,所以就四處尋覓…剛好找到一款vst http://edt1023.sayya.org/vim/vst/index.html 的介紹網頁…

Continue reading…

git web interface and author blog

專案共享:

目前用share file的方式 共用專案,

在Repo 設了相同群組並設定 git config core.sharedRepository true

同群組就可以一起push push囉!

隔幾天要建新的專案時又遇到同個問題,找很久才發現,

還要另外設


chmod -R g+s `find $repo -type d`

git remote add origin $path

git push origin master

好像是要幫資料設某些標誌,主要是要解決push以後使用者的群組權限有問題,這樣 push 以後在 objects 裡面自動建立的物件 擁有者群組就是 原始群組了

參考資訊:http://criticallog.thornet.net/2010/01/07/sharing-your-git-repository/

http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html

http://stackoverflow.com/questions/3242282/how-to-configure-an-existing-git-repo-to-be-shared-by-a-unix-group

git-svn:

用 git 控制 svn 專案小撇步,除了學會git-svn指令以外,還可以弄些 alias 簡化操作,

順便提到 git svn 繳交跟更新的alias, git ready 看到的方法,

spull = !git-svn fetch && git-svn rebase 

,fetch是取,rebase 是重整索引,

只是會遇到 rebase needs update 的問題,如果有本地端修改的話,所以我把他改成

spull = !git-svn fetch && git stash && git-svn rebase && git stash apply
//讓他先 stash 起來 rebase 完再套用回去。
spush = !git-svn dcommit. //單純 svn commit ,git 的版本

這樣使用就很方便了~就能全部都換成~~~git囉囉囉囉~~~只是 svn 轉接過來的專案還是會有些慢,接下來試著銜接 branch 看看有沒有問題。

git 相關網站紀錄:

http://www.xiphux.com/programming/gitphp/

http://www.ohloh.net/p/gitphp

http://people.proekspert.ee/peeter/git/git.php

8種分享 git 專暗的方式 http://www.jedi.be/blog/2009/05/06/8-ways-to-share-your-git-repository/

http://gitready.com/

寫的不錯的使用手冊 http://tkg.im.ncue.edu.tw/?p=755

電子書線上版 PRO GIT http://progit.org/book/