12/18/2008

12/04/2008

Install Zend_Tool in Ubuntu 8.10

As a hot PHP framework, Zend Framework offer a command tool named zend_tool, let us install it to our desktop of Ubuntu. see the following:
1 install php-cli


#sudo apt-get install php5-cli php5-dev

2 create direcotory

#cd /home/edwin/Zend
#mkdir tool
#mkdir library

3 check out load Zend framework
Zend_Tool library

#cd tool
#svn co http://framework.zend.com/svn/framework/laboratory/Zend_Tool/ ./

Zend Framework Stand Library

#cd library
#svn co http://framework.zend.com/svn/framework/standard/trunk/library/ ./

3 add 2 library to php.ini's include path

#sudo gedit /etc/php5/cli/php.ini

then , add "include_path = ".:/home/edwin/Zend/tool/library:/home/edwin/Zend/library" to the bottom line;
4 test it

#cd /home/edwin/Zend/tool/bin
#php zf.php

you will get soem errors like following:

zf.php cannot find the Zend Framework Labratory Library. Please either set the $zendFrameworkPath in zf.php OR set the ZFL_PATH environment variable.

So, that means php's include path was wrong. I checked it, but there was no problem on it. By many test about it, the solution is fllowing: you need change zf.php's directory path"/" into " DIRECTORY_SEPARATOR" .


/**
* DEV ONLY START - this will be removed when this hits incubator
*/
$zendFrameworkPath = null;
$zendFrameworkLabPath = null;

if ($zendFrameworkPath === null) {
$zendFrameworkPath = @include_once 'Zend'. DIRECTORY_SEPARATOR .'Loader.php'; //change this line
if ($zendFrameworkPath === false) {
// get the env var?
$zendFrameworkPath = getenv('ZF_PATH');
if ($zendFrameworkPath == '' || !file_exists($zendFrameworkPath)) {
die('zf.php cannot find the Zend Framework Standard Library. Please either set the $zendFrameworkPath in zf.php OR set the ZF_PATH environment v
ariable.' . PHP_EOL);
}
}
}

if ($zendFrameworkLabPath === null) {
$zendFrameworkLabPath = @include_once 'ZendL'. DIRECTORY_SEPARATOR .'Tool'. DIRECTORY_SEPARATOR .'Framework'. DIRECTORY_SEPARATOR .'Endpoint'. DIRECTORY_
SEPARATOR .'Cli.php'; //change this line
if ($zendFrameworkLabPath === false) {
// get the env var?
$zendFrameworkLabPath = getenv('ZFL_PATH');
if ($zendFrameworkLabPath == '' || !file_exists($zendFrameworkLabPath)) {
die('zf.php cannot find the Zend Framework Labratory Library. Please either set the $zendFrameworkPath in zf.php OR set the ZFL_PATH environment
variable.' . PHP_EOL);
}
}
}

if ($zendFrameworkLabPath !== 1) {
set_include_path($zendFrameworkLabPath . PATH_SEPARATOR . get_include_path());
}

if ($zendFrameworkPath !== 1) {
set_include_path($zendFrameworkPath . PATH_SEPARATOR . get_include_path());
}

unset($zendFrameworkPath, $zendFrameworkLabPath);
/**
* DEV ONLY STOP
*/

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

// run the cli endpoint
ZendL_Tool_Framework_Endpoint_Cli::main();





At the end, copy the zf.sh and zf.php to /usr/bin

#sudo cp zf.sh /usr/bin/zf
#sudo cp zf.php /usr/bin/zf.php

then, you can use the command zf at the terminal:

#zf show version
Zend Framework Version: 1.7.1

That is Ok! You could code some cool scripts by it or php-cli now

12/02/2008

Bug的级别定义

在项目开发过程中,用到的bug解决状态列举出来,希望对大家有所帮助:

  • FIXED(已解决):bug已经被解决,并且通过经过测试。
  • INVALID(不是bug):被描述的问题不是一个bug(测试人员提出这个bug,但是开发人员认为不是bug)。
  • WONTFIX(不修改bug,NeedlessFix):被描述的问题是一个bug,但是不准备进行修改。
  • LATER(下一版本再修改):被描述的问题是一个bug,但是不在当前版本中进行修改。(已经确定在下一版本修改)
  • REMIND(可能到下一个版本再修改):被描述的问题是一个bug,但是很可能不在目前版本中进行修改(注意是可能,注意later)
  • DUPLICATE(bug重复):提出的问题和当前已经存在的某个bug重复。
  • WORKSFORME(bug不能重现):不能重现这个bug,查看源代码也不知道为什么会出现这样的bug 现象,如果以后有更多的关 于这个bug的线索,将重新接受这个bug。(这个是对于那些知道有bug,但是却不能重现bug的情况)