'개발일지'에 해당되는 글 4건

  1. 2010/10/06 머큐리얼 설치후 couldn't find mercurial libraries 에러 뜰때
  2. 2010/10/05 Trac + SVN 팁
  3. 2010/02/01 코드이그나이터 HMVC 모듈 사용할때 폼 검증 콜백 안먹힐때
  4. 2010/01/28 코드이그나이터 최적세팅 (웹호스팅환경하^^)

머큐리얼 설치후 couldn't find mercurial libraries 에러 뜰때

개발일지 2010/10/06 15:37
머큐리얼 설치후 hg를 실행했을 때 couldn't find mercurial libraries 라는 에러가 뜨면 PYTHONPATH 경로를 잡아줘야 한다.

경로를 잡아주거나
export PYTHONPATH=/usr/local/lib64/python2.4/site-packages
아래와 같이 수정한다
mv /usr/local/bin/hg /usr/local/bin/hg.py
cat > /usr/local/bin/hg <<\EOF
PYTHONPATH=/usr/local/lib64/python2.4/site-packages:${PYTHONPATH}
export PYTHONPATH
exec /usr/local/bin/hg.py "$@"
EOF

그래도 동일한 에러가 계속 뜨면 경로를 확인해보기
find / -name 'mercurial' -print

출처 : http://mercurial.selenic.com/wiki/UnixInstall

tags : Mercurial
Trackback 0 : Comment 0

Trac + SVN 팁

개발일지 2010/10/05 11:07
1. Trac 설치후 trac-admin으로 새 프로젝트를 설정을 할때 0.12부터는 소스코드 리파지토리(source code repository)를 묻지 않는다.

# trac-admin /path/to/myproject initenv

프로젝트 설정후 소스코드 리파지토리를 따로 설정해준다.  

# Trac [/path/to/myproject] > repository <repos> <dir> [type]


2. 관리자 등록하기

# Trac [/path/to/myproject] > permission add 아이디 TRAC_ADMIN

3. yum이 아닌 소스로 설치시 SQLite 버전이 달라서 아파치에서 아래와 같이 에러가 뜰때

[Fri Oct 01 17:44:59 2010] [error] [client x.x.x.x] (20014)Internal error: SQLite compiled for 3.6.20, but running with 3.3.7
[Fri Oct 01 17:44:59 2010] [error] [client x.x.x.x] Could not fetch resource information.  [500, #0]
[Fri Oct 01 17:44:59 2010] [error] [client x.x.x.x] Could not open the requested SVN filesystem  [500, #200030]
[Fri Oct 01 17:44:59 2010] [error] [client x.x.x.x] Could not open the requested SVN filesystem  [500, #200030]

출처 : http://www.snowbotic.com/archives/61


4. libsvn_subr-1.so.0: undefined symbol: sqlite3_open_v2 에러가 날때

subversion 컴파일을 새로 해야 한다.
subversion 소스 디렉토리에 sqlite-amalgamation 디렉토리를 만들고
sqlite3 소스 디렉토리에 있는 sqlite3.c을 sqlite-amalgamation/sqlite3.c로 복사하고  subversion 재 컴파일

mkdir subversion-1.6.6/sqlite-amalgamation
cp sqlite-3.6.20/sqlite3.c subversion-1.6.6/sqlite-amalgamation/sqlite3.c
cd subversion-1.6.6
./configure –with-apxs=/usr/local/apache/bin/apxs –with-apr=/usr/local/apache/bin/apr-config –with-apr-util=/home/xxx/src/httpd-2.2.9/srclib/apr-util   
make    
make install

출처 : http://www.webxpert.ro/andrei/2010/03/12/install-subversion-for-vps-cpanel-under-centos/


참고할만한 사이트

트랙리뷰 http://digitz.tistory.com/314

협업을 위한 Trac 사용 가이드 http://royalvip.pe.kr/15

trac, Ticket system과 workflow의 이해 http://blog.imcdream.net/297

Subversion의 commit과 Trac 연동하기 http://ktd2004.tistory.com/16

필수 플러그인 http://kimbeast.blog.me/60043933989

Trac 무료호스팅 http://www.assembla.com/ (단, 무료버전은 public -_-)

tags : Subversion, Trac
Trackback 0 : Comment 0

코드이그나이터 HMVC 모듈 사용할때 폼 검증 콜백 안먹힐때

개발일지 2010/02/01 17:30

CodeIgniter HMVC 모듈을 사용해 폼 검증을 하면 콜백함수가 안먹힌다.

 

$this->form_validation->set_rules( 'username', 'Username', 'callback_username_check' );

 

콜백을 호출하면 Form_validation.php의    

if ( ! method_exists($this->CI, $rule))에서 클래스 메쏘드를 찾을수 없음

 

삽질하다가 구글링을 했는데 오호 역시 구글 ^^;;

 

http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/

http://codeigniter.com/forums/viewthread/92212/P90/#578755

 

application/libraries/MY_Form_validation.php 파일 추가

class MY_Form_validation extends CI_Form_validation
{
   
function run($module = '', $group = '')
{        
       
(is_object($module)) AND $this->CI =& $module
;
        return
parent::run($group
);
   
}    
}
/* End of file MY_Form_validation.php */

/* Location: ./application/libraries/MY_Form_validation.php */

 

폼검증부분에서 $this->form_validation->run()  부분을 아래와 같이 $this 추가

if ($this->form_validation->run($this)) {
   
...
}

 

tags : codeigniter
Trackback 0 : Comment 0

코드이그나이터 최적세팅 (웹호스팅환경하^^)

개발일지 2010/01/28 02:43

http://codeigniter.com/에서 최신버전 다운로드

 

코드이그나이터 압축을 풀면 구조는 아래와 같다.

/system/
/system/application/
/user_guide/
index.php


/system/밑에 application을 상위디렉토리로 이동한다(관리가 용이함 ^^)

index.php에서 application 경로 수정.

/system/
/application/
/user_guide/
index.php

 

 

* 멀티도메인 또는 개발&실서버를 같이 돌릴경우 application 폴더를 2개로 복사.

/system/
/app_dev/ (개발서버)
/app_live/ (실서버)

index.php

 

/index.php 를 /app_dev/와 /app_live에 각각 복사하고 i

/system/
/app_dev/index.php
/app_dev/index.php

 

/app_dev/index.php와  /app_live/index.php 경로 수정하기

$system_folder = "../system";
$application_folder = "../app_dev";

$system_folder = "../system";
$application_folder = "../app_live";


/.htaccess 파일을 추가해 각각 도메인별로 경로세팅

RewriteEngine on

RewriteCond %{HTTP_HOST}  aaa.kr$ [NC]
RewriteCond %{REQUEST_URI} !^/app_live/.*$
RewriteRule ^(.*)$  /app_live/$1 [L]

RewriteCond %{HTTP_HOST}  test.hosting.com$ [NC]
RewriteCond %{REQUEST_URI} !^/app_dev/.*$
RewriteRule ^(.*)$  /app_dev/$1 [L]

 

/app_dev/.htaccess /app_live/.htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

 

css, images, js등은 RewriteCond에 추가해서 / 로 빼줘도 되지만

관리효율성 차원에서 app_dev/css, app_dev/images 처리하는게 좋음.

 

효율적인 구조관리

http://codeigniter.com/wiki/Modular_Extensions_-_HMVC 

압축풀어 app_dev/libraries/ 밑에 모두 복사

 

app/dev/modules 폴더 만들고 구조관리

app/dev/modules/member

app/dev/modules/member/controller

app/dev/modules/member/models

 

다른 모델 호출시 $this->load->model('경로명/모델명');

실행   echo modules::run('test/controller/함수명');

 

 

보안관련

http://kylehasegawa.com/codeigniter-csrf-xsrf-library

 

 

 

 

tags : codeigniter
Trackback 0 : Comment 0