|
|
@@ -4,13 +4,13 @@
|
|
|
<title>Using the CLI Tool</title>
|
|
|
|
|
|
<para>
|
|
|
- The CLI, or command line tool (internally known as the console tool), is
|
|
|
- currently the primary interface for dispatching <code>Zend_Tool</code>
|
|
|
- requests. With the CLI tool, developers can issue tooling requests
|
|
|
+ The <acronym>CLI</acronym>, or command line tool (internally known as the console tool),
|
|
|
+ is currently the primary interface for dispatching <classname>Zend_Tool</classname>
|
|
|
+ requests. With the <acronym>CLI</acronym> tool, developers can issue tooling requests
|
|
|
inside the "command line windows", also commonly known as a "terminal"
|
|
|
window. This environment is predominant in the *nix environment, but
|
|
|
also has a common implementation in windows with the
|
|
|
- <code>cmd.exe</code>, console2 and also with the Cygwin project.
|
|
|
+ <filename>cmd.exe</filename>, console2 and also with the Cygwin project.
|
|
|
</para>
|
|
|
|
|
|
<sect2 id="zend.tool.framework.clitool.setup-general">
|
|
|
@@ -20,21 +20,22 @@
|
|
|
To issue tooling requests via the command line client, you first
|
|
|
need to set up the client so that your system can handle the "zf"
|
|
|
command. The command line client, for all intents and purposes, is
|
|
|
- the <code>.sh</code> or <code>.bat</code> file that is provided with
|
|
|
+ the <filename>.sh</filename> or <filename>.bat</filename> file that is provided with
|
|
|
your Zend Framework distribution. In trunk, it can be found here:
|
|
|
- <ulink url="http://framework.zend.com/svn/framework/standard/trunk/bin/">http://framework.zend.com/svn/framework/standard/trunk/bin/</ulink>
|
|
|
+ <ulink
|
|
|
+ url="http://framework.zend.com/svn/framework/standard/trunk/bin/">http://framework.zend.com/svn/framework/standard/trunk/bin/</ulink>.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- As you can see, there are 3 files in the <code>bin/</code>
|
|
|
- directory: a <code>zf.php</code>, <code>zf.sh</code>, and
|
|
|
- <code>zf.bat</code>. The <code>zf.sh</code> and the
|
|
|
- <code>zf.bat</code> are the operating system specific client
|
|
|
- wrappers: <code>zf.sh</code> for the *nix environment, and <code>zf.bat</code>
|
|
|
- for the Win32 environment. These client wrappers are responsible
|
|
|
- for finding the proper <code>php.exe</code>, finding the
|
|
|
- <code>zf.php</code>, and passing on the client request. The
|
|
|
- <code>zf.php</code> is the responsible for handling understanding
|
|
|
+ As you can see, there are 3 files in the <filename>/bin/</filename>
|
|
|
+ directory: a <filename>zf.php</filename>, <filename>zf.sh</filename>, and
|
|
|
+ <filename>zf.bat</filename>. The <filename>zf.sh</filename> and the
|
|
|
+ <filename>zf.bat</filename> are the operating system specific client
|
|
|
+ wrappers: <filename>zf.sh</filename> for the *nix environment, and
|
|
|
+ <filename>zf.bat</filename> for the Win32 environment. These client wrappers are
|
|
|
+ responsible for finding the proper <filename>php.exe</filename>, finding the
|
|
|
+ <filename>zf.php</filename>, and passing on the client request. The
|
|
|
+ <filename>zf.php</filename> is the responsible for handling understanding
|
|
|
your environment, constructing the proper include_path, and passing
|
|
|
what is provided on the command line to the proper library component
|
|
|
for dispatching.
|
|
|
@@ -48,24 +49,27 @@
|
|
|
<orderedlist>
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- <code>zf.sh/zf.bat</code> is reachable from your system
|
|
|
- path. This is the ability to call <code>zf</code> from
|
|
|
+ <filename>zf.sh/zf.bat</filename> is reachable from your system
|
|
|
+ path. This is the ability to call <command>zf</command> from
|
|
|
anywhere on your command line, regardless of what your
|
|
|
current working directory is.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
<listitem>
|
|
|
<para>
|
|
|
- ZendFramework/library is in your <code>include_path</code>.
|
|
|
+ <filename>ZendFramework/library</filename> is in your
|
|
|
+ <property>include_path</property>.
|
|
|
</para>
|
|
|
</listitem>
|
|
|
</orderedlist>
|
|
|
|
|
|
- <para>
|
|
|
- <emphasis>Note:</emphasis> while the above are the most ideal
|
|
|
- requirements, you can simply download Zend Framework and expect it
|
|
|
- to work as <code>./path/to/zf.php</code> some command.
|
|
|
- </para>
|
|
|
+ <note>
|
|
|
+ <para>
|
|
|
+ Note: while the above are the most ideal
|
|
|
+ requirements, you can simply download Zend Framework and expect it
|
|
|
+ to work as <filename>./path/to/zf.php</filename> some command.
|
|
|
+ </para>
|
|
|
+ </note>
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
@@ -74,8 +78,8 @@
|
|
|
|
|
|
<para>
|
|
|
The most common setup in the *nix environment, is to copy the
|
|
|
- <code>zf.sh</code> and <code>zf.php</code> into the same directory
|
|
|
- as your PHP binary. This can generally be found in one of the
|
|
|
+ <filename>zf.sh</filename> and <filename>zf.php</filename> into the same directory
|
|
|
+ as your <acronym>PHP</acronym> binary. This can generally be found in one of the
|
|
|
following places:
|
|
|
</para>
|
|
|
|
|
|
@@ -87,22 +91,23 @@
|
|
|
]]></programlisting>
|
|
|
|
|
|
<para>
|
|
|
- To find out the location of your PHP binary, you can execute 'which
|
|
|
- php' on the command line. This will return the location of the php
|
|
|
- binary you will be using to run php scripts in this environment.
|
|
|
+ To find out the location of your <acronym>PHP</acronym> binary, you can execute 'which
|
|
|
+ php' on the command line. This will return the location of the <acronym>PHP</acronym>
|
|
|
+ binary you will be using to run <acronym>PHP</acronym> scripts in this environment.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- The next order of business is to ensure that the Zend Framework
|
|
|
- library is set up correctly inside of the system PHP
|
|
|
- <code>include_path</code>. To find out where your
|
|
|
- <code>include_path</code> is located, you can execute 'php -i' and
|
|
|
- look for the <code>include_path</code> variable, or more succinctly,
|
|
|
- execute 'php -i | grep include_path'. Once you have found where
|
|
|
- your <code>include_path</code> is located (this will generally be
|
|
|
- something like /usr/lib/php, /usr/share/php, /usr/local/lib/php, or
|
|
|
- similar), ensure that the contents of the library/ directory are put
|
|
|
- inside your <code>include_path</code> specified directory.
|
|
|
+ The next order of business is to ensure that Zend Framework
|
|
|
+ library is set up correctly inside of the system <acronym>PHP</acronym>
|
|
|
+ <property>include_path</property>. To find out where your
|
|
|
+ <property>include_path</property> is located, you can execute <command>php -i</command>
|
|
|
+ and look for the <property>include_path</property> variable, or more succinctly,
|
|
|
+ execute <command>php -i | grep include_path</command>. Once you have found where
|
|
|
+ your <property>include_path</property> is located (this will generally be
|
|
|
+ something like <filename>/usr/lib/php</filename>, <filename>/usr/share/php</filename>,
|
|
|
+ <filename>/usr/local/lib/php</filename>, or similar), ensure that the contents of the
|
|
|
+ <filename>/library/</filename> directory are put
|
|
|
+ inside your <property>include_path</property> specified directory.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
@@ -127,19 +132,19 @@
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- <emphasis>ALTERNATIVE SETUP</emphasis> involves keeping the Zend
|
|
|
- Framework download together as is, and creating a link from a PATH
|
|
|
- location to the <code>zf.sh</code>. What this means is you can
|
|
|
+ <emphasis>Alternative Setup</emphasis> involves keeping the Zend
|
|
|
+ Framework download together as is, and creating a link from a <constant>PATH</constant>
|
|
|
+ location to the <filename>zf.sh</filename>. What this means is you can
|
|
|
place the contents of the ZendFramework download into a location
|
|
|
- such as <code>/usr/local/share/ZendFramework</code>, or more locally
|
|
|
- like <code>/home/username/lib/ZendFramework</code>, and creating a
|
|
|
- symbolic link to the <code>zf.sh</code>.
|
|
|
+ such as <filename>/usr/local/share/ZendFramework</filename>, or more locally
|
|
|
+ like <filename>/home/username/lib/ZendFramework</filename>, and creating a
|
|
|
+ symbolic link to the <filename>zf.sh</filename>.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- Assuming you want to put the link inside <code>/usr/local/bin</code>
|
|
|
+ Assuming you want to put the link inside <filename>/usr/local/bin</filename>
|
|
|
(this could also work for placing the link inside
|
|
|
- <code>/home/username/bin/</code> for example) you would issue a
|
|
|
+ <filename>/home/username/bin/</filename> for example) you would issue a
|
|
|
command similar to this: </para>
|
|
|
|
|
|
<programlisting language="sh"><![CDATA[
|
|
|
@@ -161,8 +166,8 @@ ln -s /home/username/lib/ZendFramework/bin/zf.sh /home/username/bin/zf
|
|
|
|
|
|
<para>
|
|
|
The most common setup in the Windows Win32 environment, is to copy
|
|
|
- the <code>zf.bat</code> and <code>zf.php</code> into the same
|
|
|
- directory as your PHP binary. This can generally be found in one of
|
|
|
+ the <filename>zf.bat</filename> and <filename>zf.php</filename> into the same
|
|
|
+ directory as your <acronym>PHP</acronym> binary. This can generally be found in one of
|
|
|
the following places:
|
|
|
</para>
|
|
|
|
|
|
@@ -173,25 +178,26 @@ C:\WAMP\PHP\bin
|
|
|
]]></programlisting>
|
|
|
|
|
|
<para>
|
|
|
- You should be able to run <code>php.exe</code> on the command line.
|
|
|
+ You should be able to run <filename>php.exe</filename> on the command line.
|
|
|
If you are not able to, first check the documentation that came with
|
|
|
- your PHP distribution, or ensure that the path to php.exe is in your
|
|
|
- windows PATH environment variable.
|
|
|
+ your <acronym>PHP</acronym> distribution, or ensure that the path to
|
|
|
+ <filename>php.exe</filename> is in your
|
|
|
+ Windows <constant>PATH</constant> environment variable.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- The next order of business is to ensure that the Zend Framework
|
|
|
- library is set up correctly inside of the system PHP
|
|
|
- <code>include_path</code>. To find out where your
|
|
|
- <code>include_path</code> is located, you can type 'php -i' and look
|
|
|
- for the <code>include_path</code> variable, or more succinctly
|
|
|
- execute 'php -i | grep include_path' if you have Cygwin setup with
|
|
|
+ The next order of business is to ensure that Zend Framework
|
|
|
+ library is set up correctly inside of the system <acronym>PHP</acronym>
|
|
|
+ <property>include_path</property>. To find out where your
|
|
|
+ <property>include_path</property> is located, you can type <command>php -i</command> and
|
|
|
+ look for the <property>include_path</property> variable, or more succinctly
|
|
|
+ execute <command>php -i | grep include_path</command> if you have Cygwin setup with
|
|
|
grep available. Once you have found where your
|
|
|
- <code>include_path</code> is located (this will generally be
|
|
|
- something like <code>C:\PHP\pear</code>, <code>C:\PHP\share</code>,
|
|
|
- <code>C:\Program Files\ZendServer\share</code> or similar), ensure
|
|
|
+ <property>include_path</property> is located (this will generally be
|
|
|
+ something like <filename>C:\PHP\pear</filename>, <filename>C:\PHP\share</filename>,
|
|
|
+ <filename>C:\Program%20Files\ZendServer\share</filename> or similar), ensure
|
|
|
that the contents of the library/ directory are put inside your
|
|
|
- <code>include_path</code> specified directory.
|
|
|
+ <property>include_path</property> specified directory.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
@@ -216,15 +222,15 @@ C:\WAMP\PHP\bin
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- <emphasis>ALTERNATIVE SETUP</emphasis> involves keeping the Zend
|
|
|
+ <emphasis>Alternative Setup</emphasis> involves keeping the Zend
|
|
|
Framework download together as is, and altering both your system
|
|
|
- PATH as well as the <code>php.ini</code> file. In your user's
|
|
|
- environment, make sure to add
|
|
|
- <code>C:\Path\To\ZendFramework\bin</code>, so that your
|
|
|
- <code>zf.bat</code> file is executable. Also, alter the
|
|
|
- <code>php.ini</code> file to ensure that
|
|
|
- <code>C:\Path\To\ZendFramework\library</code> is in your
|
|
|
- <code>include_path</code>.
|
|
|
+ <constant>PATH</constant> as well as the <filename>php.ini</filename> file.
|
|
|
+ In your user's environment, make sure to add
|
|
|
+ <filename>C:\Path\To\ZendFramework\bin</filename>, so that your
|
|
|
+ <filename>zf.bat</filename> file is executable. Also, alter the
|
|
|
+ <filename>php.ini</filename> file to ensure that
|
|
|
+ <filename>C:\Path\To\ZendFramework\library</filename> is in your
|
|
|
+ <property>include_path</property>.
|
|
|
</para>
|
|
|
|
|
|
</sect2>
|
|
|
@@ -233,25 +239,25 @@ C:\WAMP\PHP\bin
|
|
|
<title>Other Setup Considerations</title>
|
|
|
|
|
|
<para>
|
|
|
- If for some reason you do not want the Zend Framework library inside
|
|
|
- your <code>include_path</code>, there is another option. There are
|
|
|
- two special environment variables that <code>zf.php</code> will
|
|
|
+ If for some reason you do not want Zend Framework library inside
|
|
|
+ your <property>include_path</property>, there is another option. There are
|
|
|
+ two special environment variables that <filename>zf.php</filename> will
|
|
|
utilize to determine the location of your Zend Framework
|
|
|
installation.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- The first is <code>ZEND_TOOL_INCLUDE_PATH_PREPEND</code>, which will
|
|
|
+ The first is <constant>ZEND_TOOL_INCLUDE_PATH_PREPEND</constant>, which will
|
|
|
prepend the value of this environment variable to the system
|
|
|
- (<code>php.ini</code>) <code>include_path</code> before loading the
|
|
|
+ (<filename>php.ini</filename>) <property>include_path</property> before loading the
|
|
|
client.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
Alternatively, you might want to use
|
|
|
- <code>ZEND_TOOL_INCLUDE_PATH</code> to completely
|
|
|
- <emphasis>replace</emphasis> the system <code>include_path</code>
|
|
|
- for one that makes sense specifically for the <code>zf</code>
|
|
|
+ <constant>ZEND_TOOL_INCLUDE_PATH</constant> to completely
|
|
|
+ <emphasis>replace</emphasis> the system <property>include_path</property>
|
|
|
+ for one that makes sense specifically for the <command>zf</command>
|
|
|
command line tool.
|
|
|
</para>
|
|
|
</sect2>
|
|
|
@@ -261,8 +267,8 @@ C:\WAMP\PHP\bin
|
|
|
|
|
|
<para>
|
|
|
At this point, you should be set up to start initiating some more
|
|
|
- "interesting" commands. To get going, you can issue the <code>zf
|
|
|
- --help</code> command to see what is available to you.
|
|
|
+ "interesting" commands. To get going, you can issue the
|
|
|
+ <command>zf --help</command> command to see what is available to you.
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
@@ -271,8 +277,8 @@ C:\WAMP\PHP\bin
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- Continue on to the <code>Zend_Tool_Project</code> "Create Project"
|
|
|
- section to understand how to use the <code>zf</code> script for
|
|
|
+ Continue on to the <classname>Zend_Tool_Project</classname> "Create Project"
|
|
|
+ section to understand how to use the <command>zf</command> script for
|
|
|
project creation.
|
|
|
</para>
|
|
|
</sect2>
|