Copyright 2012-2013 Sebastian Kurfürst, sandstorm|media
First, you need to install oh-my-zsh from https://github.com/robbyrussell/oh-my-zsh.git
Then, install this repository inside custom/plugins
of your oh-my-zsh directory:
mkdir -p .oh-my-zsh/custom/plugins cd .oh-my-zsh/custom/plugins git clone git://github.com/visay/oh-my-zsh-typo3-flow-plugin.git flow
Afterwards, add the flow
plugin to your oh-my-zsh config list.
Here, the features of the TYPO3 Flow helper are explained:
The Flow plugin makes the flow
command available inside every subdirectory of the TYPO3 Flow
distribution. Thus, you can use flow
instead of ./flow
, and you do not have to be in
the base directory of your distribution for it. Example:
cd <YourFlowDistribution> ./flow help # this is the command you know already ;-) flow help # shortcut to the one above, saves you two keystrokes -- yeah! cd Packages/Framework/TYPO3.Flow flow help # now, that's actually quite cool, as the system will find the correct # flow CLI executable by traversing the parent directories
NOTE: The "flow3" command is not supported anymore.
You can use tab completion on the flow subcommands, and the system will intelligently auto- complete it. When autocompleting a fully written command, the full command reference is displayed:
flow <TAB> # list all currently installed commands with a short description flow k<TAB> # autocompletes to "kickstart:" flow kickstart:<TAB> # show all commands starting with "kickstart:" flow kickstart:a<TAB> # autocompletes to "kickstart:actioncontroller" flow kickstart:actioncontroller <TAB> # show the full help for kickstart:actioncontroller from TYPO3 Flow
In order to save a few keystrokes when typing phpunit -c ..../Build/BuildEssentials/PhpUnit/UnitTests.xml path/to/MyTest.php
,
there are two commands available: ffunctionaltest
and funittest
.
They, as well, can be called inside every subfolder of the TYPO3 Flow distribution:
cd <YourFlowDistribution> funittest Packages/Framework/TYPO3.Flow/Tests/Unit # Runs all unit tests; lot of typing necessary cd Packages/Framework/TYPO3.Flow/ funittest Tests/Unit # runs all unit tests, but with a lot less typing ;-) ffunctionaltest Tests/Functional # runs the functional tests
Often, I find myself working for longer timespans in a particular Flow distribution, jumping between the different packages of the distribution very often. In order to save some keystrokes, I found the "cdpath" variable in ZSH, which can be defined like:
cdpath=(/..../FlowBase/Packages/Framework /..../FlowBase/Packages/Application)
Then, you can directly cd
into any subdirectory of the directories in cdpath
.
This enables you to directly jump to all packages inside the distribution:
cd TYPO3.Flow cd SandstormMedia.Plumber
In order to work with multiple distributions more easily, you should set the flow_distribution_paths
variable inside your .zshrc to the base directories of all distributions:
flow_distribution_paths=(/Volumes/data/htdocs/FlowBase /Volumes/data/htdocs/FlowTypo3Org /Volumes/data/htdocs/PackageRepositoryDistribution /Volumes/data/htdocs/SandstormMediaFlowDistribution)
Then, you can use the f-set-distribution
command to choose which distribution shall be active
right now.
The system automatically updates the cdpath
in ALL running zsh instances :-)
Often, I need to run some command in all packages. Before using composer,
this was easy using git submodule foreach
. This is why we install
f-package-foreach
which loops through all TYPO3 Flow packages; skipping
all Packages/Libraries
.
Usage:
f-package-foreach <your-command>
This command can be run from any subdirectory inside the current Flow distribution, and will always loop through all packages.
The system caches temporary files inside Data/Temporary/Development/.flow-autocompletion* in order to not invoke ./flow too often (to improve performance).
If you have suggestions on how to improve this software, pull requests etc are highly appreciated :-)
Or you can contact me directly as well, I usually hang out as skurfuerst
in irc.freenode.net #typo3-flow
.
You can choose to use the LGPL or MIT license when you use this work.