I've put together a small set of defaults to kickstart the development of a new Craft CMS project.
- Ready to version control: files that need not to be in GIT are excluded
- Database config is extracted to the
web/env.phpfile - The
index.phpis also modified to require the environment file - Schematic plugin is a very useful plugin to import / export your Craft field / section settings to a YAML file and add it to GIT. Saves tons of time and reduces the possibilities of bugs. The package name is added to the
composer.jsonfile, just typecomposer install.
/staticfolder contains a Gulp setup that compiles SASS + JS to a minified version. It helps the kickstart of a new project's frontend side, but it's undrelated to Craft. Feel free to delete it./tempfolder is just my convention to store client assets there, they ignored by GIT/webis where you should copy the Craft installation
Download the Craft CMS package from https://craftcms.com/ and copy everything from the zip to the web directory.
Delete Craft's public/index.php and use the _index.php instead.
OR
alternatively simply copy and paste this to the beginning of the index.php file:
if ( file_exists("../env.php") )
{
require_once '../env.php';
}
else
{
exit('<h1>Fatal error: no database environment file found!</h1><p>Please check the readme.md for instructions.<p>');
}
Rename web/craft/config/_db.php to db.php. Modify it to your taste.
Rename web/_env.php to env.php and set the correct credentials.
Follow me on Twitter: @tiborsaas