Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created August 5, 2011 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weaverryan/1127786 to your computer and use it in GitHub Desktop.
Save weaverryan/1127786 to your computer and use it in GitHub Desktop.
Example of a "play" script in Symfony 1.4
<?php
// web/play.php
// guarantee that we're load and proud
ini_set('display_errors', true);
error_reporting(E_ALL);
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true);
$context = sfContext::createInstance($configuration);
// down here you can do anything
// create some object
$reportingObj = new WhateverReportingClass('foo');
// grab some stuff from the db
$product = Doctrine_Core::getTable('Product')->createQuery('p')->fetchOne();
var_dump($reportingObj->reportOnSomething($product));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment