Wednesday, June 11, 2014

How to use zf on mac

If you can't copy the zf library in some "global" include path, e.g. /usr/share/php/, you can still copy it where your project is and start the zf tool from there. A folder structure like:
/var/www/zf_tool
                `/bin/
                      `zf.sh
                      `zf.php
                `/library
                      `/Zend
Copy the Zend folder under library, and the zf.sh and zf.php scripts under bin and set them to be executable chmod a+x zf.sh zf.php if they are not already. Next, if you run /var/www/project/bin/zf.sh it'll look for zf files in the include_path, but if it's not there, it'll go up one folder and go into the library folder. Only if the zf library is not to be found there, it'll die with an error. In the end, creating a new zf project is simple as:
$ pwd
/var/www/zf_tool/bin
$ ./zf.sh create project /var/www/test_project

No comments: