Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
28 posts Page 1 of 3
I was wondering if there was any way of making the core couch files more independent from the template files?

Currently you've got the couch folder, and inside there, in addition to the core files that make everything work, you've got things like the database settings, the uploads folder, snippets, etc..

What I'm looking for is the ability to have all of this exist outside the main couch folder, so that I'm able to put the couch folder into its own git submodule, allowing for easier management of the site's files via git.

An example of something like this can be found here: https://github.com/LimeBlast/wordpress- ... ter/htdocs - obviously this is wordpress rather than couch, but the concept remains the same.

Thank you.
Hi,

Of the three things you mentioned, the 'snippets' and 'uploads' folder can be moved outside the couch installation folder (the config.php file has settings for both).
The location of the config.php file itself cannot (yet) be changed.

I'll definitely take a look at the link you posted. The CMS there might be Wordpress but the general principles should be the same.

Thank you for your input.
If, for example, you're able to set-up couch to look in the root directory for a config.php file first (and using it if it finds it), before looking for one in the couch folder, and then configure that first config.php file to customise the location of the snippets, uploads (and any other dynamic content), then we might be someway towards achieving what I want.

This then means that the entire couch folder can be loaded as a submodule in git, without anything inside it changing, unless it is an update to the core files.

(if you know what I mean?)
Yes, I entirely get what you mean.
I'll definitely keep this approach in mind.
Thanks again.
Hi - I was wondering if you've had any joy with my suggestion above?

I've got a feeling that tomorrow I'll be working on my first website to use Couch, so I'd, for obvious reasons, be interested in this happening.

Thank you :)
Just a quick message to let you know I've figured out a simple way of fixing this issue: http://limeblast.co.uk/2012/07/how-to-u ... -with-git/ - although official support would be nice :)
Hi Daniel,

Great hack!
I am moving your thread to the newly created 'How-tos' section as its first post :)
Thanks for this. Will try this in the next couple of days.
Let me know how you get on :)
I just tried this on my local machine, but I get the following error:

Could not connect to databaseUnknown MySQL server host 'K_DB_HOST' (2)

I've moved the original 'config.php' outside the 'couch' folder to the root and added a new 'config.php' file into the 'couch' folder with the following code:

Code: Select all
<?
$folder = dirname(dirname(__FILE__));
require $folder.'/config.php';

Any idea what the problem could be?
28 posts Page 1 of 3