EllisLab text mark
Advanced Search
1 of 2
1
   
CodeIgniter Community Voice - HOWTO: Set up a CodeIgniter project in Subversion
Posted: 15 August 2008 09:02 AM   [ Ignore ]
Avatar
Joined: 2006-03-23
3194 posts

EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.  Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.  From time to time we want to highlight some of these talented people, and we’ve asked them to lend their voice to ours.  Have your voice.  I hope you enjoy what they have to say as much as I did.

This week, our Community Voice author is Bruce Alderson, known on the forums as madmaxx, who has written a wonderful guide on how he uses subversion with CodeIgniter.  Bruce is an elder web monkey and systems programmer.  He totally digs the craft of building software, making cool stuff, and causing people to laugh so hard liquids are forced from their nose.  He’s currently the Chief Monkey at Discovery Software and author of the not-at-all famous robotpony.ca.  (Go read the one about shaving your yak)

Read the full article

 Signature 

DerekAllard.com - CodeIgniter, ExpressionEngine, and the World of Web Design

 
Posted: 15 August 2008 11:41 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-03-20
21 posts

While I prefer to stick with the default CI directory structure, I do find it helps to set svn:ignore on cache/* and logs/*.php, as well as on config.php and database.php. Then I’ll add config.php.default and database.php.default to the repository, so they just have to be renamed and modified for the dev/test/prod server environment.

 
Posted: 20 August 2008 06:20 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2007-09-14
7 posts

Thanks!

But I do feel this is kind of a work around for something that could be handled by CI itself.

I would really appreciate it if:

a)
CodeIgniter’s code and the application code would be separated by CI’s design, rather than having to rely on symlinks. I mean separation at the root directory, like proposed above.

b)
the server specific configuration (database username and password, application URL, etc.) was also separated into a directory in the root. Now I have to go into a directory and change *part of* a several configuration files.

Maybe for a next version?


Maarten

 
Posted: 20 August 2008 09:42 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-13
515 posts

nice one Bruce, thanks very much

 Signature 

:wq

 
Posted: 20 August 2008 11:11 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2006-08-03
671 posts

Edited: nevermind, already mentioned

 Signature 

RapidDataMapper: My new ORM, is now released!

IgnitedRecord: Old ORM

MPTtree: A model to handle trees in a database.

YAYParser - Yet Another YAML Parser

 
Posted: 25 August 2008 11:31 PM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2007-12-29
6 posts

All I ended up doing is kept to the same structure as CI aside from creating a separate “web” folder that I set the web root too, thus preventing any access to system folder from a url.  I then just throw the whole thing in subversion with a config.default.php and database.default.php.  When there are upgrades to CI I just unpack the new version, copy everything over, make sure everything works and commit it all to subversion.  It makes the repository larger since I’m versioning the CI source instead of just an SVN:EXTERNALS link, but makes things easy to deploy.

Another thing to keep in mind is at least apache servers by default usually have a deny rule set for “.*” files.  Meaning any file that begins with a ., like “.svn” won’t be served to web clients.  So it’s completely fine to leave the .svn folders in there.  Of course I would try to access the .svn folders from a web browser to make sure, but more than likely it’s already being blocked.

 
Posted: 11 September 2008 07:39 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-28
681 posts

I’ve just been reading up on SVN, got myself a free beanstalk account to mess around with it and decided I’d give it all a whirl with the current CI application I’m developing.

However, the guide’s rather short and with the little explanation about symlinks there is, something tells me that the people who know about symlinks, will know how to setup the project as described.

I’d love to see a more hands on, better detailed explanation off everything. And a solution for Windows, if possible.

 Signature 

Bramme.net webdevelopment
If I had a nickel for every time someone told me that my idea for melting down coins to make a giant robotic parrot was a bad idea, I would have one kicka$$ giant robotic parrot.

 
Posted: 11 September 2008 01:04 PM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-13
514 posts

Tortoise SVN is the only good option for Windows.

 Signature 

Yonti - I am Currently looking for a business partner, to create the best developer hosting out there. If your interested PM me.

Fluxity Lighting - My other company.


I’m a Proud Supporter and Sponser of Tomorrows Web.

 
Posted: 12 September 2008 05:07 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Joined: 2006-08-31
21 posts

Eclipse with PHPEclipse or PHPIDE plus Subclipse is not bad too.

 
Posted: 12 September 2008 05:18 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2006-12-22
43 posts

A comment on the article: I do not like the external reference to the codeigniter repository. While usually the code will not break when updating CI sometimes this might happen. Therefore I prefer to pick the latest version, code the project and just keep that version. When there are updates/bugfixes I prefer to check the changes myself to avoid code breaking.

 
Posted: 24 September 2008 12:48 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-20
11 posts

I guess you shouldn’t track the user_guide, right?

 
Posted: 16 October 2008 06:32 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2008-09-22
7 posts

I really like the idea of tracking CI out of SVN, so I’ll incorporate that. For the application, I’ve tried a similar, yet different approach.

I wanted to separate my application code completely from the CI source tree. I also wanted to be able to use a single CI source tree for all of my applications. For the time being, everything is under a user’s home directory. Here’s what it looks like:

$HOME/public_html/index.php
$HOME/public_html/application/[ config | controllers | ... ]
$HOME/lib/CodeIgniter -> CodeIgniter_1.6.3./

In my index.php, I’ve made the following assignments

$system_folder "/home/username/lib/CodeIgniter/system";
$application_folder "application"

I suppose the big difference is that the CI tree isn’t in the public web space, my application is. The part that I like is that I can have multiple applications, either in parallel with each other, or nested in sub-directories. All point back at $home_dir.”/lib/CodeIgniter/system” which leaves me with a single CI tree to keep updated. It wouldn’t be hard to reference multiple versions either, if something unique broke or changed with a CI update.

I don’t think my method allows “one-click” SVN updates, since the CI tree and the app tree are intentionally separated (to allow for multiple apps). I’ll look for a way to have my cake and eat it too.

 
Posted: 18 October 2008 11:52 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-15
147 posts

Yeap it should be a bit more explained on some informations. I set this using TortoiseSVN. So I look at this :
http://justaddwater.dk/2007/10/23/setting-up-subversion-externals-with-tortoisesvn/
the point 3, 4 & 5 need to be more detailed.
how can I let the external svn ignore the application forlder?

 
Posted: 25 October 2008 06:18 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-23
3 posts

I am also curious about the application folder that is in the CI system folder.

I have to remove that from the system folder (put in place by the svn:externals) in order to create a symlink to the app folder.

How do I do that without a) having svn keep trying to update the system/application folder as it is updated in the CodeIgniter repository (I want to track trunk with this)

or b) potentially removing it from the CodeIgniter repo? I certainly don’t have permissions for that, but still, it seems odd.

[Edited later…]
OK, it’s a little extreme to think that I could remove the application folder from the CI repo. But when I removed the local copy of the folder (with a normal rm -rf application) and add the symlink, I get a message that the folder is locked when I try to update.

This makes more sense, but still, how to avoid?

Thanks,

 
Posted: 25 October 2008 06:34 PM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-23
3 posts
Bramme - 11 September 2008 11:39 AM

I’ve just been reading up on SVN, got myself a free beanstalk account to mess around with it and decided I’d give it all a whirl with the current CI application I’m developing.

However, the guide’s rather short and with the little explanation about symlinks there is, something tells me that the people who know about symlinks, will know how to setup the project as described.

I’d love to see a more hands on, better detailed explanation off everything. And a solution for Windows, if possible.

A solution for Windows would be to use the junction tool from SysInternals instead of a symlink.

Junction allows an NTFS file system to have unix-style links in a folder.

 
Posted: 03 November 2008 08:58 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2008-02-04
1 posts

I’d like to add a tip of mine for those deploying sites via svn.

I always rename these two files:

config.php -> config_template.php
database.php -> database_template.php

before doing my first commit, then I make duplicates of the files and remove the “_template” part and never commit the new config.php / database.php files.  the reason is because obviously from server to server your config and db settings are going to be different.  whilst you could faff with svn:ignore to do something similar, I find it is helpful to have the original base file committed as a template.

 Signature 

teh lulz

 
1 of 2
1