Thursday, January 13, 2011

You need to enable either the SQLite or PDO_SQLite extension for the profiler to run properly.

After installation of Symfony2 sandbox, I wanted to view new debug profiler. But I have got the error:

You need to enable either the SQLite or PDO_SQLite extension for the profiler to run properly.

It means your apache server doesn't have enabled sqlite extension.

On linux just install it through:

apt-get install php5-sqlite

and restart apache.

Saturday, January 8, 2011

Generating URL from Model or Task

I needed to send emails from a task.


I have tried to load certain helpers but it did not work properly. In my output url was still "/symfony/symfony/".


To make it work I had to define context:
sfContext::createInstance($this->configuration); 
And then I have created a helper in my lib/helper directory (myUrlHelper.class.php), that defines my needs: 
 
class myUrlHelper
{
  public static function url_for($lang, $request, $token)
  {
    $url = 
            sfConfig::get('app_web_address','http://www.give-me-back.com') .
            $lang . '/'.
            $request . '/'.
            $token
            ;

    return $url;
  }
}
 


Then you can call your new url helper like this:
 
myUrlHelper::url_for($reminder->getUser()->getCulture(), 'url_link_request', $item->getToken));