Skip to content

Instantly share code, notes, and snippets.

View ftassi's full-sized avatar

Francesco Tassi ftassi

View GitHub Profile
@ftassi
ftassi / SearchEngineInterface.class.php
Created April 5, 2011 23:59
Sorgenti del post "Integrare un motore di ricerca in un'applicazione php (symfony)"
class SearchEngineInterface
{
public function add($content);
public function remove($content);
public function find($query)
}
<?php
class GlFullTextIndexDoctrineAdapter extends GlSearchIndexAdapter
{
/**
*
* @var Doctrine_Connection
*/
protected $connection;
protected $model;
@ftassi
ftassi / gist:873338
Created March 16, 2011 21:20
symfony functional test login
//login example1
$browser = new sfTestFunctional(new sfBrowser());
$browser->
get('/yourloginrul')->
click('yourSubmitButton', array('yourLoginFormNameFormat' => array('username' => 'yourUsername', 'password' => 'yourPassword')))->
followRedirect();
//Now you are authenticated
//login example2
//More verbose for debug purpose
class sfGuardTestFunctional extends sfTestFunctional {
public function signin($username, $password) {
return $this->
info(sprintf('Signin user using username "%s" and password "%s"', $username, $password))->
get('/sfGuardAuth/signin')->
click('signin', array('signin' => array('username' => $username, 'password' => $password,)))->
with('form')->begin()->
hasErrors(0)->
@ftassi
ftassi / BaseFormDoctrine.class.php
Created December 22, 2010 17:06
BaseFormDoctrine con metodi per la configurazione di file uploads
<?php
/**
* Project form base class.
*
* @package versace
* @subpackage form
* @author Your name here
* @version SVN: $Id: sfDoctrineFormBaseTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
@ftassi
ftassi / Shop.class.php
Created December 16, 2010 08:45
hydrate custom data in doctrine object
<?php
/**
* Shop
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @subpackage model
* @author Your name here
* @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
<?php
require_once dirname(__FILE__).'/../../../../../plugins/sfSimplePagePlugin/modules/sfSimplePage/lib/BasesfSimplePageActions.class.php';
/**
* sfSimplePage actions.
*
* @package sfSimplePagePlugin
* @subpackage sfSimplePage
* @author Your name here
@ftassi
ftassi / .gitignore
Created September 21, 2010 08:39 — forked from gestadieu/sfWidgetFormChoiceAutocomplete
sfWidgetFormChoiceAutocomplete
.svn