Visual Arts Press Blog

The all knowing, ever present VAP knowledge base

Archive for September, 2012

Using Symfony components in regular web apps

without comments

This is useful if you want to, say, use a YAML config file in your app.

Install PEAR

sudo port install php5 +pear
sudo pear channel-discover

test PEAR

Install desired Symfony components

sudo pear install
sudo pear install


require_once 'Symfony/Component/ClassLoader/UniversalClassLoader.php';
use Symfony\Component\ClassLoader\UniversalClassLoader;
$loader = new UniversalClassLoader();

$yaml = new Symfony\Component\Yaml\Yaml;

If you get no errors, then everything should be working. Can also add the following:

$queries = $yaml->parse(file_get_contents('config/queries.yml'));

download config/queries.yml

Written by ecorriel

September 26th, 2012 at 3:31 pm

Posted in admin,web