Part of the EllisLab Network
   
1 of 2
1
CodeIgniter Community Voice - HOWTO: Set up a CodeIgniter project in Subversion
Posted: 15 August 2008 06:02 AM   [ Ignore ]  
Administrator
Avatar
RankRankRankRankRankRank
Total Posts:  7335
Joined  03-23-2006

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
BambooInvoice - Open Source, CodeIgniter powered invoicing.

Profile
MSG
 
 
Posted: 15 August 2008 08:41 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  03-20-2006

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.

Profile
 
 
Posted: 20 August 2008 03:20 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  7
Joined  09-14-2007

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

Profile
 
 
Posted: 20 August 2008 06:42 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  525
Joined  03-13-2008

nice one Bruce, thanks very much

 Signature 

:wq

Profile
 
 
Posted: 20 August 2008 08:11 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  740
Joined  08-03-2006

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

Profile
 
 
Posted: 25 August 2008 08:31 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Avatar
Total Posts:  7
Joined  12-29-2007

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.

Profile
 
 
Posted: 11 September 2008 04:39 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  640
Joined  05-28-2008

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.

Profile
 
 
Posted: 11 September 2008 10:04 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  754
Joined  01-13-2008

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.

Profile
 
 
Posted: 12 September 2008 02:07 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Rank
Total Posts:  40
Joined  08-31-2006

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

Profile
 
 
Posted: 12 September 2008 02:18 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  207
Joined  12-22-2006

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.

Profile
 
 
Posted: 24 September 2008 09:48 AM   [ Ignore ]   [ # 10 ]  
Summer Student
Avatar
Total Posts:  11
Joined  09-20-2008

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

Profile
 
 
Posted: 16 October 2008 03:32 PM   [ Ignore ]   [ # 11 ]  
Summer Student
Total Posts:  7
Joined  09-22-2008

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.

Profile
 
 
Posted: 18 October 2008 08:52 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  54
Joined  10-15-2008

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?

Profile
 
 
Posted: 25 October 2008 03:18 PM   [ Ignore ]   [ # 13 ]  
Summer Student
Avatar
Total Posts:  3
Joined  10-23-2008

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,

Profile
 
 
Posted: 25 October 2008 03:34 PM   [ Ignore ]   [ # 14 ]  
Summer Student
Avatar
Total Posts:  3
Joined  10-23-2008
Bramme - 11 September 2008 04: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.

Profile
 
 
Posted: 03 November 2008 05:58 AM   [ Ignore ]   [ # 15 ]  
Summer Student
Avatar
Total Posts:  3
Joined  02-04-2008

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

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 721, on January 06, 2010 09:38 AM
Total Registered Members: 119317 Total Logged-in Users: 37
Total Topics: 125606 Total Anonymous Users: 0
Total Replies: 661149 Total Guests: 368
Total Posts: 786755    
Members ( View Memberlist )