[symfony-users] Re: How to announce myself as a freelance symfony developer..

2010-10-21 Thread dantleech
Thanks Joseph, have now registered as a developer on the site..

The original question remains however: how to (if it is still
possible) publish yourself on the A Week in Symfony blog.

On Oct 20, 5:35 pm, Joseph Myalla chanan...@gmail.com wrote:
 Can you visithttp://symfonians.net/



 On Wed, Oct 20, 2010 at 5:25 PM, dantleech dan.t.le...@gmail.com wrote:
  Hi

  I have in the past seen a section in the A Week in Symfony blog
  showing developers looking for work. I am a Symfony developer
  currently looking for work, how can I announce myself on the blog?

  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 Myalla J.C
 Kibaha Education Centre
 P.O Box 30054 Kibaha
 Pwani
 Tanzania
 +255787680744

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] How to announce myself as a freelance symfony developer..

2010-10-20 Thread dantleech
Hi

I have in the past seen a section in the A Week in Symfony blog
showing developers looking for work. I am a Symfony developer
currently looking for work, how can I announce myself on the blog?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Custom routing config handler broken ...

2010-07-14 Thread dantleech
managed to get this working in the end, not sure if it was by simply
adding a rule for / or if it was fixed by making the compiled config
exactly the same as the one generated by sfConfigRoutingHandler (i.e.
with serialization). In either case it works now, so I'm happy.

On Jul 14, 1:00 am, Dan Leech dan.t.le...@gmail.com wrote:
 Hi

 I am trying to implement an XML navigation map which also contains all
 the routing information for the app,
 I have created the config handler below and changed factories.yml to
 use a custom routing class which extends sfPatternRouting. Both listed
 below, also the generated route cache file.

 The routes seem to get loaded OK, but I get the error

   Empty module and/or action after parsing the URL / (/).

 Im not too sure what that signifies, can anybody spot what I am not doing 
 right?

 Cheers

 dan.

 class gwProjectRouting extends sfPatternRouting
 {
   protected function getConfigFileName()
   {
     return 
 sfContext::getInstance()-getConfigCache()-checkConfig('config/navtree.xml',
 true);
   }

 }

 class gwProjectRoutingConfigHandler extends sfConfigHandler
 {
   public function execute($configFiles)
   {
     $options = $this-getOptions();
     unset($options['cache']);

     $dom = new DOMDocument(1.0);
     $dom - load($configFiles[0]);

     $xpath = new DOMXpath($dom);
     foreach ($xpath - query('//node') as $i = $node)
     {
       if ($url = $node - getAttribute('url'))
       {
         $params = array();
         if ($node - hasAttribute('module'))
         {
           $params['module'] = $node - getAttribute('module');
         }

         if ($node - hasAttribute('action'))
         {
           $params['action'] = $node - getAttribute('action');
         }

         foreach ($xpath - query('./param') as $param)
         {
           $params[$param - getAttribute('name')] = $param -
 getAttribute('value');
         }

         $route_name = $node - hasAttribute('name') ? $node -
 getAttribute('name') : $i;

         $data[] = sprintf('$this - routes[%s] = new %s(%s,%s);',
           $route_name, 'sfRoute', $url, var_export($params, true));
         $data[] = sprintf('$this - routes[%s] - setDefaultOptions(%s);',
           $route_name, var_export($options, true));
         $data[] = sprintf('$this - routes[%s] - compile();', $route_name);
       }
     }

     $code = implode(\n, $data);

     return sprintf(?php\n.
                    // auto-generated by gwProjectRoutingConfigHandler\n.
                    // date: %s\n%s\n, date('Y/m/d H:i:s'), $code );
   }

   protected function getOptions()
   {
     $config = 
 sfFactoryConfigHandler::getConfiguration(sfContext::getInstance()-getConfiguration()-getConfigPaths('config/factories.yml'));
     return $config['routing']['param'];
   }

 }

 ?php
 // auto-generated by gwProjectRoutingConfigHandler
 // date: 2010/07/14 00:37:15
 $this - routes[default] = new sfRoute(/:module/:action,array (
 ));
 $this - routes[default] - setDefaultOptions(array (
   'load_configuration' = true,
   'suffix' = '',
   'default_module' = 'default',
   'default_action' = 'index',
   'debug' = '1',
   'logging' = '1',
   'generate_shortest_url' = true,
   'extra_parameters_as_query_string' = true,
 ));
 $this - routes[default] - compile();
 $this - routes[2] = new sfRoute(/audit,array (
   'module' = 'gwProjectAuditLog',
   'action' = 'list',
 ));
 $this - routes[2] - setDefaultOptions(array (
   'load_configuration' = true,
   'suffix' = '',
   'default_module' = 'default',
   'default_action' = 'index',
   'debug' = '1',
   'logging' = '1',
   'generate_shortest_url' = true,
   'extra_parameters_as_query_string' = true,
 ));
 $this - routes[2] - compile();
 $this - routes[3] = new sfRoute(/audit/:id,array (
   'module' = 'gwProjectAuditLog',
   'action' = 'edit',
 ));
 $this - routes[3] - setDefaultOptions(array (
   'load_configuration' = true,
   'suffix' = '',
   'default_module' = 'default',
   'default_action' = 'index',
   'debug' = '1',
   'logging' = '1',
   'generate_shortest_url' = true,
   'extra_parameters_as_query_string' = true,
 ));
 $this - routes[3] - compile();
 $this - routes[4] = new sfRoute(/profile,array (
   'module' = 'gwProjectUser',
   'action' = 'profile',
 ));
 $this - routes[4] - setDefaultOptions(array (
   'load_configuration' = true,
   'suffix' = '',
   'default_module' = 'default',
   'default_action' = 'index',
   'debug' = '1',
   'logging' = '1',
   'generate_shortest_url' = true,
   'extra_parameters_as_query_string' = true,
 ));
 $this - routes[4] - compile();
 $this - routes[5] = new sfRoute(/issues,array (
   'module' = 'gwProjectIssue',
   'action' = 'list',
 ));
 $this - routes[5] - setDefaultOptions(array (
   'load_configuration' = true,
   'suffix' = '',
   'default_module' = 'default',
   'default_action' = 'index',
   'debug' = '1',
   'logging' = '1',
   'generate_shortest_url' = true,
   'extra_parameters_as_query_string' = true,
 ));
 $this - routes[5] - compile();

[symfony-users] Debugging forms ..

2010-01-05 Thread dantleech
Hi all

What is the best way of debugging Forms with the form framework?

Im used to print_r()'ing objects, but with the nesting in sfForm
framework this is a bad idea ..

The problem I have is that I have a form that has a global error -
There is an error with your form, but none of the fields are
highlighted.

Currently I have to write a debug function that does something like
this:

  foreach ($form - getErrorSchema() - getErrors() as $error)
  {
echo $error - getMessage();
  }

It would be cool if the errors were displayed in the web-debug
toolbar, would that be possible?
-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: Debugging forms ..

2010-01-05 Thread dantleech
In this case it was because widgets in the form were not being
rendered .. but that's a different story :)

On Jan 5, 5:16 pm, Gábor Fási maerl...@gmail.com wrote:
 This usually means you forgot to echo the csrf secret field in your form.

 On Tue, Jan 5, 2010 at 17:59, dantleech dan.t.le...@gmail.com wrote:
  The problem I have is that I have a form that has a global error -
  There is an error with your form, but none of the fields are
  highlighted.
-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: functional test authentication

2009-01-30 Thread dantleech

using the following:

  public function loginOk()
  {
$this
  - post('customer/login', array('email' = 'ad...@example.com',
'password' = 'wibble', 'test' = 'emCpOverview', 'redirect_action' =
'index'));
  - isRedirected()
  - followRedirect();

return $this;
  }

I get the following :

  http://www.dantleech.com/data/functionaltestfail.png

Note the red block and the missing assertion, the login actions
redirect throws an sfStopException which prevents further code
execution

If I surround the [-post] with try and catch:

try
{
  $this - post('/customer/login', array('email' =
'ad...@example.com', 'password' = 'wibble'));
}
catch (sfStopException $e)
{
}

I am 'redirected' but everything seems very odd, and I am not logged
in for my next request:

  http://www.dantleech.com/data/functionaltestfail2.png

I am authenticated in BEFORE I send the [-get] but not during or
after.. I also have to wrap the [-get] in try and catch for further
tests to run ..

Any help much appreciated :) I have been trying to get this to work
for a while now ...


On 29 Jan, 13:51, Jérôme TEXIER jerome.tex...@gmail.com wrote:
 On symfony 1.0  1.1, redirection can be followed this way :
 $browser-
 ...
 isRedirected()-
 followRedirect()-
 ...

 Also, more info on functional tests refactoring here 
 :http://www.symfony-project.org/blog/2008/09/19/call-the-expert-a-refa...

 Jérôme

 On 28 jan, 12:58, dantleech dan.t.le...@gmail.com wrote:

  thanks Jerome

  I am doing something similar, though our project started life off with
  sf1.0 so the login page doesnt use the form framework.

  -- test browser
  class emTestBrowser extends sfTestFunctional
  {
    public function loadData()
    {
      // load fixtures..
    }
    public function loginOk()
    {
      $this - post('/customer/login', array('email' =
  'ad...@example.com', 'password' = 'wibble');
      $this - isRedirected();

      return $this;
    }

  }

   test
  $browser = new emTestBrowser(new sfBrowser());
  $browser - initialize();
  $browser - loadData();
  $browser - loginOk();

  $browser-
    get('/someModule/index')-
    isStatusCode(200)-
    isRequestParameter('module', 'someModule')-
    isRequestParameter('action', 'index')-
    isRequestParameter('mailbox_id', 1)-
    checkResponseElement('body', 'Something')-
    end();

  

  The problem is that we do not get as far as the first assertion in
  emTestBrowser::loginOk. The login code calls [-redirect] and that
  throws an sfStopException which, err, stops everything. If I remove
  the redirect from the login code then the tests proceed as expected. I
  know I must be missing something here otherwise assertions such as [-

  isRedirected] would be pretty pointless :)

  On 28 Jan, 09:34, Jérôme TEXIER jerome.tex...@gmail.com wrote:

   Did you try to use the specific sfTesterUser to check the state of the
   your user :

   with('user')-begin()-
    isAuthenticated()-
   end()

   One good point dealing with signin/signout operations on functional
   test is to write a reusable class for those kind of test, something
   like :

   class sfGuardTestFunctional extends sfTestFunctional {
     public function signinOk($user_data)
     {
       return $this-
         info(sprintf('Connexion with login : %s and password %s
   should be ok OK.', $user_data['username'], $user_data['password']))-
         get('/login')-
         click('login',array('signin'=$user_data))-

         with('form')-begin()-
           hasErrors(false)-
         end()-

         with('user')-begin()-
           isCulture('en')-
           isAuthenticated(true)-
         end()-

         with('request')-begin()-
           isParameter('module', 'sfGuardAuth')-
           isParameter('action', 'signin')-
         end()-

         isRedirected();
     }
     //could add signout, signinError methods here
   ?

   So on your fonctional test, you can use the signin test :

   $browser = new sfGuardTestFunctional(new sfBrowser()); //rather than
   $browser = new sfTestFunctional(new sfBrowser())
   $browser-signinOk(array('username'='foo','password'='bar'));

   Regards.

   Jérôme

   On 27 jan, 15:00, dantleech dan.t.le...@gmail.com wrote:

cheers alecs

though im not sure that your examples addresses my problem of
authenticating the user before function testing a page ... what I
meant by sfContext::getUser() was

?php
  $user = sfContext::getInstance() - getUser();
  $user - login($user_object);

On 27 Jan, 13:00, Lupu Alexandru-Emil gang.al...@gmail.com wrote:

 On Tue, Jan 27, 2009 at 1:17 PM, dantleech dan.t.le...@gmail.com 
 wrote:

  I am trying to write functional tests for an authenticated
  application, but every time I authenticate the user it seems that 
  the
  users state is reset every time,

   i.e. the next [- get] doesn't seem to recognize the fact that I
  have previously authenticated

[symfony-users] Re: functional test authentication

2009-01-30 Thread dantleech

this is the _test log .. as you can see the user is authenticated in
the first sfBrowser request, but the second sfBrowser request
redirects to login

// first request
  .. buch of stuff leading up to the login call
Jan 30 16:07:21 symfony [info] {customerActions} Call customerActions-
executeLogin()
Jan 30 16:07:21 symfony [info] {customerActions} Call customerActions-
executeLogin()
Jan 30 16:07:21 symfony [info] {GwSessionCustomer} User is
authenticated
Jan 30 16:07:21 symfony [info] {GwSessionCustomer} User is
authenticated
Jan 30 16:07:21 symfony [info] {gwFrontWebController} Redirect to
http://localhost/index.php/;
Jan 30 16:07:21 symfony [info] {gwFrontWebController} Redirect to
http://localhost/index.php/;
Jan 30 16:07:21 symfony [info] {sfWebResponse} Send content (98 o)
Jan 30 16:07:21 symfony [info] {sfWebResponse} Send content (98 o)

// second request
Jan 30 16:07:22 symfony [info] {sfPatternRouting} Connect sfRoute
overview_blank (/)
 .. a bunch of routing connects ..
Jan 30 16:07:22 symfony [info] {sfPatternRouting} Connect sfRoute
default (/:module/:action/*)
Jan 30 16:07:22 symfony [info] {sfPatternRouting} Match route
default (/:module/:action/*) for /emCpOutOfOfficeAutoReplies/index
with parameters array (  'module' = 'emCpOutOfOfficeAutoReplies',
'action' = 'index',)
Jan 30 16:07:22 symfony [info] {sfFilterChain} Executing filter
sfFakeRenderingFilter
Jan 30 16:07:22 symfony [info] {sfFilterChain} Executing filter
sfBasicSecurityFilter
Jan 30 16:07:22 symfony [info] {sfFilterChain} Executing filter
sfFakeRenderingFilter
Jan 30 16:07:22 symfony [info] {sfFilterChain} Executing filter
sfCommonFilter
Jan 30 16:07:22 symfony [info] {sfFilterChain} Executing filter
sfValidationExecutionFilter
Jan 30 16:07:22 symfony [info] {customerActions} Call customerActions-
executeLogin()
Jan 30 16:07:22 symfony [info] {sfPHPView} Render /home/daniel/www/
gradwell_sf/trunk/plugins/gwCorePlugin/modules/customer/templates/
loginSuccess.php
Jan 30 16:07:22 symfony [info] {sfPHPView} Decorate content with /
home/daniel/www/gradwell_sf/trunk/plugins/gwCorePlugin/modules/
customer/templates/layout.php
Jan 30 16:07:22 symfony [info] {sfPHPView} Render /home/daniel/www/
gradwell_sf/trunk/plugins/gwCorePlugin/modules/customer/templates/
layout.php
Jan 30 16:07:22 symfony [info] {main} Call default-executeHeader()
Jan 30 16:07:22 symfony [info] {sfPartialView} Render /home/daniel/
www/gradwell_sf/trunk/plugins/gwCorePlugin/modules/default/templates/
_header.php
Jan 30 16:07:22 symfony [info] {sfPartialView} Render /home/daniel/
www/gradwell_sf/trunk/plugins/gwCorePlugin/modules/default/templates/
_cpHeader.php
Jan 30 16:07:22 symfony [info] {main} Call default-executeCpFooter
()
Jan 30 16:07:22 symfony [info] {sfPartialView} Render /home/daniel/
www/gradwell_sf/trunk/plugins/gwCorePlugin/modules/default/templates/
_cpFooter.php
Jan 30 16:07:22 symfony [info] {sfWebResponse} Send content (3332 o)

Im tempted to think that its some kind of session storage issue, but
cant imagine why ..

On 30 Jan, 15:39, Jérôme TEXIER jerome.tex...@gmail.com wrote:
 Sorry, but looks hard to debug your app from here.

 Did you check your log files log/your_app_test.log ?

 On 30 jan, 14:19, dantleech dan.t.le...@gmail.com wrote:

  using the following:

    public function loginOk()
    {
      $this
        - post('customer/login', array('email' = 'ad...@example.com',
  'password' = 'wibble', 'test' = 'emCpOverview', 'redirect_action' =
  'index'));
        - isRedirected()
        - followRedirect();

      return $this;
    }

  I get the following :

   http://www.dantleech.com/data/functionaltestfail.png

  Note the red block and the missing assertion, the login actions
  redirect throws an sfStopException which prevents further code
  execution

  If I surround the [-post] with try and catch:

      try
      {
        $this - post('/customer/login', array('email' =
  'ad...@example.com', 'password' = 'wibble'));
      }
      catch (sfStopException $e)
      {
      }

  I am 'redirected' but everything seems very odd, and I am not logged
  in for my next request:

   http://www.dantleech.com/data/functionaltestfail2.png

  I am authenticated in BEFORE I send the [-get] but not during or
  after.. I also have to wrap the [-get] in try and catch for further
  tests to run ..

  Any help much appreciated :) I have been trying to get this to work
  for a while now ...

  On 29 Jan, 13:51, Jérôme TEXIER jerome.tex...@gmail.com wrote:

   On symfony 1.0  1.1, redirection can be followed this way :
   $browser-
   ...
   isRedirected()-
   followRedirect()-
   ...

   Also, more info on functional tests refactoring here 
   :http://www.symfony-project.org/blog/2008/09/19/call-the-expert-a-refa...

   Jérôme

   On 28 jan, 12:58, dantleech dan.t.le...@gmail.com wrote:

thanks Jerome

I am doing something similar, though our project started life off with
sf1.0 so the login page doesnt use the form framework

[symfony-users] Re: functional test authentication

2009-01-28 Thread dantleech

thanks Jerome

I am doing something similar, though our project started life off with
sf1.0 so the login page doesnt use the form framework.

-- test browser
class emTestBrowser extends sfTestFunctional
{
  public function loadData()
  {
// load fixtures..
  }
  public function loginOk()
  {
$this - post('/customer/login', array('email' =
'ad...@example.com', 'password' = 'wibble');
$this - isRedirected();

return $this;
  }
}

 test
$browser = new emTestBrowser(new sfBrowser());
$browser - initialize();
$browser - loadData();
$browser - loginOk();

$browser-
  get('/someModule/index')-
  isStatusCode(200)-
  isRequestParameter('module', 'someModule')-
  isRequestParameter('action', 'index')-
  isRequestParameter('mailbox_id', 1)-
  checkResponseElement('body', 'Something')-
  end();



The problem is that we do not get as far as the first assertion in
emTestBrowser::loginOk. The login code calls [-redirect] and that
throws an sfStopException which, err, stops everything. If I remove
the redirect from the login code then the tests proceed as expected. I
know I must be missing something here otherwise assertions such as [-
isRedirected] would be pretty pointless :)

On 28 Jan, 09:34, Jérôme TEXIER jerome.tex...@gmail.com wrote:
 Did you try to use the specific sfTesterUser to check the state of the
 your user :

 with('user')-begin()-
  isAuthenticated()-
 end()

 One good point dealing with signin/signout operations on functional
 test is to write a reusable class for those kind of test, something
 like :

 class sfGuardTestFunctional extends sfTestFunctional {
   public function signinOk($user_data)
   {
     return $this-
       info(sprintf('Connexion with login : %s and password %s
 should be ok OK.', $user_data['username'], $user_data['password']))-
       get('/login')-
       click('login',array('signin'=$user_data))-

       with('form')-begin()-
         hasErrors(false)-
       end()-

       with('user')-begin()-
         isCulture('en')-
         isAuthenticated(true)-
       end()-

       with('request')-begin()-
         isParameter('module', 'sfGuardAuth')-
         isParameter('action', 'signin')-
       end()-

       isRedirected();
   }
   //could add signout, signinError methods here
 ?

 So on your fonctional test, you can use the signin test :

 $browser = new sfGuardTestFunctional(new sfBrowser()); //rather than
 $browser = new sfTestFunctional(new sfBrowser())
 $browser-signinOk(array('username'='foo','password'='bar'));

 Regards.

 Jérôme

 On 27 jan, 15:00, dantleech dan.t.le...@gmail.com wrote:

  cheers alecs

  though im not sure that your examples addresses my problem of
  authenticating the user before function testing a page ... what I
  meant by sfContext::getUser() was

  ?php
    $user = sfContext::getInstance() - getUser();
    $user - login($user_object);

  On 27 Jan, 13:00, Lupu Alexandru-Emil gang.al...@gmail.com wrote:

   On Tue, Jan 27, 2009 at 1:17 PM, dantleech dan.t.le...@gmail.com wrote:

I am trying to write functional tests for an authenticated
application, but every time I authenticate the user it seems that the
users state is reset every time,

 i.e. the next [- get] doesn't seem to recognize the fact that I
have previously authenticated the user and when running the test I
receive the login HTML rather than the page I want to test

I have tried both authenticating the user using sfContext::getUser()
and logging in manually by using:

$sf_test_functional - post('/user_plugin_module/login', array('email'
= 'b...@blah.com', 'password' = 'blah');

and the dev log seems to suggest that the user was indeed logged in,
but the subsequent request redirects to the login page anyway ..

cheers

dan

   Hi!
   before you call sfContext::getUser() each time, you could try
   ?php

   $my_test_user = sfContext::getUser();
   $my_test_user-getFOO();
   
   ?
   Also you might wanna try :
   ?php
   $context = sfContext::getInstance();
   $my_test_user = $context-getUser();
   $my_test_user-getFOO();
   
   ?

   Alecs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] fixtures - foreign keys from different conections

2009-01-23 Thread dantleech

hi all

we have a data set that spans a few databases, and so our fixtures
need to reference records from different connections .. I can't see a
way of doing this with symfony at the moment?

the only thing i can think of doing is patching something to allow
inline PHP in fixtures as with the config files:

  e.g. customer_id: %get_cusotmer_id_from_email('d...@example.com')%

is it possible for me to achieve my goal without hacking the core? :)

cheers

dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---