Do something like “svn export” with git

Zend framework recently moved to git and I'm starting to integrate it into our release scripts.
The previous command used svn export and the tag for the release I wanted.
It took a little while to figure out how to do this with git:

git clone --depth 1 --branch release-1.12.3 /where/do/you/want/it/zf1/1.12.3/
rm -f -r /var/www/vhosts/ZendFramework/1.12.3/.git

A few differences from svn:

  • git has the complete revision history in every checkout. By adding the –depth 1, we're only getting the history relevant to our selected 'branch' and greatly speeding up the checkout of this giant project.
  • git doesn't do tags like svn/cvs. A tag isn't a branch, its a human friendly name for a revision hash. The command is –branch but it doesn't have to be a branch. It can also be a tag or commit hash. You'll get a warning about head being disconnected, its not relevant in my case because I'm not making change to or managing this folder with .git after I get it checked out.
  • git doesn't have an 'export' method because it doesn't need it. All the git revisions are in the .git folder in the root of the project instead of spread all over kingdom come like cvs and svn. Just delete the .git folder and now the project is no longer under git revision control. ( Modern versions of svn have a single folder, just like git. Thanks Alan. )

This helped a lot and has other possible solutions.

Hey, All your SimpleXML powered sites belong to us.

The latest update to Zend Framework fixes a major issue with with XML-RPC client and server classes.

The problem actually lies in the php class it relies on, SimpleXML, which as the ability to load arbitrary external files (entities).

A new method was added to PHP 5.2.11 to address this issue called “libxml_disable_entity_loader”.

And the first attacks in the wild are targeting all version of magento.
The magento team has released an emergency patch for this issue for all version of magento from 4.2.0 and up.

Check your code. If your using SimpleXML to parse XML which comes from external sources, your vulnerable and if your using an out-of-date verson of php, there’s not much you can do about it.

FirePHP and Zend Framework

Zend has a great tool for debugging ajax code. It allows error messages to be displayed directly in firebug via an additional plug-in called FirePHP.

First, visit the mozilla plug-in site and install FireBug and FirePHP.

Then add this to your zend framework projects bootstrap file.


// Place this in your bootstrap file before dispatching your front controller
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);


// Use this in your model, view and controller files
$logger = Zend_Registry::get(‘logger’);
$logger->log(‘This is a log message!’, Zend_Log::INFO);


This plug-in saved my bacon on a recent project which has a ton of ajax parts.
There is also an adapter for zend_db_profiler which will log all queries to firebug which is also very useful.

More details here. Thanks Chris for all your hard work.