Wednesday 29 September 2010

Git setup

user: 
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

editor:
$ git config --global core.editor emacs
 
diff tool:
$ git config --global merge.tool vimdiff
 
list your settings
$ git config --list 
or check specific value
$ git config user.name

help:
$ git help <verb>
$ git <verb> --help
$ man git-<verb>  
example: 
$ git help config 

source: http://progit.org/book/ch1-5.html

Wednesday 22 September 2010

PHP Environment setup - Netbeans, PHPUnit and xdebug

- filenames (paths) will be different for every platform/version
wamp server
Install wamp:
http://www.wampserver.com/en/

pear
open command line, go to:
C:\wamp\bin\php\php5.3.0
execute: 
php -d phar.require_hash=0 PEAR/go-pear.phar
and choose all defualt options (first option)

xdebug
start wamp sever and enable php curl extension

copy php info output and paste it here:
http://www.xdebug.org/find-binary.php
it shows you what xdebug version to download and where to put it

modify both php.ini (c:\wamp\bin\php\php5.3.0\php.ini and c:\wamp\bin\apache\Apache2.2.11\bin\php.ini)
add these lines at the end:

zend_extension = c:\wamp\bin\php\php5.3.0\ext\php_xdebug-2.1.0-5.3-vc6.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

your xdebug version could be different
restart apache server

netbeans
download and install netbeans (php)
http://netbeans.org/downloads/

phpunit
type on command line:
pear upgrade pear
pear channel-discover pear.phpunit.de
pear channel-discover pear.symfony-project.com
pear install phpunit/PHPUnit

make sure that you included PEAR in both php.ini:
include_path = ".;c:\wamp\bin\php\php5.3.0\PEAR"

restart apache

integrate with netbeans
in netbeans go to:
Tools -> Options -> PHP

under general tab, PHP 5 Interpreter:
C:\wamp\bin\php\php5.3.0\php.exe
Debugger port: 9000
Session ID: netbeans-xdebug

Under Unit Testing tab:
PHPUnit script: C:\wamp\bin\php\php5.3.0\phpunit.bat

vimrc

general vimrc file

" indent
set autoindent
set smartindent

" spaces instead of tab
set tabstop=4
set shiftwidth=4

" briefly jumps to the matching brace/bracket
set showmatch

" flashes the screen when the command does not work instead of beep
set vb t_vb=

set ruler " show the cursor position all the time
set scrolloff=3 " keep 3 lines when scrolling
syntax on " syntax highlighing

" font and color
set guifont=Courier_New
colorscheme koehler

" turn backup off
set nobackup

" line numbers
:set nu