Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • How to Plan a Website
  • Zend Framework

Posts Tagged ‘ralph shindler’

How I got Zend_Tool working on Windows

Tuesday, February 23rd, 2010

Dear Reader,

I love Zend Framework. I love it so much I wrote the very first book about Zend Framework. (Note: It’s no longer the best Zend Framework book, but still, it’s a good one) I’ve written projects using it and I now find myself teaching another class on it. One of the cool things about Zend Framework is it’s cli tool, Zend_Tool. (zf) When zf works, it’s awesome. However, when it breaks, it’s a real pain in the butt. Thanks to buddies like Ralph Schindler though (the author of the tool) when it does break, I can usually get help getting it back up and running.

The latest version of zf that comes with Zend Framework 1.10.x and better is much better than previous version and it shows that Zend (well, at least Ralph) listens when people point out problems and work to solve them.

Even though it’s made great strides, setting up zf is still not seamless. To that end, here is my list of steps needed to setup zf.

My setup

I should note before I start that I am running Windows 7. This means symlinking stuff is right out and we have to resort to physically copying files around. On top of Windows 7, I’m running XAMPP. (anyone know, is that pronounced X-AMP ot ZAMP?) this means that my PHP sits in \xampp\php. I’ve added that directory to my WIndows path so I can execute php from any cmd window. With that understanding, here’s my list.

The steps

  1. Download Zend Framework and unpack it somewhere on your harddrive where you want it to live.
  2. Make sure php.exe is in your PATH and make sure you know where php.exe is.
  3. Find the bin directory in your Zend Framework directory. In it there are 2 files, zf.bat (or zf.sh for Linux) and zf.php. Copy those to the same directory php.exe is in. (Linux users, feel free to just symlink them)
  4. Your Zend Framework directory should contain a library directory, change directory into it.
  5. from the library directory, test your zf to make sure it works, zf show should give you what you need.
  6. Type zf --setup storage-directory On Windows 7, this will create a directory named .zf in c:\Users\<Your Profile Name>
  7. Type zf --setup config-file. On WIndows 7, this will create a file .zf.ini in c:\Users<Your Profile Name>
  8. Using your favorite text editor, open c:\Users\<Your Profile Name>\.zf.ini. There should only be a single line in it that contains the include_path zf will use. Add the full path to your Zend Framework directory here. It should end in “\library\”.

Test it

That’s all there is to getting it setup. (I remember the days when it took twice as long and required cursing just to get it working) To test it out, cd to any directory other than the Zend Framework directory and type zf show version That should give you the current version of the framework you have installed.

Now you are free to start using it to create projects, etc.

Small problem

There is still a problem with defining your own providers. I tried to add my twitter provider (yes, I can use zf to tweet!) and it won’t yet recognize it. I’ve brought this to Ralph’s attention and impressed upon him the importance of being to tweet from zf. I have no doubt that a solution will be forthcoming.
UPDATE
As pointed out in the comments, this has been fixed, just not documented. This page shows how to add your own providers either manually or via a command.

You can either manually add a line to your .zf.ini

basicloader.classes.0 = "My_ClassName"

or you can use zf to update itself

zf enable config.provider class-name

So now I can tweet from zf again. :)

Until next time,
I <3 |<
=C=

[Disclaimer: I use to work at Zend and still have great friends there like the lovely Nili and the walking ray of sunshine that is Andrea. That having been said, it's been a long time since they gave me any money. So the point of this disclaimer is really just so I can mention Nili and Andrea. :) ]

Tags: andrea, cli, nili, PHP, ralph shindler, zend framework, zend_tool
Posted in PHP, Programming | 10 Comments »

 
  • Friends of mine

  • My Latest Book


    Avoiding a Goat Rodeo

  • Follow me on twitter!

  • RSS PHP Podcasts

    • Episode 7: Web Sockets Are Fast
    • Better Documentation for PHP internals – Lately in PHP podcast episode 35
    • Episode 31: Feline Tooth Extraction
    • Episode #2 – Adam Culp
    • Episode 6: PSR-X and the Mexican Standoff
    • Episode 109: Typescript and a bit more…
    • A Better PHP Feature Voting Process – Lately in PHP podcast episode 34
    • Episode 30: It’s Episode 30, you guys
    • PHP Innovation Award Winner of 2012 – Lately in PHP podcast episode 33
    • Episode 29: Snappy Answers to Stupid Questions

  • Me, elsewhere on the Web

    • Best web design company
    • Cal Evans Dot Com
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • Book Review
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me, elsewhere on the Web
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).