A skeleton for new symfony1 projects.
The following are my recommended instructions for creating a new project based on this skeleton.
Clone symfony1-skeleton repo locally (do not fork for new projects)
git clone git@github.com:kbond/symfony1-skeleton.git [project-name]
Delete .git folder
rm -rf .git
Clear out README.md
Open config/properties.ini - set your project information
Open build.xml and update <project name=""...
Initialize new git repository
git init
Add all files
git add .
Initial commit
git commit -m "initial commit"
Add remote
git remote add origin [remote]
Push to remote
git push origin master
The path to the symfony library is specified in config/include.php. By default,
this file is ignored so that you may have different symfony libraries on different
machines.
For example, if you develop on 2 different machines (linux and windows), you would
have a different symfony library location for both. On your staging/production server
you would embed the library. config/config.php.dist has some examples.
Bundled are two ant targets for updating that file: symfony.lib.embed and
symfony.lib.shared.
The idea of having this additional include file is something I struggle with. This functionality can be easily removed. Feedback appreciated.
The file web/version.php can be included at the bottom of your index file.
The script displays useful information about the project:
config/properties.ini)./VERSION)./BUILD_NUMBER) - generated by your CI server (ant build)Example index.php for staging server:
``` php <?php require_once(dirname(FILE).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'staging', false); sfContext::createInstance($configuration)->dispatch();
require_once 'info.php'; ```
This skeleton comes with an Apache Ant build.xml file that includes some
useful targets. Make sure you have Apache Ant installed or use an IDE like
Netbeans. Additional comments are in the build.xml file.
symfony.dir: creates directories in your project required by symfonysymfony.lib.embed: checks out the symfony library to lib/vendor/symfonysymfony.lib.shared: adds a shared symfony library to config/include.phpsymfony.clearcache: calls symfony ccsymfony.permissions: calls symfony project:permissionssymfony.plugins: installation of 3rd party pluginsproject.config: any configuration to be run on CI server (ie. load fixtures)project.test: runs your project's test suiteThere are some additional targets that are intended for you CI server.
The included Apache Ant build script integrates nicely into Hudson. There are predefined build and release targets.
build: cleans up the workspace, runs your test suite and outputs the
current build number to ./BUILD_NUMBER.
release: Utilizes the Hudson Release Plugin to git tag a release.
mastermasterbuildlatest-stableoriginStep 4 requires Release Plugin
Step 5 creates a *latest-stable branch in your git repository*
© Copyright 2011 Kevin Bond. Powered by Symfony2 and Github. Hosted with ServerGrove