SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


The old fashioned way

RECENT TUNES

  Archive for April, 2007

April 24, 2007 – 10:02am MySQL data dump

Although I love the batch process for loading data into the database within a symfony project, sometimes it can be a bit slow if the dataset is large. I find myself reinitializing the database often while I test, not because I change the schema or add new data, but because I want to reset the data back to its initial state. For this, I run the batch process once loading the data from the yaml fixtures, and then do an SQL dump that will run much, much faster from here on out.

mysqldump -e --add-drop-table -u root -p db_name > ./data/sql/latestdump.sql

To repopulate the database with this dump file:

mysql -u root -p dbname < data/sql/latestdump.sql
Posted by in  Web Development   |     |  Comments Off on MySQL data dump

April 21, 2007 – 3:59pm SVN Tips

Using SVN to manage a project’s code base is always a good idea. There are a few tasks that always seem to come up when managing an SVN repository; this post serves as a reference.

  • Moving a repository
  • Adding new project files to the repository
  • Removing all svn directories from a project

The first task is moving an SVN repository. Often times I will start a project and use the local SVN server on my laptop to server as more of a “super-undo” rather than a code-sharing version-control system. Seeing as how this local SVN repository is not accessible to the outside world, if the project grows or new developers need access to the code, I have to move it up to our development server. Here’s how:


svnadmin dump /path/to/repo > myrepo.dump
tar zcf myrepo.tgz myrepo.dump

Then, we copy the compressed repository up to our new server by whatever means we have available, perhaps through secure copy like “scp myrepo.tgz hostname:/path/to/new/repo”. At this point it’s time to login to the new host, decompress the file, and load it into SVN:


cd /path/to/new
svnadmin create myrepo
tar zxf myrepo.tgz
svnadmin load myrepo < myrepo.dump

Phew! All done.

The next common task is adding new files in a project to version control. Especially at the early stages of development, we’re adding new files to the project all the time. Rather than manually add these using the “svn add” command, we can pipe this through grep and have it add all new files for us automatically:


svn status | grep "^\?" | awk '{print $2}' | xargs svn add
svn status | grep "^\?" | sed -e 's/? *//' | sed -e 's/ /\\ /g' | xargs svn add

The second version of the command supports files with spaces. These were taken from the Ruby On Rails Wiki.

Finally, what if we want to remove all SVN directories from a project?
find . -iname '.svn' -print0 | xargs -0 rm -rf

Posted by in  Web Development   |  Comments Off on SVN Tips

April 19, 2007 – 1:29pm The Stereo Crew

Stereo Interactive & Design specializes in complete brand communication systems. We strive to create affordable web and print-based media that is elegant in both form and function; and to improve usability and functionality for users and clients.

Stereo was formed by University of Michigan graduates Brad Greenhill and Steve Gertz in 2004. As their client base grew and demand for larger projects rich in interactive applications mounted, Scott Meves joined the team as Lead Developer.

Stereo is a team of designers and programmers who specialize in complete brand communication systems. Establishing identities in both print and web, we have a reputation for delivering impressive, clean designs united with highly usable and customized web applications.

Read more on the About Us page.

Posted by in  Web Development   |  Comments Off on The Stereo Crew