View Source

<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[

Create a tmp directory (or something similar):

$ mkdir tmp
$ cd tmp

Check out the source for both Zend Tool and the current Standard Library

~/tmp$ svn co http://framework.zend.com/svn/framework/standard/branches/user/ralph/ZendTool
~/tmp$ svn co http://framework.zend.com/svn/framework/standard/trunk/library ./trunk-library
~/tmp$ ls
ZendTool trunk-library

Find your PATH, and create a symlink to the zf.sh executable.

~/tmp$ env | grep "PATH"
MANPATH=/usr/share/man:/usr/local/share/man:/usr/X11/man
PATH=/Users/ralphschindler/.bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

~/tmp$ ln -s /Users/ralphschindler/tmp/ZendTool/bin/zf.sh /Users/ralphschindler/.bin/zf
~/tmp$ chmod 755 ZendTool/bin/zf.sh

Set an environment variable ZF_PATH to point to the newly checked out trunk-library

~/tmp$ export ZF_PATH="/Users/ralphschindler/tmp/trunk-library/"

Lets show the version:

~/tmp$ zf show version
Zend Framework Version: 1.5.2

Lets try variations of the show version command:

~/tmp$ zf show version -n 0
1.5.2

~/tmp$ zf show version.major-part
ZF Major Version: 1

~/tmp$ zf show version.minor-part
ZF Minor Version: 5

~/tmp$ zf show version.mini-part
ZF Mini Version: 2

~/tmp$ zf show version -m major
Zend Framework Version: 1

~/tmp$ zf show version -m minor -n 0
1.5

~/tmp$ zf show version -m major -n 0
1

Lets create a project now, and check out what it created:

~/tmp/scratch$ zf create project
creating project at /Users/ralphschindler/tmp/scratch

~/tmp/scratch$ ls -la
total 8
drwxr-xr-x 6 ralphschindler staff 204 Jun 3 01:28 .
drwxr-xr-x 5 ralphschindler staff 170 Jun 3 01:28 ..
-rw-r--r-- 1 ralphschindler staff 1562 Jun 3 01:28 .zfproject.xml
drwxr-xr-x 7 ralphschindler staff 238 Jun 3 01:28 application
drwxr-xr-x 3 ralphschindler staff 102 Jun 3 01:28 library
drwxr-xr-x 4 ralphschindler staff 136 Jun 3 01:28 public

~/tmp/scratch$ find .
.
./.zfproject.xml
./application
./application/bootstrap.php
./application/configs
./application/controllers
./application/controllers/ErrorController.php
./application/controllers/IndexController.php
./application/models
./application/views
./application/views/helpers
./application/views/scripts
./application/views/scripts/index
./application/views/scripts/index/index.phtml
./library
./library/Zend
./public
./public/.htaccess
./public/index.php

~/tmp/scratch$ cat .zfproject.xml
<?xml version="1.0"?>
<projectProfile>
<projectDirectory>
<projectProfileFile/>
<applicationDirectory>
<apisDirectory enabled="false"/>
<configsDirectory/>
<controllersDirectory>
<controllerFile controllerName="index"/>
<controllerFile controllerName="error"/>
</controllersDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<modulesDirectory enabled="false"/>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="index">
<viewScriptFile scriptName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
</viewsDirectory>
<bootstrapFile/>
</applicationDirectory>
<dataDirectory enabled="false">
<cacheDirectory enabled="false"/>
<searchIndexesDirectory enabled="false"/>
<localesDirectory enabled="false"/>
<logsDirectory enabled="false"/>
<sessionsDirectory enabled="false"/>
<uploadsDirectory enabled="false"/>
</dataDirectory>
<libraryDirectory>
<zfStandardLibraryDirectory/>
</libraryDirectory>
<publicDirectory>
<publicStylesheetsDirectory enabled="false"/>
<publicScriptsDirectory enabled="false"/>
<publicImagesDirectory enabled="false"/>
<publicIndexFile/>
<htaccessFile/>
</publicDirectory>
<providersDirectory enabled="false"/>
</projectDirectory>
</projectProfile>


Lets add a controller:


~/tmp/scratch$ zf create controller --name foo
Creating new controller named 'foo'
Updating project profile '/Users/ralphschindler/tmp/scratch/.zfproject.xml'
Creating a view script.
Updating project profile '/Users/ralphschindler/tmp/scratch/.zfproject.xml'


~/tmp/scratch$ find .
.
./.zfproject.xml
./application
./application/bootstrap.php
./application/configs
./application/controllers
./application/controllers/ErrorController.php
./application/controllers/FooController.php
./application/controllers/IndexController.php
./application/models
./application/views
./application/views/helpers
./application/views/scripts
./application/views/scripts/foo
./application/views/scripts/foo/index.phtml
./application/views/scripts/index
./application/views/scripts/index/index.phtml
./library
./library/Zend
./public
./public/.htaccess
./public/index.php


~/tmp/scratch$ cat .zfproject.xml
<?xml version="1.0"?>
<projectProfile>
<projectDirectory>
<projectProfileFile/>
<applicationDirectory>
<apisDirectory enabled="false"/>
<configsDirectory/>
<controllersDirectory>
<controllerFile controllerName="index"/>
<controllerFile controllerName="error"/>
<controllerFile controllerName="foo"/>
</controllersDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<modulesDirectory enabled="false"/>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="index">
<viewScriptFile scriptName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="foo">
<viewScriptFile scriptName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
</viewsDirectory>
<bootstrapFile/>
</applicationDirectory>
<dataDirectory enabled="false">
<cacheDirectory enabled="false"/>
<searchIndexesDirectory enabled="false"/>
<localesDirectory enabled="false"/>
<logsDirectory enabled="false"/>
<sessionsDirectory enabled="false"/>
<uploadsDirectory enabled="false"/>
</dataDirectory>
<libraryDirectory>
<zfStandardLibraryDirectory/>
</libraryDirectory>
<publicDirectory>
<publicStylesheetsDirectory enabled="false"/>
<publicScriptsDirectory enabled="false"/>
<publicImagesDirectory enabled="false"/>
<publicIndexFile/>
<htaccessFile/>
</publicDirectory>
<providersDirectory enabled="false"/>
</projectDirectory>
</projectProfile>


~/tmp/scratch$ zf create controller -n bar -v 0
Creating new controller named 'bar'
Updating project profile '/Users/ralphschindler/tmp/scratch/.zfproject.xml'

~/tmp/scratch$ find .
.
./.zfproject.xml
./application
./application/bootstrap.php
./application/configs
./application/controllers
./application/controllers/BarController.php
./application/controllers/ErrorController.php
./application/controllers/FooController.php
./application/controllers/IndexController.php
./application/models
./application/views
./application/views/helpers
./application/views/scripts
./application/views/scripts/foo
./application/views/scripts/foo/index.phtml
./application/views/scripts/index
./application/views/scripts/index/index.phtml
./library
./library/Zend
./public
./public/.htaccess
./public/index.php
~/tmp/scratch$ cat .zfproject.xml
<?xml version="1.0"?>
<projectProfile>
<projectDirectory>
<projectProfileFile/>
<applicationDirectory>
<apisDirectory enabled="false"/>
<configsDirectory/>
<controllersDirectory>
<controllerFile controllerName="index"/>
<controllerFile controllerName="error"/>
<controllerFile controllerName="foo"/>
<controllerFile controllerName="bar"/>
</controllersDirectory>
<layoutsDirectory enabled="false"/>
<modelsDirectory/>
<modulesDirectory enabled="false"/>
<viewsDirectory>
<viewScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="index">
<viewScriptFile scriptName="index"/>
</viewControllerScriptsDirectory>
<viewControllerScriptsDirectory forControllerName="foo">
<viewScriptFile scriptName="index"/>
</viewControllerScriptsDirectory>
</viewScriptsDirectory>
<viewHelpersDirectory/>
<viewFiltersDirectory enabled="false"/>
</viewsDirectory>
<bootstrapFile/>
</applicationDirectory>
<dataDirectory enabled="false">
<cacheDirectory enabled="false"/>
<searchIndexesDirectory enabled="false"/>
<localesDirectory enabled="false"/>
<logsDirectory enabled="false"/>
<sessionsDirectory enabled="false"/>
<uploadsDirectory enabled="false"/>
</dataDirectory>
<libraryDirectory>
<zfStandardLibraryDirectory/>
</libraryDirectory>
<publicDirectory>
<publicStylesheetsDirectory enabled="false"/>
<publicScriptsDirectory enabled="false"/>
<publicImagesDirectory enabled="false"/>
<publicIndexFile/>
<htaccessFile/>
</publicDirectory>
<providersDirectory enabled="false"/>
</projectDirectory>
</projectProfile>

]]></ac:plain-text-body></ac:macro>