[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Using SVN for web applications made with PHP / MySQL?

From: Joe <svn_at_freedomcircle.net>
Date: 2004-12-17 05:03:56 CET

Hi Ryan,

Ryan Schmidt wrote:

> * We're used to having a web URL that is "the development version" of
> the project that we can look at. With a version control system, I'd
> check out the project, and then I'd have my own private URL for it where
> I could test the changes I'm making, but what happens when I check it
> in? How does it get to the "development version" URL?

I had the same problem even before I started using Subversion. I solved
it by using an initialization file which is read with PHP's
parse_ini_file(). The file has a variable for the URL, e.g., baseURL,
which is made global by a common script included by every PHP web
(non-class) file. The common script also has helper functions to
construct <a href> tags from the baseURL and various URL path
components. The initialization file was added to the trunk (production),
and branched to a development branch and modified there with a different
baseURL, but that particular change will not be merged back into the trunk.

> * The application has a database behind it. How do I track changes to
> that? If I need to make a change to the database that's incompatible
> with existing code (like renaming a field) it would seem that I would
> need to "check out" a copy of the database (the pristine copy) and then
> a second copy that I could modify, so that later a diff could be done
> between them.

I haven't finished implementing this yet, but what I'm working on is to
store the schema, table by table, as separate files. These can be
generated by phpMyAdmin's Export page or you can use mysqldump from the
command line. In addition, I'll store the data for some tables that have
mostly static info, using the "extended insert" format (a row of data
per text line). SVN will then be able to diff any changes in the CREATE
TABLE statements or the data lines. However, all this will be mostly for
reference, since I may make the table changes using phpMyAdmin or a
straight SQL ALTER TABLE statement against the development database,
export the new schema into my working copy, which I then can commit and
merge into the trunk, but I still have to apply those changes to the
production database.



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 17 05:06:03 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.