Skip to content

Instantly share code, notes, and snippets.

@greyaperez
Created October 17, 2013 14:26
Show Gist options
  • Save greyaperez/7025909 to your computer and use it in GitHub Desktop.
Save greyaperez/7025909 to your computer and use it in GitHub Desktop.
Zend Framework 2 - ZFTool. Auto-installs itself in ZF2 root dirs. Also provides easier usage.
function zftool (){
if [ ! -f $PWD/vendor/zendframework/zftool/zf.php ] && [ -d ./vendor/ ];
then
echo "ZFTool Not Found, I will Auto-Install ZFTool for You. Please Wait..."
sudo composer require zendframework/zftool:dev-master;
sleep 8
elif [ ! -d ./vendor/ ];
then
echo "You are not in a Zend Framework 2 Root"
return 0;
fi
if [ $# -lt 1 ];
then
echo -e "[Instructions]: \n Ensure you are in the root of your zend project. \n\n [Usage]: \n See https://github.com/zendframework/ZFTool - It's badass.";
elif [ $1 == "install" ];
then
sudo composer require zendframework/zftool:dev-master;
elif [ $1 == "module" ];
then
php vendor/zendframework/zftool/zf.php create module $2 $PWD;
else
php vendor/zendframework/zftool/zf.php "$@";
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment