Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Community Voice - HOWTO: Set up a CodeIgniter project in Subversion
#21

[eluser]brianw1975[/eluser]
I only scratch my head and wonder why when I look at other setups posted...

here is my setup, it's simple, easy to maintain, a tiny bit more secure and... just plain easy...

/usr/share/php/mylib/CI/system <~ CI system folder (owned by root)

/var/www/mysite/application/ <~ CI application set above public level for security
/var/www/mysite/public_html/ <~ set this as DocumentRoot in Apache vhost.conf file
(css,js,images,themes,etc)
index.php
.htaccess

edit index.php thusly...

Code:
$system_folder = "/usr/share/php/mylib/CI/system";
$application_folder = "../application";

no symlinks and no *nix magic required....

you can set CI to update through SVN or copy/replace of the system folder, you can host multiple CI websites from one CI system folder, etc and not turn your site directory into one big CF looking mess.

If for some reason you have to leave the CI system at a lower version simply copy the old version to /usr/share/php/mylib/CI1x/ and edit the index.php file, which would allow you to host multiple versions of multiple CI apps relatively easily, or name the newest version to that version, etc.

I edited my application/config/config.php file so that I can change one variable and the entire thing is configured for production or testing - though the file is a bit bigger than original.

Finally this allows me to ensure that no one else can modify the CI system without my knowledge and it also prevents me and others from editing the Core files during development.
#22

[eluser]madmaxx[/eluser]
[quote author="brianw1975" date="1253242930"]

...

no symlinks and no *nix magic required....

...
[/quote]


We use symlinks (and svn:externals) on our production servers for a few reasons, namely that the various linking methods can:

* refer to other mounts (performance)
* refer to other physical hardware, like NAS (performance, scalability)
* include other web roots or projects (integration)
* pull in other subversion repos (orthogonality between libraries, and multiple libraries)
* allow rebuilding a complex web app (with any mix of the above) quickly

Most of our web services include several libraries like CI spliced into one web root, which all need to be kept up to date, and separate where possible.

It doesn't make sense for Windows web developers, or smaller scale projects, but it's something that makes scaling to millions of users (dozens of machines) and other larger capacity problems simpler.

I agree that the application folder + mods to index.php make the most sense. Our setups have it scripted, but any method works.
#23

[eluser]tunesmith[/eluser]
I'm trying out something similar/different

project/ --&gt; svn top-level dir
/app --&gt; physically copied from ci/system/application; checked in
/lib --&gt; to hold multiple libraries
/ci --&gt; svn:external of CI svn repository at tags/1.7.2
/web --&gt; DocumentRoot points here; contains index.php

Whenever I want, I can propedit and change the svn:external to 1.7.3 or whatever, this protects me from bleeding edge problems.

Copying app gets around application sync problems. lib/ci/system/application continues to exist and gets ignored. If future ci updates actually change around the application folder structure, I'll diff and review it then. web merely contains index.php, and whatever else I eventually add in.

This seems to be the simplest way to structure it to me. Easy to type, too.
#24

[eluser]megabyte[/eluser]
I am setting up svn to work on an existing project. I've never used svn before and have no desire to make mistakes.

I realize that the config folder is an example of files that would be different on my dev server and the live server.

Tortoise allows you to ignore files/ folders from what I have read, but no idea how to do this.

So my question, is how do I set up ignore rules, where do I put them so that my config folder never gets checked out.

I beleive checkout is the right word to use.

Thanks.
#25

[eluser]n0xie[/eluser]
[quote author="megabyte" date="1265867593"]
So my question, is how do I set up ignore rules, where do I put them so that my config folder never gets checked out.
[/quote]
We do it like this. Rename the config.php and database.php to config.default.php and database.default.php. Then commit those. Now whenever someone checks out a project, you have no danger of overwriting their config.php or database.php. This way you can safely do an export to a live machine without having to fear that you overwrite any local settings.

You can do the same for the index.php so you have error messages turned ON when developing, and turned OFF on your live server.
#26

[eluser]megabyte[/eluser]
if you rename the config.php and the database.php file though, how will your local know what to use? won't it be looking for config.php and database.php still?

I'm sure I'm missing a step or understanding a small part.
#27

[eluser]haydenk[/eluser]
I honestly never could wrap my head around how this article was saying to set everything up and use Subversion.

It wasn't until I read a Wordpress article about doing a Clean Subversion Install that it finally clicked. Here's basically what I came up with.

Code:
domain.tld/
  ci/ <--- "svn co http://svn.ellislab.com/CodeIgniter/trunk ."
  httpdocs/
    .htaccess
    index.php -> domain.tld/ci/index.php
    /system -> domain.tld/ci/system
    /application
      /assets
        style.css
        /images
        /js
      /controller
      /model
      /view

I should mention, I made absolutely NO MODIFICATIONS to the index.php file.

My own article on the subject
#28

[eluser]Jayden[/eluser]
[quote author="Derek Allard" date="1218819733"]the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.[/quote]
You are absolutely right! Even though I'm new here but I have had help from the many posts on CodeIgniter.
#29

[eluser]Tudip Technologies[/eluser]
Here is a small blog entry on this:
<a href='http://tudip.blogspot.in/2012/04/ci-with-svn.html'>http://tudip.blogspot.in/2012/04/ci-with-svn.html</a>




Theme © iAndrew 2016 - Forum software by © MyBB