[symfony-users] Re: Problem with doctrine:build-schema

2010-11-21 Thread jake barnes


On Nov 16, 6:45 am, Pratik Mazumder pmazumder2...@gmail.com wrote:
 No Alex, I don't have tabs. These are white spaces only !!!


Do you have the correct number of spaces? Have you checked your
indenting?






 On Tue, Nov 16, 2010 at 5:11 PM, Dominik Tuleweit symf...@tuleweit.comwrote:







  You have tabs for idention, take whitespaces instead:

  all:
    doctrine:
      class: sfDoctrineDatabase
      param:
        dsn: 'mysql:host=localhost;dbname=CHCISDB'
        username: root
        password: null

  Am 16.11.2010 um 12:37 schrieb Pratik Mazumder:

  Hi Alexander

  Changed the indentions but still doesn't work :(

  Pratik

  On Tue, Nov 16, 2010 at 4:57 PM, Alexandre Salomé 
  alexandre.sal...@gmail.com wrote:

  It's about indentation :

  all:
     doctrine:
       class: sfDoctrineDatabase
       param:
         dsn: 'mysql:host=localhost;dbname=CHCISDB'
         username: root
         password: null

  2010/11/16 Pratik pmazumder2...@gmail.com

   Hi

  I am new to symfony. I have a database created in mysql. While trying
  to build the schema.yml by running php symfony doctrine:build-schema I
  get the following error:

  doctrine generating yaml schema from database

   Missing class name.

  The content of the databases.yml is:

  all:
     doctrine:
     class: sfDoctrineDatabase
     param:
       dsn: 'mysql:host=localhost;dbname=CHCISDB'
       username: root
       password: null

  Can anybody please help?

  Thanks

  Pratik

  --
  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...@goog
   legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

  --
  Alexandre Salomé
 http://alexandre-salome.fr

  --
  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...@goog
   legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

  --
  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

   --
  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...@goog 
  legroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
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] does setflash() work with redirect() in Symfony 1.0?

2010-04-16 Thread jake barnes
In Symfony 1.0, I can forward to another action/page, and my setFlash
messages appear correctly. However, if I use redirect, then the
setFlash message does not appear:

  $this-setFlash('notice', 'That course is no longer
available.');
  $this-redirect('wss/courseIndex');

Can anyone tell me why?


-- 
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: Symfony for newspaper site

2010-01-11 Thread Jake Barnes
 Collecting information about important points why Symfony can be
 beneficial for newspapers web-sites (in comparison to Drupal6, where
 time for hacking is large, but end-code is not nice. I found some
 good points here already 
 -http://lacot.org/public/symfony/symfony-day-2009-symfony-vs-integrati...
 , but I guess somebody has more to say).


You can use WordPress for most newspaper sites. More and more
journalists are resorting to newspaper-oriented WordPress themes. An
example of a newspaper theme:

http://www.darrenhoyt.com/2009/05/20/a-wordpress-theme-for-writers-and-journalists/

You should prefer Symfony over WordPress only if:

1.) you will need a complex user security system with multiple levels
and bundles (groups) of permissions

or:

2.) you will have multiple types of digital content (text, images,
video, etc) which you will need to sort and organize on a large scale









On Jan 11, 12:20 pm, Bob cyberbo...@gmail.com wrote:
 Hi all,

 Collecting information about important points why Symfony can be
 beneficial for newspapers web-sites (in comparison to Drupal6, where
 time for hacking is large, but end-code is not nice. I found some
 good points here already 
 -http://lacot.org/public/symfony/symfony-day-2009-symfony-vs-integrati...
 , but I guess somebody has more to say).

 Maybe somebody could give working examples of large, popular
 newspapers sites built on Symfony?

 All relative information is highly appreciated.

 Anton.
-- 
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: Migrating to Symfony from cakePHP

2009-12-31 Thread Jake Barnes


On Dec 30 2009, 11:42 pm, Mike Langford m...@tweetworks.com wrote:
 I am considering changing development teams (outsourced) and the
 proposal from the new team recommends moving to Symfony from my
 current cakePHP framework. I am not a developer myself so I am looking
 to get an idea of how much work this is and what the true value of
 such a migration would be?

 Is there a simple way to migrate to Symfony or will my new team
 essentially have to re-code the entire site?


Do not do this! This is a very bad idea! All of the major PHP
frameworks are roughly equivalent. CakePHP is roughly as good as
Symfony. You gain absolutely nothing by changing your site from Cake
to Symfony. Your new team simply wants to convert the site so that
they can use the framework they are comfortable with. I suggest that
you look for another team, once with experience with Cake.

Your new team would need to re-write the entire application/website.
You'll gain nothing. You'll face a new period of having to debug the
code. This can only be a wise move if the new team is offering
something of great value in return, or if they offer to do it for
free, perhaps to cement a long term relationship with you.

Developers will tend to recommend the technologies they are most
comfortable with. I've done it. Everyone does it. But if you already
have a working site or application, then you gain no benefit from
this.



--

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: anonymous visits getting into a module marked credentials: admin. Why?

2009-12-13 Thread Jake Barnes
Sorry. This was just wrong syntax  in the yaml file.

On Dec 13, 8:18 pm, Lawrence lkrub...@geocities.com wrote:
 I'm using Symfony 1.2.5

 On Dec 13, 7:42 pm, Lawrence lkrub...@geocities.com wrote:

  I create a new module. Then I create  a folder called config in that
  module, and in a file called security.yml I add:

  all:
    is_secure:   on
    credentials: admin

  Then I run symfony cc.

  And yet, even when I'm not logged in, I can still point my browser at
  every page in the module. Did I forget something?

--

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: Important bug fix to sfSyncContentPlugin

2009-10-08 Thread Jake Barnes


Thanks, Tom. I'm about to give this plugin a try.

On Oct 8, 2:00 pm, Tom Boutell t...@punkave.com wrote:
 I have corrected a significant bug in sfSyncContentPlugin. This bug
 caused the plugin to assume it should use the default local
 environment, not the environment specified on the command line, for
 the local end of the connection.

 If you have separate database settings for different environments
 (including the test environment), this could result in syncing the
 wrong database. So it is important to upgrade to sfSyncContentPlugin
 version 0.9.1 (or 'svn update' if you are using svn externals).

Th Version 0.9.1 also reuses the mysql-load and mysql-dump helper Symfony
 tasks locally as well as remotely, simplifying the code and removing
 opportunities for problems such as the bug described above.

 sfSyncContentPlugin is a Symfony plugin that allows content (not code)
 to be synced between different hosts and environments of a Symfony
 project. MySQL database dumps as well as data folders can be
 transferred. For more information 
 see:http://www.symfony-project.org/plugins/sfSyncContentPlugin

 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.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: sfDoctrineGuardPlugin: anything that advise against adding the profile fields in the sfGuardUser directly instead of define the model Profile?

2009-10-08 Thread Jake Barnes

I'm curious what you regard as the advantage? Avoiding certain JOINs?

On Oct 8, 9:32 am, tirengarfio tirengar...@gmail.com wrote:
 Hi,

 I have read an article (link below) about adding profiles to the users
 that are generated after building the sfDoctrineGuardPlugin models
 that are defined in its schema.yml.

 http://www.symfony-project.org/blog/2008/11/12/call-the-expert-custom...

 It says that if you want to add a profile to the users you should add
 a new model in schema.yml called for example Profile and that must
 be related to sfGuardUser model.

 My question: Is there anything that advise against adding the profile
 fields in the sfGuardUser directly instead of define the model
 Profile?

 Ciao

 Javi
--~--~-~--~~~---~--~~
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: Best way for e-mail templates

2009-10-08 Thread Jake Barnes



On Oct 8, 1:04 pm, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 Hi all,

 What is in your opinion the best way to store an e-mail template?
 In one of my actions, when an e-mail has to be sent to the user, I
 want to grab a template and replace some values.



Alexandru-Emil Lupu made a good suggestion. That is probably a clean
method.

When I am working on a very simple project, I tend to think Swift
might be overkill, so I just write a quick method in the actions. Not
very clean, but quick. An example:

$mailToName = $this-getRequestParameter('first_name'). .$this-
getRequestParameter('last_name');
$mailTo = $mailToName..$this-getRequestParameter
('email').;
$mailFrom   = xxx;
$mailBody   = $this-getPartial('registrationNotice', array
('username' = $this-getRequestParameter('username'), 'password' =
$this-getRequestParameter('password')));
$subject=  New user registration ;

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . \r\n;
$headers .= 'Content-type: text/html; charset=iso-8859-1' . \r
\n;

// Additional headers
$headers .= 'To: '.$mailTo.\r\n;
$headers .= 'From: '.$mailFrom.\r\n;

$success = mail($mailTo,
$subject,
$mailBody,
$headers);


As always, with all such decisions, it depends on the scale of the
project, how formal you need to keep the code. I wouldn't use the
above code on a project that was hoping to scale to millions of
users.



--~--~-~--~~~---~--~~
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: Best way for e-mail templates

2009-10-08 Thread Jake Barnes


This issue has come up before. I think someone suggested have a module
just for the emails. Seems like a good idea.


On Oct 8, 3:19 pm, HAUSa jeroen_heeft_behoefte_aan_r...@hotmail.com
wrote:
 Ok, thx Alex, but I prefer not to use the database for this. In my
 opinion, the DB is only ment for user generated content storage.

 Martin, your answer is not a solution to my problem. You use $body =
 the body, so my question still remains. Where do I leave the HTML e-
 mail template? I don't want to paste that whole code in the action.

 On 8 okt, 20:41, Martin Ibarra Cervantes ibarra.cervan...@gmail.com
 wrote:



  hi, i use swift

  $transport = 
  Swift_SmtpTransport::newInstance(sfConfig::get('app_correo_hostname'),sfCon 
  fig::get('app_correo_puerto'))
                          -setUsername(sfConfig::get('app_correo_usuario'))
                          -setPassword(sfConfig::get('app_correo_password')) 
  ;

                  $mailer = Swift_Mailer::newInstance($transport);        
                  $body = the body;          
                  $subject = Validacion de Cuenta, Mis Retratos.;
                  $message   = Swift_Message::newInstance($subject)
                  -setFrom(array(sfConfig::get('app_correo_usuario', 'Mis 
  Retratos')))
                  -setTo(array($this-form-getValue('correo')))        
                  -setBody($body);
                  $mailer-send($message);            
  its very single.

  On Thu, Oct 8, 2009 at 10:41 AM, Alexandru-Emil Lupu

  gang.al...@gmail.com wrote:
   What i have done was to implement swift mailer, create a component that
   handles the emails and parser, and all the email templates stored into
   database as

   Subject, Html, plain ...

   Unfortunatelly, I cannot reveal the code ...
   Alecs

   On Thu, Oct 8, 2009 at 8:04 PM, HAUSa
   jeroen_heeft_behoefte_aan_r...@hotmail.com wrote:

   Hi all,

   What is in your opinion the best way to store an e-mail template?
   In one of my actions, when an e-mail has to be sent to the user, I
   want to grab a template and replace some values.

   My idea is to create a module called emails and use the template
   folder, but maybe there is a less dirty method?

   Thanks!

   --
   As programmers create bigger  better idiot proof programs, so the 
   universe
   creates bigger  better idiots!
   I am on web:  http://www.alecslupu.ro/
   I am on twitter:http://twitter.com/alecslupu
   I am on linkedIn:http://www.linkedin.com/in/alecslupu
   Tel: (+4)0748.543.798
--~--~-~--~~~---~--~~
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: how to install a symfony website

2009-10-06 Thread Jake Barnes



On Oct 5, 2:54 am, Eno symb...@gmail.com wrote:
 On Mon, 5 Oct 2009, Sid Bachtiar wrote:
  I was trying to look something more for non-developer.

  Let's say I developed a website then when I give the source code to my
  client (who isn't computer illiterate, but is not familiar with
  Symfony); at the moment I'll have to teach them a lot of things on how
  to install/deploy, symfony commands (clear cache), how to change
  database settings, and so on.

 Frankly, what you're asking makes no sense. Deploying a web site is not
 something you can just give to someone who is not technical.


One of the big weaknesses of Symfony is that it can not be deployed as
easily as WordPress. The fact that non-technical people have an easy
time installing WordPress gives WordPress much of its presence on the
web scene.








--~--~-~--~~~---~--~~
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: how to install a symfony website

2009-10-06 Thread Jake Barnes



On Oct 5, 7:26 am, Tom Boutell t...@punkave.com wrote:
 This is true, but if you deploy with svn don't forget:

 RewriteRule (\.svn)/(.*?) - [F,L]

 In your .htaccess. You don't want people snooping in the .svn folders.


You can svn export and none of the .svn folders will be exported.









 On Oct 5, 3:06 am, Gareth McCumskey gmccums...@gmail.com wrote:



  First, in your batches directory for your symfony write a batch script (in
  PHP even if you want) that will run all the necessary symfony commands
  needed, like symfony cc etc. Then make sure its all committed to SVN. I
  have found deploying to a server easier to do with SVN rather than rsync
  which is what the official symfony docs recommend. So you can have your sys
  admin svn checkout the application, run the batch script and away you go.

  You can even have your deployment script add the correct Virtual Host
  settings into apache for you.

  This is of course assuming your running a *nix box.

  On Mon, Oct 5, 2009 at 9:02 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:

   Of course not. I'm talking about someone technical, who knows how to
   install the like of Wordpress, and other popular PHP, but not familiar
   with Symfony, nor want/need to learn development in Symfony.

   On Mon, Oct 5, 2009 at 7:54 PM, Eno symb...@gmail.com wrote:

On Mon, 5 Oct 2009, Sid Bachtiar wrote:

I was trying to look something more for non-developer.

Let's say I developed a website then when I give the source code to my
client (who isn't computer illiterate, but is not familiar with
Symfony); at the moment I'll have to teach them a lot of things on how
to install/deploy, symfony commands (clear cache), how to change
database settings, and so on.

Frankly, what you're asking makes no sense. Deploying a web site is not
something you can just give to someone who is not technical.

--

   --
   Blue Horn Ltd - System Development
  http://bluehorn.co.nz

  --
  Gareth McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc
--~--~-~--~~~---~--~~
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: sfSyncContentPlugin: sync content as easily as code

2009-09-29 Thread Jake Barnes

How is this different from

scp -r m...@mysite.com:/path/to/symfony/project/* m...@newsite.com:/path/
to/symfony/project/

Followed by symfony cc.

Does it work 2 ways?





On Sep 29, 10:19 am, Tom Boutell t...@punkave.com wrote:
 With this handy plugin, you can just type this:

 ./symfony project:sync-content frontend dev from stag...@staging

 … And down comes the content from the staging server, beginning with
 the current state of the database and optionally followed by data
 folders, such as your uploads folder, search indexes and other data
 kept in the filesystem rather than the database.

 You can also push content in the other direction. For instance, the
 day you launch the production site, you might do this to push content
 from staging up to production:

 ./symfony project:sync-content frontend staging to p...@production

 You can pick up the plugin here:

 http://www.symfony-project.org/plugins/sfSyncContentPlugin?tab=plugin...

 For more information about the plugin, check out my new blog post about it:

 http://window.punkave.com/2009/09/29/sfsynccontentplugin-moving-conte...

 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.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: Help-- Fatal Error Creating Forms with Symfony 1.2

2009-09-29 Thread Jake Barnes


Possibly not important, but I don't think you need that last comma:

 'mensaje'   = new sfWidgetFormTextarea(),

In your PHP error logs are you seeing any other errors or warnings or
notices?




On Sep 25, 6:33 pm, Guelmis glmarti...@hab.uci.cu wrote:
 Hello everyone:
            I'm trying to create my first form with symfony 1.2, I am
 following the instruction byhttp://www.librosweb.es/symfony_formularios/. So 
 I created a
 ContactoForm class that extends of sfForms like this one and I placed it at

 /var/www/myfirstproject/lib/form/ContactoForm.class.php

 class ContactoForm extends sfForm
 {
  public function configure()
  {
    $this-setWidgets(array(
      'nombre'    = new sfWidgetFormInput(),
      'email'     = new sfWidgetFormInput(),
      'mensaje'   = new sfWidgetFormTextarea(),
    ));
  }

 }

 I also created a module at frontend called contacto

 frontend/modules/contacto and this is my action.class.php

 class contactoActions extends sfActions
 {
  public function executeIndex()
  {
    $this-formulario = new ContactoForm(); //this is the line that
 launches the Fatal error
  }

 }

 and in frontend/modules/contacto/templates/indexSuccess.php

 form action=?php echo url_for('contacto/enviar') ? method=POST
  table
    ?php echo $formulario ?
    tr
      td colspan=2
        input type=submit /
      /td
    /tr
  /table
 /form

 But here is the problem, I did it exactly as I was told to but now in
 the navigator I got this error:
 *Fatal error*: Class 'ContactoForm' not found in
 */var/www/myfirstproject/apps/frontend/modules/contacto/actions/actions.cla 
 ss.php*
 on line *15* , could someone please help me
--~--~-~--~~~---~--~~
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: what plugins or code do symfony developers prefer for image cropping?

2009-09-29 Thread Jake Barnes



On Sep 29, 8:36 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 Linux box only (using netpbm, 
 fast):http://www.symfony-project.org/plugins/pkImageConverterPlugin

 Linux and Windows (using GD, 
 slower):http://www.symfony-project.org/plugins/sfThumbnailPlugin


sfThumbnail facillitates cropping? I did not know that. Somehow I read
through the docs on sfThumbnail and missed that. I use sfThumbnail to
resize my images, but I didn't realize it could crop.

I should say, I just tried the eCrop plugin and it works great. Very
simple to use, very straightforward.








 On Wed, Sep 30, 2009 at 1:26 PM, lawrence lkrub...@geocities.com wrote:

  A client has asked me to build an image gallery. I'm curious what code
  or plugins Symfony developers typically use for this (assuming there
  is any typical usage).

  Have developers here used the eCropPlugin, and do you have an opinion
  about it?

 http://www.symfony-project.org/plugins/eCropPlugin/prototype

 --
 Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~-~--~~~---~--~~
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: PHP Fatal error: Uncaught exception 'sfStopException'

2009-09-25 Thread Jake Barnes


I just did grep -R catch * on the core symfony files. These are the
catch clauses in the Symfony core:

http://lawrence.sds5.com/symfony_catch_clauses.txt

Not sure where to start to look, but I would assume that Symfony
normally catches the exceptions that it throws, and that your
situation is arising due to something specific that you've done. I
could be wrong, though


On Sep 24, 4:34 am, ollietb ollie.harri...@googlemail.com wrote:
 Hi there
 I've noticed that my PHP logs are full of thousands of PHP Fatal
 error: Uncaught exception 'sfStopException' errors whenever an action
 is forwarded or redirected. It's making it hard for me to debug
 errors. The offending code is in the sfAction class. Here is one
 example.

   public function forward($module, $action)
   {

     $this-getController()-forward($module, $action);

     throw new sfStopException();
   }

 The sfStopException is thrown but not caught. I'm thinking of using
 set_exception_handler() in the projectConfiguration class to override
 the default exception handler if an exception is not caught within a
 try/catch block. The exception handler would simply be a a function
 which die()s the current execution. Do any of you sfExperts have an
 opinion on this? Would it be better to override the forward method in
 my own Actions class?
 I'm running Symfony 1.1 on OS: Red Hat Enterprise Linux Server release
 5.3 (Tikanga) 54 and PHP Version: 5.2.10 (eAccelerator is not
 installed)
 Thanks,
 -ollie
--~--~-~--~~~---~--~~
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: PHP Fatal error: Uncaught exception 'sfStopException'

2009-09-25 Thread Jake Barnes


Why are you using forward? Why not redirect or why not simply call a
given method? Why not just set the template to whatever you want? Why
forward?


On Sep 24, 4:34 am, ollietb ollie.harri...@googlemail.com wrote:
 Hi there
 I've noticed that my PHP logs are full of thousands of PHP Fatal
 error: Uncaught exception 'sfStopException' errors whenever an action
 is forwarded or redirected. It's making it hard for me to debug
 errors. The offending code is in the sfAction class. Here is one
 example.

   public function forward($module, $action)
   {

     $this-getController()-forward($module, $action);

     throw new sfStopException();
   }

 The sfStopException is thrown but not caught. I'm thinking of using
 set_exception_handler() in the projectConfiguration class to override
 the default exception handler if an exception is not caught within a
 try/catch block. The exception handler would simply be a a function
 which die()s the current execution. Do any of you sfExperts have an
 opinion on this? Would it be better to override the forward method in
 my own Actions class?
 I'm running Symfony 1.1 on OS: Red Hat Enterprise Linux Server release
 5.3 (Tikanga) 54 and PHP Version: 5.2.10 (eAccelerator is not
 installed)
 Thanks,
 -ollie
--~--~-~--~~~---~--~~
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: sfGuardUser relations appear empty after $form-save()

2009-09-25 Thread Jake Barnes

Where is the bind() statement? Most of my code looks like this:

$this-form-bind($submittedValuesArray, $request-getFiles
('sf_guard_user_profile'));
if ($this-form-isValid())

When in doubt, put $submittedValuesArray in print_r() and see what you
really have.


On Sep 24, 6:34 am, johnnygri john.grim...@gmail.com wrote:
 Hi there, I'm replacing the processForm() method in the sfGuardUser
 Doctrine admin generator module. We have:

 if($form-isValid())
 {
             $sf_guard_user = $form-save();

             // I've added this next line, you'll see why
             $sf_guard_user-reloadGroupsAndPermissions();

             // and some veeery basic debugging:
             print_r($sf_guard_user-groups-toArray());
             exit;

 }

 When I add a new user and select one or more groups, it is
 successfully saved with the relations, viewing the DB or simply
 listing in admin generator proves this. I cannot figure out for the
 life of me however why the above outputs: Array() - it shouldn't be
 empty at this point should it, especially after I've 'forced' a reload
 of groups and permissions relations? I need access to this new user's
 selected groups so I can decide whether to raise a specific event or
 not.

 Thanks for any help in advance,
 John
--~--~-~--~~~---~--~~
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: Framework based PHP vs high level programming languages

2009-09-21 Thread Jake Barnes



On Sep 21, 3:02 pm, Tom Boutell t...@punkave.com wrote:
 A more interesting question is: if we're going to use MVC frameworks
 anyway, do we still gain anything worth having by using loosely typed,
 interpreted languages like Ruby and PHP? Assuming for a moment an
 equally good framework implementation following the same design
 philosophy in the case of each language?

 Yes, I think we do. Java is still considerably more verbose as a way
 of getting your application logic coded. But there are interesting
 Java framework-based implementations of Rails-style sites that aren't
 *too* verbose:

 http://www.theserverside.com/news/thread.tss?thread_id=32723



Yeah, I don't think Symfony/PHP offers any benefit comparied Grails/
Groovy. It is more a choice of whatever language the programmer is
comfortable with.



--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-20 Thread Jake Barnes


I think we're saying the same thing. You use the right tool for the
job. You use WordPress for a blog. You use Joomla for medium sized
business that needs to quickly give its staff some way to control the
content of a site. You use Rails or Symfony if you're building a web
app.



On Sep 19, 6:44 pm, Dennis Riedel riedel.den...@gmail.com wrote:
 I would make a difference: web application and web site. Joomla, Drupal and
 TYPO3 are great to build websites and manage static and multimedia content
 and adding some of the social necessities. This is all representational.
 All the rest that is en vogue today, (social apps) and plattforms, requiere
 a thorough basis. That is where the web application framework come in
 handy. Or you choose a component library to be more flexible.

 On Sat, Sep 19, 2009 at 11:06 PM, Jose R. Prieto 
 joser.pri...@gmail.comwrote:



   -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  Is Joomla a Framework?

  For me, it isn't

  Juampy72 escribió:

   I think it's all about coding or not. Symfony not only helps you
   developing faster but also teaches you a lot of clean, beautiful
   programming. If you do not find this learning curve enriching, then I
   suggest you better go for other framework such as Joomla where
   everything is more visual and you do not need to see much code.

   Is anybody with me?


--~--~-~--~~~---~--~~
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: an intermitent bug, different for each browser and user

2009-09-19 Thread Jake Barnes

Curiously, this line will thrown an error even when I'm authenticated:

$sf_user-getGuardUser()-getId()


The method getGuardUser() seems to return nothing. Oddly, if I wish to
go to a secure page that has been defined with this security:

all:
  is_secure:  off

memberList:
  is_secure:  on


I can go to memberList and see all the members, as if I'm logged in,
yet this still returns nothing:

$sf_user-getGuardUser()

$sf_user is an instance of myUser, which descend from
sfGuardSecurityUser and which has this method:


  public function getGuardUser()
  {
if (!$this-user  $id = $this-getAttribute('user_id', null,
'sfGuardSecurityUser'))
{
  $this-user = sfGuardUserPeer::retrieveByPk($id);

  if (!$this-user)
  {
// the user does not exist anymore in the database
$this-signOut();

throw new sfException('The user does not exist anymore in the
database.');
  }
}
return $this-user;
  }




On Sep 19, 12:14 am, Jake Barnes lkrub...@geocities.com wrote:
 The following code always works for me. I can go to the front page of
 the site, and I can log in and I never get an error.

 For one of my clients, the site works great in FireFox, but throws an
 error in Google Chrome. For another of my clients, the following code
 dies with a fatal error all the time. The error is that the method
 getId() is being called on either a non-existent object, or an
 object without that method. In other words, this line throws a fatal
 error:

 $sf_user-getGuardUser()-getId()

 This code appears in layout.php.

 Here is the code:

 ?php if(isset($sf_user)): ?

   ?php if($sf_user-isAuthenticated()): ?

     ?php $criteriaToFindProfile = new Criteria();
 $criteriaToFindProfile-add(sfGuardUserProfilePeer::USER_ID, 
 $sf_user-getGuardUser()-getId()); $thisUsersProfile =

 sfGuardUserProfilePeer::doSelectOne($criteriaToFindProfile); ?

     ?php if (@ is_object($thisUsersProfile)): $username =
 $thisUsersProfile-getFirstName(). ; $username .= $thisUsersProfile-

 getLastName(); if (!$username) $username = $thisUsersProfile-
 getsfGuardUser()-getUsername(); endif; ?

     ?php if (@ is_object($thisUsersProfile)): ?pHello, a
 id=userid href=?php echo url_for('content/profile?id='.
 $thisUsersProfile-getId()) ??php echo $username ?!/a/p?php
 endif ?
     a href=?php echo url_for(sfGuardAuth/signout) ?img src=?
 php echo image_path('logout.png') ? alt=LOGOUT //a

   ?php endif; ?

 ?php endif; ?

 Can anyone think why this would behave differently on different
 people's browsers?

 I'm having trouble fixing this bug, because I can not recreate it on
 my own machine.

 What is really bizarre is that my clients browser somehow got past
 this line:

  ?php if($sf_user-isAuthenticated()): ?

 Since the page always died for them with a fatal error, they had no
 way to log in.
--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-19 Thread Jake Barnes
 appname NombreMOdulo model. eg
       symfony propel: generate-module - with-show - non-verbose-templates
 frontend publication BlogPublicacion

 23 .- __toString functions create () for each model class
 ready, from now on, see APIs and tutorials
 ==finish installation notes
 with this notes i have a project ready to increase actions in less than five
 minutes. You can even do a .bat to automate the process :P.

 for the forms, i just read the froms book, it is a nice book.
 the definitive guide is fine, but is hard to hard all, jeje. just little
 parts

 now i'm finishing my first sf project, and it looks and works great, i have
 added new functionalities and also modified the DB, and it still working
 fine. soon i will deploy it, and then with a real experience , i will start
 the real project that i must finish until december. jaj It was a real risk!!
 to learn symfony, because now i have less time (one month less), but even
 now , with a lot of questions and few knoledge about the many and many
 features of symfony, i can produce software. and that's great!

 of course nothing is perfect,

 my feedback is:

    - the php documentation has a lot of examples(eg: for every function),
    and that is really nice and useful
    - maybe a specializated guide (like the forms book) for every
    subframework.(please one of routing, and other that enable one to make or
    generate css files  XD ok it is a work of graphics designers, but symfony
    generates lot of html code, and is hard to write a css file, for example to
    know some 'Id' i need to read the generated code first)
    - graphics, do more graphics showing the structures, configuration files
    etc. you know, reading 10%, watching 30%, and doing 60% , watching is not
    too negligible.

 So for me, symfony is a good way to start to do good software, fast, yes it
 has a lot of configuration files, but if a parameter saves me one day of
 work, i prefer to learn how the paremeter works, ask the list, read
 somethings, and then use it.

 well, it is just my personal experience, hope to help the project.
 and yes, i need to study english grammar XD. thanks

 2009/9/19 Alexandru-Emil Lupu gang.al...@gmail.com



  Well the symfony plugins part is the maintainer / creator job to keep it
  updated. But as there is no motivational thing involved (money or need to
  use it in sf 1.2 or something else that don't cross my mind atm ), i do not
  think the maintainer will do it. Instead, you might create an account on SF
  website, and become contributor to desired plugin, and create a sf1.2
  compatible version. This way, you'll know that there is a SF1.2 plugin
  available.
  Instead of 
  sfShoppingCartPluginhttp://www.symfony-project.org/plugins/sfShoppingCartPlugin,
  you might wanna check sfShop project (google it). It has a shoping cart
  plugin and is written in 1.2 (if i recall right).

  Alecs

  On Sat, Sep 19, 2009 at 11:07 AM, mini_alexander aoohra...@gmail.comwrote:

  Symfony has the best documentation which I have ever seen. Jobeet
  tutorial is very long but in this tutorial is almost everything - all
  important things.
  For me the worst thing in Symfony are plugins. Many good plugins are
  old - for example shopping cart:
 http://www.symfony-project.org/plugins/sfShoppingCartPlugin
  This shopping cart is for symfony 1.0 and we now have symfony 1.2 and
  soon 1.3. And there is many that plugins. I would like to see plugins
  in compatybile version with the newest version of symfony.

  On 19 Wrz, 07:10, Lukas Kahwe Smith m...@pooteeweet.org wrote:
   On 19.09.2009, at 06:36, Jake Barnes lkrub...@geocities.com wrote:

On Sep 18, 3:36 pm, Lukas Kahwe Smith m...@pooteeweet.org wrote:
On 18.09.2009, at 21:27, bghost wrote:

I think that the attempt of putting the entire WEB form within the
class
only unnecessarily complicate such a simple thing such is form
handling.
That's just forcing WEB developers to learn how to make simple
things
on the complicated way.

i think this is a valid criticism. there is a clear shift away from
having just some html/css/js guru do the templates back in symfony
1.0
towards requiring a symfony expert to also handle the templates, but
that person lacks the html/css/js guru knowhow. the pay off is
however
that a symfony expert can now do a lot more if he just sits down with
the html/css/js guru to create the required widgets in pair
programming. the quality of the site should also increase since reuse
is done more on the widget side of things but more importantly you
start to bring everything data related together in the models, so you
have a single definitive source.

so what does it all mean? teach your symfony experts some more html/
css/js, teach your html/css/js guru some symfony .. or better yet ..
facilitate paired programming .. and you should be off producing high
quality more

[symfony-users] Re: an intermitent bug, different for each browser and user

2009-09-19 Thread Jake Barnes


Hacking around so much I forget what I've done so far.

So now the problem is that I can not log out.

Okay, so if I edit the file sfGuardUserSecurity.class.php and add in
this echo and die statement:

  public function signOut()
  {
$this-getAttributeHolder()-removeNamespace
('sfGuardSecurityUser');
$this-user = null;
$this-clearCredentials();
$this-setAuthenticated(false);
echo  is authenticated: ;
echo $this-isAuthenticated();
die();

$expiration_age = sfConfig::get
('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);
$remember_cookie = sfConfig::get
('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');
sfContext::getInstance()-getResponse()-setCookie
($remember_cookie, '', time() - $expiration_age);
  }

Then I point my browser at sfGuardAuth/signout. I get a blank white
screen, except for the words  is authenticated . So I know the
method is being called, and I know that, at that point, I am not
authenticated. But if I take out those 3 lines and go to the front
page of the site, I see the results of this code, which I've put in
layout.php:

?php echo  user is authenticated:  . $sf_user-isAuthenticated() ?

which always results in:

user is authenticated: 1

So I get un-authenticated, but then something authenticates me again
before the page renders.

And yes, before anyone suggests it, I'm running symfony cc after
almost every change that I make.








On Sep 19, 12:14 am, Jake Barnes lkrub...@geocities.com wrote:
 The following code always works for me. I can go to the front page of
 the site, and I can log in and I never get an error.

 For one of my clients, the site works great in FireFox, but throws an
 error in Google Chrome. For another of my clients, the following code
 dies with a fatal error all the time. The error is that the method
 getId() is being called on either a non-existent object, or an
 object without that method. In other words, this line throws a fatal
 error:

 $sf_user-getGuardUser()-getId()

 This code appears in layout.php.

 Here is the code:

 ?php if(isset($sf_user)): ?

   ?php if($sf_user-isAuthenticated()): ?

 ?php $criteriaToFindProfile = new Criteria();
 $criteriaToFindProfile-add(sfGuardUserProfilePeer::USER_ID, 
 $sf_user-getGuardUser()-getId()); $thisUsersProfile =

 sfGuardUserProfilePeer::doSelectOne($criteriaToFindProfile); ?

 ?php if (@ is_object($thisUsersProfile)): $username =
 $thisUsersProfile-getFirstName(). ; $username .= $thisUsersProfile-

 getLastName(); if (!$username) $username = $thisUsersProfile-
 getsfGuardUser()-getUsername(); endif; ?

 ?php if (@ is_object($thisUsersProfile)): ?pHello, a
 id=userid href=?php echo url_for('content/profile?id='.
 $thisUsersProfile-getId()) ??php echo $username ?!/a/p?php
 endif ?
 a href=?php echo url_for(sfGuardAuth/signout) ?img src=?
 php echo image_path('logout.png') ? alt=LOGOUT //a

   ?php endif; ?

 ?php endif; ?

 Can anyone think why this would behave differently on different
 people's browsers?

 I'm having trouble fixing this bug, because I can not recreate it on
 my own machine.

 What is really bizarre is that my clients browser somehow got past
 this line:

  ?php if($sf_user-isAuthenticated()): ?

 Since the page always died for them with a fatal error, they had no
 way to log in.
--~--~-~--~~~---~--~~
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: an intermitent bug, different for each browser and user

2009-09-19 Thread Jake Barnes


Hmm, not sure what I just did, but now things work. I think the simple
remember me filter described here was playing havoc with my site:

http://www.symfony-project.org/book/1_2/06-Inside-the-Controller-Layer

I implemented it just as it is described on that page. Seem like the
most likely culprit for all of the trouble I had.

I removed the filter.


On Sep 19, 3:55 am, Jake Barnes lkrub...@geocities.com wrote:
 Curiously, this line will thrown an error even when I'm authenticated:

 $sf_user-getGuardUser()-getId()

 The method getGuardUser() seems to return nothing. Oddly, if I wish to
 go to a secure page that has been defined with this security:

 all:
   is_secure:  off

 memberList:
   is_secure:  on

 I can go to memberList and see all the members, as if I'm logged in,
 yet this still returns nothing:

 $sf_user-getGuardUser()

 $sf_user is an instance of myUser, which descend from
 sfGuardSecurityUser and which has this method:

   public function getGuardUser()
   {
     if (!$this-user  $id = $this-getAttribute('user_id', null,
 'sfGuardSecurityUser'))
     {
       $this-user = sfGuardUserPeer::retrieveByPk($id);

       if (!$this-user)
       {
         // the user does not exist anymore in the database
         $this-signOut();

         throw new sfException('The user does not exist anymore in the
 database.');
       }
     }
     return $this-user;
   }

 On Sep 19, 12:14 am, Jake Barnes lkrub...@geocities.com wrote:



  The following code always works for me. I can go to the front page of
  the site, and I can log in and I never get an error.

  For one of my clients, the site works great in FireFox, but throws an
  error in Google Chrome. For another of my clients, the following code
  dies with a fatal error all the time. The error is that the method
  getId() is being called on either a non-existent object, or an
  object without that method. In other words, this line throws a fatal
  error:

  $sf_user-getGuardUser()-getId()

  This code appears in layout.php.

  Here is the code:

  ?php if(isset($sf_user)): ?

    ?php if($sf_user-isAuthenticated()): ?

      ?php $criteriaToFindProfile = new Criteria();
  $criteriaToFindProfile-add(sfGuardUserProfilePeer::USER_ID, 
  $sf_user-getGuardUser()-getId()); $thisUsersProfile =

  sfGuardUserProfilePeer::doSelectOne($criteriaToFindProfile); ?

      ?php if (@ is_object($thisUsersProfile)): $username =
  $thisUsersProfile-getFirstName(). ; $username .= $thisUsersProfile-

  getLastName(); if (!$username) $username = $thisUsersProfile-
  getsfGuardUser()-getUsername(); endif; ?

      ?php if (@ is_object($thisUsersProfile)): ?pHello, a
  id=userid href=?php echo url_for('content/profile?id='.
  $thisUsersProfile-getId()) ??php echo $username ?!/a/p?php
  endif ?
      a href=?php echo url_for(sfGuardAuth/signout) ?img src=?
  php echo image_path('logout.png') ? alt=LOGOUT //a

    ?php endif; ?

  ?php endif; ?

  Can anyone think why this would behave differently on different
  people's browsers?

  I'm having trouble fixing this bug, because I can not recreate it on
  my own machine.

  What is really bizarre is that my clients browser somehow got past
  this line:

   ?php if($sf_user-isAuthenticated()): ?

  Since the page always died for them with a fatal error, they had no
  way to log in.
--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-19 Thread Jake Barnes



On Sep 19, 12:03 pm, Juampy72 juamp...@gmail.com wrote:
 I think it's all about coding or not. Symfony not only helps you
 developing faster but also teaches you a lot of clean, beautiful
 programming. If you do not find this learning curve enriching, then I
 suggest you better go for other framework such as Joomla where
 everything is more visual and you do not need to see much code.

 Is anybody with me?


Shouldn't the real test be what the project needs? If you are just
setting up a simple weblog, then use WordPress. If you are a real
estate company with 20 people and you need to give your people an easy
way to upload photos of the houses you are selling, then use Joomla.
If you are building a new web app, then use Ruby On Rails or Symfony.
If you are building a giant, global corporate web service where
performance is crucial, consider one of the Java frameworks, like
Grails or even (I'd rather take cyanide) Struts.















 On Sep 18, 12:09 pm, bghost bggho...@gmail.com wrote:



  No, the crux of what I wanted to say is:

  Users should not spend more time to learn how some Web Framework
  works but they need to learn a programming language. Any framework
  should be only an auxiliary tool, not an entire small science.
  So, simplicity and speed should be paramount.

  WBR,
  Ghost3D

  On Sep 18, 5:30 pm, Sid Ferreira sid@gmail.com wrote:

   The most easy thing to understand is something that doesn't need
   documentation and I believe that THIS is the point that BGhost is  talking
   about.I don't want launch a rocket in 30 days, I want my gallery ready in
   12 minutes...

   On Fri, Sep 18, 2009 at 12:26, Thomas Rabaix 
   thomas.rab...@gmail.comwrote:

Symfony has many components, each of them are :

   - easy to understand
   - easy to configure
   - very well documented

Now, the only thing complicated is to know how all these components play
together. This is the tricky part, but symfony default configuration 
will be
fine for many projects.

You just need to go further ... if you have already create/try to 
implement
a framework, you will see that symfony has all STABLE the pieces you 
need.
Try to use an IDE : netbeans or eclipse, these two IDE are great to 
navigate
across the code and understand it.

On Fri, Sep 18, 2009 at 5:04 PM, bghost bggho...@gmail.com wrote:

Hi Fabien,

- With the introduction of the Doctrine ORM, number of parameters
 and configuration options are increased manifold. Therefore, the
developer
 must first learn all about the Doctrine ORM. Is that good? Doctrine
ORM
 already providing a fairly good possibilities and options without
Symfony.

- Symfony WEB forms are a bit too complicated and their relations
 with the rest of a Symfony application is often unclear.

WBR,
Ghost3D

On Sep 18, 4:43 pm, Fabien Potencier fabien.potenc...@symfony-
project.com wrote:
 You say that symfony became too complicated, which implies it was not
 before.

 Can you give us some examples of what became more complicated? That 
 will
 help us improve the framework.

 For instance, we have less and less configuration files. Since 1.0, 
 we
 removed a lot of them, and removed some parameters also.

 Thanks,
 Fabien

 --
 Fabien Potencier
 Sensio CEO - symfony lead developer
 sensiolabs.com | symfony-project.org | fabien.potencier.org
 Tél: +33 1 40 99 80 80

 bghost wrote:

  First, I would like to say that Symfony framework is not too bad,
  because I follow its development from the first version. But I 
  think
  it became too complicated because it is evident exaggeration
  with the introduction of countless parameters and configuration
  files in order to automate all possible tasks. This entails that 
  the
  programmer spends more time dealing with the Symfony framework
  than with the real problem.

  P.S. I did nothing special but just followed the Jobeet tutorial.

  WBR,
  Ghost3D

  On Sep 18, 4:24 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
  It is necessary to invest so much effort to do a relatively 
  simple
  application.
  If you're just learning Symfony, then yes of course you'll find it
too
  much effort. This is true with any other framework/technology.

  But for those of us who have invested our time in Symfony, we find
  great leverage in using Symfony.

  So what is the relatively simple application you're trying to 
  build?

  On Sat, Sep 19, 2009 at 1:58 AM, bghost bggho...@gmail.com 
  wrote:

  It is necessary to invest so much effort to do a relatively 
  simple
  application.
  Productivity and profitability of such work is very questionable.
  So, Symfony - Goodbye
  --
  Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz


[symfony-users] Re: Application or module

2009-09-19 Thread Jake Barnes


I'd go with 2 or more modules. So far I've rarely seen a need for 2
applications. I think you only need separate applications when you are
dealing with a huge project that has divisions that are entirely
separate. For instance, a huge corporate intranet, offering services
to the global sales team, and also enabling a tech support operation
run out of India - that might be 2 separate applications. But the
average web site should be one application.



On Sep 18, 7:09 am, mbernasocchi mbernasoc...@gmail.com wrote:
 Hi, I'm starting a new (my first with symfony) project which has a
 forum and a blog. I'd like to have a static home page that links to
 the two and to have cross links between blog and forum.
 Is it better to create a frontend app with forum and blog modules or
 to create two different applications? And why? for the backend i'll
 create a different app.

 thanks a lot
 Marco
--~--~-~--~~~---~--~~
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: Application or module

2009-09-19 Thread Jake Barnes


Will your CRM ever have to talk to Billing or Inventory? If yes, keep
it to one application. If no, then I could see separate applications.


On Sep 19, 2:40 am, mbernasocchi mbernasoc...@gmail.com wrote:
 similar scenario:

 The application has several loosely tied parts that can be used
 separately or together, and all share the same login.

 Think ERP here, with CRM, Billing, Inventory etc. All parts are
 modular within the main application, but they are all pretty big
 applications with many modules themselves.

 I figure there's three options:

 1. Each part is its own project.
 2. One project, each part is an application within.
 3. One project, one application, each part is a module within.

 #1 feels to strict, no tie between the parts.
 #2 feels great, I'm just not sure how it will actually work within
 Symfony.
 #3 feels like trying to fit an application within the frame of a CMS.

 I want to go with #2, I just want to assure myself that I won't shoot
 me in the foot doing so. Razz

 What do you guys think about it?

 On Sep 18, 7:46 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:



  Modules because I think basically if two things share users, they
  should be in the same apps as modules.

  On Fri, Sep 18, 2009 at 11:42 PM, Gareth McCumskey gmccums...@gmail.com 
  wrote:
   In my opinion  same project seperate modules. Getting two seperate
   applications to talk can sometimes be tricky

   On Fri, Sep 18, 2009 at 1:09 PM,mbernasocchimbernasoc...@gmail.com
   wrote:

   Hi, I'm starting a new (my first with symfony) project which has a
   forum and a blog. I'd like to have a static home page that links to
   the two and to have cross links between blog and forum.
   Is it better to create a frontend app with forum and blog modules or
   to create two different applications? And why? for the backend i'll
   create a different app.

   thanks a lot
   Marco

   --
   Gareth McCumskey
  http://garethmccumskey.blogspot.com
   twitter: @garethmcc

  --
  Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~-~--~~~---~--~~
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] an intermitent bug, different for each browser and user

2009-09-18 Thread Jake Barnes




The following code always works for me. I can go to the front page of
the site, and I can log in and I never get an error.

For one of my clients, the site works great in FireFox, but throws an
error in Google Chrome. For another of my clients, the following code
dies with a fatal error all the time. The error is that the method
getId() is being called on either a non-existent object, or an
object without that method. In other words, this line throws a fatal
error:

$sf_user-getGuardUser()-getId()

This code appears in layout.php.

Here is the code:

?php if(isset($sf_user)): ?

  ?php if($sf_user-isAuthenticated()): ?

?php $criteriaToFindProfile = new Criteria();
$criteriaToFindProfile-add(sfGuardUserProfilePeer::USER_ID, $sf_user-
getGuardUser()-getId()); $thisUsersProfile =
sfGuardUserProfilePeer::doSelectOne($criteriaToFindProfile); ?

?php if (@ is_object($thisUsersProfile)): $username =
$thisUsersProfile-getFirstName(). ; $username .= $thisUsersProfile-
getLastName(); if (!$username) $username = $thisUsersProfile-
getsfGuardUser()-getUsername(); endif; ?

?php if (@ is_object($thisUsersProfile)): ?pHello, a
id=userid href=?php echo url_for('content/profile?id='.
$thisUsersProfile-getId()) ??php echo $username ?!/a/p?php
endif ?
a href=?php echo url_for(sfGuardAuth/signout) ?img src=?
php echo image_path('logout.png') ? alt=LOGOUT //a

  ?php endif; ?

?php endif; ?


Can anyone think why this would behave differently on different
people's browsers?

I'm having trouble fixing this bug, because I can not recreate it on
my own machine.

What is really bizarre is that my clients browser somehow got past
this line:

 ?php if($sf_user-isAuthenticated()): ?

Since the page always died for them with a fatal error, they had no
way to log in.






--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-18 Thread Jake Barnes


 If you're just learning Symfony, then yes of course you'll find it too
 much effort. This is true with any other framework/technology.

I am not sure if that is true with every framework. CodeIgniter is
lighter than Symfony. You could argue that maybe it does less, but it
also seems to take less to get going. Of the PHP developers I know,
they seem split between CodeIgniter and Symfony. Symfony offers OOP
and a careful adherence to many good design patterns, but CodeIgniter
offers simplicity.

Personally, I am a big fan of Symfony, but I've got some friends who
make many good points in favor of CodeIgniter. And the form system of
Symfony offers a lot of complexity, much of it seemingly unnecessary.




On Sep 18, 10:24 am, Sid Bachtiar sid.bacht...@gmail.com wrote:
  It is necessary to invest so much effort to do a relatively simple
  application.

 If you're just learning Symfony, then yes of course you'll find it too
 much effort. This is true with any other framework/technology.

 But for those of us who have invested our time in Symfony, we find
 great leverage in using Symfony.

 So what is the relatively simple application you're trying to build?

 On Sat, Sep 19, 2009 at 1:58 AM, bghost bggho...@gmail.com wrote:

  It is necessary to invest so much effort to do a relatively simple
  application.
  Productivity and profitability of such work is very questionable.

  So, Symfony - Goodbye

 --
 Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~-~--~~~---~--~~
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: Symfony has definitely become too complicated framework

2009-09-18 Thread Jake Barnes



On Sep 18, 12:09 pm, bghost bggho...@gmail.com wrote:
 No, the crux of what I wanted to say is:

 Users should not spend more time to learn how some Web Framework
 works but they need to learn a programming language. Any framework
 should be only an auxiliary tool, not an entire small science.
 So, simplicity and speed should be paramount.


That is too wide a statement. The discipline and heaviness of a
framework should match the goals. If you are trying to manage a huge
corporate site, some managers would still argue for Struts. If you
have a big site but want a more agile framework, some forward thinking
corporate managers might opt for Grails. If you are in the world of
startups, you will want something agile, but something that still
imposes enough structure as to allow many programmers to work together
- Ruby On Rails and Drupal and Symfony fall into this category. If the
project is very small scale, and you are the only programmer, then the
lightest framework you can find should be all you need. And if you are
simply putting up a weblog, then just use WordPress.

A bit off-topic, but I notice in New York City there are almost no
jobs for generic PHP programmers anymore. The jobs all tend to specify
a framework - Drupal and Symfony are the one's I see mentioned most
often (though being able to customize WordPress gets more mentions
than all the other frameworks put together - though WordPress projects
tend to be very small scale).










 On Sep 18, 5:30 pm, Sid Ferreira sid@gmail.com wrote:



  The most easy thing to understand is something that doesn't need
  documentation and I believe that THIS is the point that BGhost is  talking
  about.I don't want launch a rocket in 30 days, I want my gallery ready in
  12 minutes...

  On Fri, Sep 18, 2009 at 12:26, Thomas Rabaix thomas.rab...@gmail.comwrote:

   Symfony has many components, each of them are :

      - easy to understand
      - easy to configure
      - very well documented

   Now, the only thing complicated is to know how all these components play
   together. This is the tricky part, but symfony default configuration will 
   be
   fine for many projects.

   You just need to go further ... if you have already create/try to 
   implement
   a framework, you will see that symfony has all STABLE the pieces you need.
   Try to use an IDE : netbeans or eclipse, these two IDE are great to 
   navigate
   across the code and understand it.

   On Fri, Sep 18, 2009 at 5:04 PM, bghost bggho...@gmail.com wrote:

   Hi Fabien,

   - With the introduction of the Doctrine ORM, number of parameters
    and configuration options are increased manifold. Therefore, the
   developer
    must first learn all about the Doctrine ORM. Is that good? Doctrine
   ORM
    already providing a fairly good possibilities and options without
   Symfony.

   - Symfony WEB forms are a bit too complicated and their relations
    with the rest of a Symfony application is often unclear.

   WBR,
   Ghost3D

   On Sep 18, 4:43 pm, Fabien Potencier fabien.potenc...@symfony-
   project.com wrote:
You say that symfony became too complicated, which implies it was not
before.

Can you give us some examples of what became more complicated? That 
will
help us improve the framework.

For instance, we have less and less configuration files. Since 1.0, we
removed a lot of them, and removed some parameters also.

Thanks,
Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.org | fabien.potencier.org
Tél: +33 1 40 99 80 80

bghost wrote:

 First, I would like to say that Symfony framework is not too bad,
 because I follow its development from the first version. But I think
 it became too complicated because it is evident exaggeration
 with the introduction of countless parameters and configuration
 files in order to automate all possible tasks. This entails that the
 programmer spends more time dealing with the Symfony framework
 than with the real problem.

 P.S. I did nothing special but just followed the Jobeet tutorial.

 WBR,
 Ghost3D

 On Sep 18, 4:24 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 It is necessary to invest so much effort to do a relatively simple
 application.
 If you're just learning Symfony, then yes of course you'll find it
   too
 much effort. This is true with any other framework/technology.

 But for those of us who have invested our time in Symfony, we find
 great leverage in using Symfony.

 So what is the relatively simple application you're trying to build?

 On Sat, Sep 19, 2009 at 1:58 AM, bghost bggho...@gmail.com wrote:

 It is necessary to invest so much effort to do a relatively simple
 application.
 Productivity and profitability of such work is very questionable.
 So, Symfony - Goodbye
 --
 Blue Horn Ltd - System 

[symfony-users] Re: Symfony has definitely become too complicated framework

2009-09-18 Thread Jake Barnes



On Sep 18, 3:36 pm, Lukas Kahwe Smith m...@pooteeweet.org wrote:
 On 18.09.2009, at 21:27, bghost wrote:



  I think that the attempt of putting the entire WEB form within the
  class
  only unnecessarily complicate such a simple thing such is form
  handling.
  That's just forcing WEB developers to learn how to make simple things
  on the complicated way.

 i think this is a valid criticism. there is a clear shift away from  
 having just some html/css/js guru do the templates back in symfony 1.0  
 towards requiring a symfony expert to also handle the templates, but  
 that person lacks the html/css/js guru knowhow. the pay off is however  
 that a symfony expert can now do a lot more if he just sits down with  
 the html/css/js guru to create the required widgets in pair  
 programming. the quality of the site should also increase since reuse  
 is done more on the widget side of things but more importantly you  
 start to bring everything data related together in the models, so you  
 have a single definitive source.

 so what does it all mean? teach your symfony experts some more html/
 css/js, teach your html/css/js guru some symfony .. or better yet ..  
 facilitate paired programming .. and you should be off producing high  
 quality more maintainable sites in less time .. but the old workflow  
 of clear work separation isnt going to cut it anymore. then again, you  
 can still keep the spirit of 1.0 in 1.2 i guess ..


You can still get the 1.0 spirit, though paired programming is not the
way to do it. And yes, for some projects, it is very important that
the designers have access to all of the HTML, including that in the
forms. Some design lead projects suffer badly from the default forms
setup in Symfony 1.2.

What's needed is a plugin that can auto-generate the CRUD forms in
nearly pure HTML, with PHP commands only handling the values that
appear in the inputs. That way, depending on the project, you could
either work with the default forms generated by Symfony, or switch
over to a system that is much more open for designers.

If I get some time later this year, I hope to work on such a plugin.









--~--~-~--~~~---~--~~
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: sf_guard error: Fatal error: Allowed memory size of 16777216 bytes exhausted

2009-09-17 Thread Jake Barnes

Well, I deleted every mention of the function  format_date() and now
everything works fine. Truly strange why I could not get the function
to work.



On Sep 12, 11:47 am, Jake Barnes lkrub...@geocities.com wrote:
 On Sep 12, 10:58 am, pcummins patwcumm...@gmail.com wrote:

  It sounds like you need the date helper in your template.

  ?php use_helper('Date')?

 I ssh to the server. I then followed the path listed in the error
 message:

 Fatal error: Call to undefined function format_date() in /home/
 theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
 templates/_list_td_tabular.php on line 11

 This folder:

 home/theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
 templates/

 has these files:

 theesoci...@rome:~/public_html/cache/test/dev/modules/autoSfGuardUser/
 templates$ ls -al
 total 96
 drwxrwxrwx 2 theesociety theesociety 4096 2009-09-11 13:30 .
 drwxrwxrwx 5 theesociety theesociety 4096 2009-09-02 15:46 ..
 -rw-r--r-- 1 theesociety theesociety  135 2009-09-11 13:30 _assets.php
 -rw-r--r-- 1 theesociety theesociety  881 2009-09-11 13:30
 editSuccess.php
 -rw-r--r-- 1 theesociety theesociety  967 2009-09-11 13:30
 _filters_field.php
 -rw-r--r-- 1 theesociety theesociety 1589 2009-09-11 13:30
 _filters.php
 -rw-r--r-- 1 theesociety theesociety  310 2009-09-11 13:30
 _flashes.php
 -rw-r--r-- 1 theesociety theesociety 1283 2009-09-11 13:30
 _form_actions.php
 -rw-r--r-- 1 theesociety theesociety  963 2009-09-11 13:30
 _form_field.php
 -rw-r--r-- 1 theesociety theesociety  857 2009-09-11 13:30
 _form_fieldset.php
 -rw-r--r-- 1 theesociety theesociety    0 2009-09-11 13:30
 _form_footer.php
 -rw-r--r-- 1 theesociety theesociety    0 2009-09-11 13:30
 _form_header.php
 -rw-r--r-- 1 theesociety theesociety  831 2009-09-11 13:30 _form.php
 -rw-r--r-- 1 theesociety theesociety 1127 2009-09-11 13:30
 indexSuccess.php
 -rw-r--r-- 1 theesociety theesociety  112 2009-09-11 13:30
 _list_actions.php
 -rw-r--r-- 1 theesociety theesociety  548 2009-09-11 13:30
 _list_batch_actions.php
 -rw-r--r-- 1 theesociety theesociety  248 2009-09-11 13:30
 _list_field_boolean.php
 -rw-r--r-- 1 theesociety theesociety    0 2009-09-11 13:30
 _list_footer.php
 -rw-r--r-- 1 theesociety theesociety    0 2009-09-11 13:30
 _list_header.php
 -rw-r--r-- 1 theesociety theesociety 2276 2009-09-11 13:30 _list.php
 -rw-r--r-- 1 theesociety theesociety  363 2009-09-11 13:30
 _list_td_actions.php
 -rw-r--r-- 1 theesociety theesociety  138 2009-09-11 13:30
 _list_td_batch_actions.php
 -rw-r--r-- 1 theesociety theesociety  435 2009-09-11 13:30
 _list_td_stacked.php
 -rw-r--r-- 1 theesociety theesociety  492 2009-09-11 13:30
 _list_td_tabular.php
 -rw-r--r-- 1 theesociety theesociety   80 2009-09-11 13:30
 _list_th_stacked.php
 -rw-r--r-- 1 theesociety theesociety 2310 2009-09-11 13:30
 _list_th_tabular.php
 -rw-r--r-- 1 theesociety theesociety  815 2009-09-11 13:30
 newSuccess.php
 -rw-r--r-- 1 theesociety theesociety 1486 2009-09-11 13:30
 _pagination.php

 Both index.php and edit.php already had this at the top:

 ?php use_helper('I18N', 'Date') ?

 So the Date helpers should have already been there. But since I was
 getting an error, I opened up _list_td_tabular.php and I added this
 in:

 ?php use_helper('Date') ?

 But the error remains unchanged.

 Also, I'm working on files in the cache folder, so this will break
 every time I do symfony cc. While I'd be happy to get it working
 just for now, I'd also be curious if people have ideas about to fix
 this problem further upstream.



  On Sep 12, 3:27 am, JakeBarneslkrub...@geocities.com wrote:

   The previous error has vancished. Now the view partly renders but dies
   with this error:

   Fatal error: Call to undefined function format_date() in /home/
   theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
   templates/_list_td_tabular.php on line 8

   I am not aware of any change that I've made that could effect what
   functions are available to the sfGuardUser plugin, especially since it
   is serving its administrative module from a cache file. Does anyone
   know what could cause an error like this?

   On Sep 11, 1:38 pm, JakeBarneslkrub...@geocities.com wrote:

For the most part, everything on my site is working great, however, a
bug has suddenly appeared regarding sfGuard. I have not made any
changes to this module that I can recall. If I go here:

frontend_dev.php/sf_guard_user.html

Then I get this:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 4864 bytes) in /usr/share/php/symfony/widget/
sfWidgetFormChoice.class.php on line 113

The last entry in Subversion, regarding sfGuardPlugin, is this:

Some base class has apparently been left out of Subversion. I can not
easily find it. It is on the dev site but not on the live site. I'd
like to find it and add it to the live site. 

That was 100 small revisions ago. No changes, just adding in some base

[symfony-users] Re: Deployment Scenarios (DB Specific)

2009-09-16 Thread Jake Barnes


We used migrations on a recent project, but it was only a partial
solution. Each programmer was responsible for writing their own
migration, and then committing it to Subversion, and then they were
suppose to warn the other programmers to update the database on their
local machines. For some reason, the migrations would sometimes work
for some programmers and not for others.

The worst thing about the migrations is they quit whenever they run
into an error, and it is not obvious where they quit. For instance,
suppose you are at version 23 of the database (the version number is
suppose to be maintained by the plugin code). You then try to upgrade
to the newest migration. The newest version is 28 (if you take the
weekend off, while another programmer is busy, you might easily come
back on Monday and find that your version of the database is several
versions out of date). The code gets half way through version 25 and
dies with an error.

Possibly you might open the migration file for version 25 and hand
edit it, but you can not run that file again, because the first half
of that file describes changes which have already been made, and which
therefore can not be run again. The only clean way to upgrade,
avoiding all errors, is to DROP TABLE before making changes to a
table, but clearly that is impossible to do on a live website - you
could not afford to lose so much data.

Most of the time the down() methods failed to work. Most of the time
I'd get foreign key conflicts when trying to go back down(). (The main
reason to go down was so that I could go up again.)

What I found is that most of the time I had to do changes to the
database by hand.



On Sep 14, 10:21 am, ColinFine colin.f...@pace.com wrote:
 On Sep 13, 8:34 pm, Fotis Paraskevopoulos fota...@gmail.com wrote:





  Hello All,

  I would like to ask the group the different deployment scenarios that
  have been setup. I am specifically looking for some information on how
  you manage your database deployment when some changes need to be made.

  For example I deploy version 1.0 of the site/application and I need to
  make some small fixes which require database changes on the server
  side.

  From what I have seen most people use svn or rsync to handle remote
  deployment of the symfony files. This is simple to automate or to
  create a one click action to  deploy a new version.

  So basically I am asking how do you effectively handle database
  changes.

 There is a plugin called something like sfMigrationPlugin (haven't got
 access to my symfony projects here)

 You need to write the specific SQL that is needed to migrate from one
 version of the database to the next and back again, but once you have
 done so, it keeps track of which version your database is currently
 at, and will apply the SQL to update it when you tell it to do so.
--~--~-~--~~~---~--~~
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: pkToolkitPlugin gems: a lightweight HTML filter, and a handy way to ssh to your staging and production servers

2009-09-16 Thread Jake Barnes

Thanks, Tom. I'll post a link to this from my weblog. The HTML
Simplify is a utility most of us need for a lot of projects. Do you
have a blog? I'm going to link to the thread on Google Groups, but it
would seem more normal to post to an announcement on your company
site.



On Sep 14, 4:36 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 Great plugin! Thank you ... I am using it on my project :D





 On Tue, Sep 15, 2009 at 1:59 AM, Tom Boutell t...@punkave.com wrote:

  Unlike most of our plugins, pkToolkitPlugin is a bit of a kitchen
  sink. It contains a lot of utility classes, some more experimental
  things, and not a lot of documentation. So it's easy to miss the great
  stuff that lives there.

  Better documentation is coming as various items in that plugin mature.
  But I'd like to share two particularly useful and stable features that
  folks probably don't realize are there:

  * The pkToolkit:ssh task. This is a convenient way to open up an
  interactive ssh connection to any staging or production server
  configured in properties.ini. Just type:

  ./symfony pkToolkit:ssh staging

  You'll be prompted for the password of the staging site. When the
  connection is made, the script automatically changes directory to the
  project's directory, which is almost always the next thing you'd do
  anyway. And then it becomes a normal interactive shell.

  Note that the 'expect' utility must be installed on your computer for
  this to work, and it probably won't work on a Windows host. Macs come
  with expect, and it is an easily installed package on Linux.

  * The pkHtml class. Many projects allow users to edit content via a
  rich text editor. And we all know what happens if the user pastes a
  Word document in there: the styles of the page wind up hopelessly
  munged. You can use striptags(), but that doesn't clean up the CSS, so
  your page is still a mess.

  A common workaround is to use FCK's paste as plaintext mode, which
  thwarts attempts to paste rich text from another program. That works,
  after a fashion, but it's frustrating for users. And none of the
  workarounds help if the user is actively trying to enter inappropriate
  HTML in a misguided attempt to re-style their site... then calling you
  to fix it for the 500th time.

  HTML Tidy can do the job, but it has a reputation for being heavy and slow.

  Or... you can just use pkHtml::simplify():

  pkHtml::simplify($richTextHTML,
  h3h4h5h6blockquotepaulolnllibistrongemstrik 
  ecodehrbrdivtabletheadcaptiontbodytrthtd);

  If that looks a lot like the arguments to striptags(), you're right.
  But pkHtml::simplify() follows up striptags() with a DOMDocument-based
  filter that removes attributes too, except for the attributes that
  actually make sense to permit for certain tags. Currently this is:

  A tag - href and name attributes
  img tag - src attribute

  You don't have to use pkHtml::simplify() manually, either. Instead,
  you can use the sfValidatorHtml validator, also found in pkToolkit,
  which allows the above list of tags by default because they are
  well-suited to user-entered content (you can change that).

  pkHtml is much more lightweight than Tidy. On one project we needed to
  separately clean hundreds of potential HTML containers in a single XML
  document, in real time, before presenting some of that information to
  the user. pkHtml::simplify turns that around very quickly indeed.

  Our pkContextCMSPlugin takes advantage of pkHtml::simplify() to allow
  rich text editing without the constant oops I screwed up my site
  issues that come up without a robust server-side filter.

  For convenience we also package Dominic Schierlinck's
  sfWidgetFormRichTextarea widget. It's meant to be compatible with both
  MCE and FCK, although we always use FCK.

  --
  Tom Boutell
  P'unk Avenue
  215 755 1330
  punkave.com
  window.punkave.com

 --
 Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~-~--~~~---~--~~
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: shouldn't a lack of an id in a form get some kind of error?

2009-09-14 Thread Jake Barnes



On Aug 26, 12:13 am, Eno symb...@gmail.com wrote:
 On Mon, 24 Aug 2009, JakeBarneswrote:
  Then I thought, I guess all the times I tried to save before, without
  an id, I was creating a new record in the database. But I looked in
  the database, and there were no new records. So now I'm thinking that
  id needs to be there in the array of submitted values, even if  it has
  no value, it needs to be there before the form will save it to the
  database. But if this is so, shouldn't there be some kind of error,
  for those situations where there is no id?

  Here I had a form that tested valid yet would not save to the
  database. Doesn't that seem broken?

 You haven't shown your schema or mentioned if this form was generated from
 a model or not.


I think the form was hand coded.



--~--~-~--~~~---~--~~
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] why doesn't the debug bar show all filters?

2009-09-12 Thread Jake Barnes

If I go look at the front of my site, and I am not logged in, and I'm
using the dev controller, then when I hit logs, the debug bar lists
all of the events which have happened, including 3 filters:

sfRenderingFilter
sfCommonFilter
sfValidationExecutionFilter

But if I then attempt to go to a page that I need to be logged in to
see, the logs in the debug bar show 5 filters:

sfRenderingFilter
sfGuardBasicSecurityFilter
sfRenderingFilter
sfCommonFilter
sfValidationExecutionFilter

I am curious why sfRenderingFilter gets called twice? If I then login
and look at the same page, these 4 filters appear:

sfRenderingFilter
sfGuardBasicSecurityFilter
sfCommonFilter
sfValidationExecutionFilter


What does it take for a filter to appear in the debug bar? All of the
filters get called every time a page loads, yes? Isn't there something
inaccurate in only listing 3 filters when viewing the front page?




--~--~-~--~~~---~--~~
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: sf_guard error: Fatal error: Allowed memory size of 16777216 bytes exhausted

2009-09-12 Thread Jake Barnes


The previous error has vancished. Now the view partly renders but dies
with this error:


Fatal error: Call to undefined function format_date() in /home/
theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
templates/_list_td_tabular.php on line 8

I am not aware of any change that I've made that could effect what
functions are available to the sfGuardUser plugin, especially since it
is serving its administrative module from a cache file. Does anyone
know what could cause an error like this?







On Sep 11, 1:38 pm, Jake Barnes lkrub...@geocities.com wrote:
 For the most part, everything on my site is working great, however, a
 bug has suddenly appeared regarding sfGuard. I have not made any
 changes to this module that I can recall. If I go here:

 frontend_dev.php/sf_guard_user.html

 Then I get this:

 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
 allocate 4864 bytes) in /usr/share/php/symfony/widget/
 sfWidgetFormChoice.class.php on line 113

 The last entry in Subversion, regarding sfGuardPlugin, is this:

 Some base class has apparently been left out of Subversion. I can not
 easily find it. It is on the dev site but not on the live site. I'd
 like to find it and add it to the live site. 

 That was 100 small revisions ago. No changes, just adding in some base
 classes.

 And yes, I've already done symfony cc.

 Any suggestions?
--~--~-~--~~~---~--~~
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: sf_guard error: Fatal error: Allowed memory size of 16777216 bytes exhausted

2009-09-12 Thread Jake Barnes



On Sep 12, 10:58 am, pcummins patwcumm...@gmail.com wrote:
 It sounds like you need the date helper in your template.

 ?php use_helper('Date')?



Yes, but this is an auto-generated template that has worked in the
past. When I look in Subversion, I do not see edits on the
sfGuardPlugin. So  why would such an error suddenly start to appear?














 On Sep 12, 3:27 am, Jake Barnes lkrub...@geocities.com wrote:

  The previous error has vancished. Now the view partly renders but dies
  with this error:

  Fatal error: Call to undefined function format_date() in /home/
  theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
  templates/_list_td_tabular.php on line 8

  I am not aware of any change that I've made that could effect what
  functions are available to the sfGuardUser plugin, especially since it
  is serving its administrative module from a cache file. Does anyone
  know what could cause an error like this?

  On Sep 11, 1:38 pm, Jake Barnes lkrub...@geocities.com wrote:

   For the most part, everything on my site is working great, however, a
   bug has suddenly appeared regarding sfGuard. I have not made any
   changes to this module that I can recall. If I go here:

   frontend_dev.php/sf_guard_user.html

   Then I get this:

   Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
   allocate 4864 bytes) in /usr/share/php/symfony/widget/
   sfWidgetFormChoice.class.php on line 113

   The last entry in Subversion, regarding sfGuardPlugin, is this:

   Some base class has apparently been left out of Subversion. I can not
   easily find it. It is on the dev site but not on the live site. I'd
   like to find it and add it to the live site. 

   That was 100 small revisions ago. No changes, just adding in some base
   classes.

   And yes, I've already done symfony cc.

   Any suggestions?
--~--~-~--~~~---~--~~
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: sf_guard error: Fatal error: Allowed memory size of 16777216 bytes exhausted

2009-09-12 Thread Jake Barnes



On Sep 12, 10:58 am, pcummins patwcumm...@gmail.com wrote:
 It sounds like you need the date helper in your template.

 ?php use_helper('Date')?



I ssh to the server. I then followed the path listed in the error
message:

Fatal error: Call to undefined function format_date() in /home/
theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
templates/_list_td_tabular.php on line 11

This folder:

home/theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
templates/

has these files:

theesoci...@rome:~/public_html/cache/test/dev/modules/autoSfGuardUser/
templates$ ls -al
total 96
drwxrwxrwx 2 theesociety theesociety 4096 2009-09-11 13:30 .
drwxrwxrwx 5 theesociety theesociety 4096 2009-09-02 15:46 ..
-rw-r--r-- 1 theesociety theesociety  135 2009-09-11 13:30 _assets.php
-rw-r--r-- 1 theesociety theesociety  881 2009-09-11 13:30
editSuccess.php
-rw-r--r-- 1 theesociety theesociety  967 2009-09-11 13:30
_filters_field.php
-rw-r--r-- 1 theesociety theesociety 1589 2009-09-11 13:30
_filters.php
-rw-r--r-- 1 theesociety theesociety  310 2009-09-11 13:30
_flashes.php
-rw-r--r-- 1 theesociety theesociety 1283 2009-09-11 13:30
_form_actions.php
-rw-r--r-- 1 theesociety theesociety  963 2009-09-11 13:30
_form_field.php
-rw-r--r-- 1 theesociety theesociety  857 2009-09-11 13:30
_form_fieldset.php
-rw-r--r-- 1 theesociety theesociety0 2009-09-11 13:30
_form_footer.php
-rw-r--r-- 1 theesociety theesociety0 2009-09-11 13:30
_form_header.php
-rw-r--r-- 1 theesociety theesociety  831 2009-09-11 13:30 _form.php
-rw-r--r-- 1 theesociety theesociety 1127 2009-09-11 13:30
indexSuccess.php
-rw-r--r-- 1 theesociety theesociety  112 2009-09-11 13:30
_list_actions.php
-rw-r--r-- 1 theesociety theesociety  548 2009-09-11 13:30
_list_batch_actions.php
-rw-r--r-- 1 theesociety theesociety  248 2009-09-11 13:30
_list_field_boolean.php
-rw-r--r-- 1 theesociety theesociety0 2009-09-11 13:30
_list_footer.php
-rw-r--r-- 1 theesociety theesociety0 2009-09-11 13:30
_list_header.php
-rw-r--r-- 1 theesociety theesociety 2276 2009-09-11 13:30 _list.php
-rw-r--r-- 1 theesociety theesociety  363 2009-09-11 13:30
_list_td_actions.php
-rw-r--r-- 1 theesociety theesociety  138 2009-09-11 13:30
_list_td_batch_actions.php
-rw-r--r-- 1 theesociety theesociety  435 2009-09-11 13:30
_list_td_stacked.php
-rw-r--r-- 1 theesociety theesociety  492 2009-09-11 13:30
_list_td_tabular.php
-rw-r--r-- 1 theesociety theesociety   80 2009-09-11 13:30
_list_th_stacked.php
-rw-r--r-- 1 theesociety theesociety 2310 2009-09-11 13:30
_list_th_tabular.php
-rw-r--r-- 1 theesociety theesociety  815 2009-09-11 13:30
newSuccess.php
-rw-r--r-- 1 theesociety theesociety 1486 2009-09-11 13:30
_pagination.php


Both index.php and edit.php already had this at the top:

?php use_helper('I18N', 'Date') ?

So the Date helpers should have already been there. But since I was
getting an error, I opened up _list_td_tabular.php and I added this
in:

?php use_helper('Date') ?

But the error remains unchanged.

Also, I'm working on files in the cache folder, so this will break
every time I do symfony cc. While I'd be happy to get it working
just for now, I'd also be curious if people have ideas about to fix
this problem further upstream.





 On Sep 12, 3:27 am, Jake Barnes lkrub...@geocities.com wrote:

  The previous error has vancished. Now the view partly renders but dies
  with this error:

  Fatal error: Call to undefined function format_date() in /home/
  theesociety/public_html/cache/test/dev/modules/autoSfGuardUser/
  templates/_list_td_tabular.php on line 8

  I am not aware of any change that I've made that could effect what
  functions are available to the sfGuardUser plugin, especially since it
  is serving its administrative module from a cache file. Does anyone
  know what could cause an error like this?

  On Sep 11, 1:38 pm, Jake Barnes lkrub...@geocities.com wrote:

   For the most part, everything on my site is working great, however, a
   bug has suddenly appeared regarding sfGuard. I have not made any
   changes to this module that I can recall. If I go here:

   frontend_dev.php/sf_guard_user.html

   Then I get this:

   Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
   allocate 4864 bytes) in /usr/share/php/symfony/widget/
   sfWidgetFormChoice.class.php on line 113

   The last entry in Subversion, regarding sfGuardPlugin, is this:

   Some base class has apparently been left out of Subversion. I can not
   easily find it. It is on the dev site but not on the live site. I'd
   like to find it and add it to the live site. 

   That was 100 small revisions ago. No changes, just adding in some base
   classes.

   And yes, I've already done symfony cc.

   Any suggestions?
--~--~-~--~~~---~--~~
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

[symfony-users] sf_guard error: Fatal error: Allowed memory size of 16777216 bytes exhausted

2009-09-11 Thread Jake Barnes


For the most part, everything on my site is working great, however, a
bug has suddenly appeared regarding sfGuard. I have not made any
changes to this module that I can recall. If I go here:

frontend_dev.php/sf_guard_user.html

Then I get this:

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to
allocate 4864 bytes) in /usr/share/php/symfony/widget/
sfWidgetFormChoice.class.php on line 113

The last entry in Subversion, regarding sfGuardPlugin, is this:

Some base class has apparently been left out of Subversion. I can not
easily find it. It is on the dev site but not on the live site. I'd
like to find it and add it to the live site. 

That was 100 small revisions ago. No changes, just adding in some base
classes.

And yes, I've already done symfony cc.

Any suggestions?


--~--~-~--~~~---~--~~
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: Self-referencing objects (a variantion of M:M)

2009-09-10 Thread Jake Barnes


This seems like a pretty standard many-to-many scenario. As such, the
use of a lookup table that has rows pointing to the 2 other tables
would be pretty common:

id
important_info_id
other_important_info_id

That is the most common way I've seen many-to-many relationships
handled.



On Sep 9, 8:45 am, Crafty_Shadow vankat...@gmail.com wrote:
 In a project I have recently started I need to show a connection
 between objects. For the sake of example let's say I have a database
 structure similar to:

   child_record:
     id:                 ~
     name:               { type: varchar(255), required: true }

   slibling_relation:
     first_child:        { type: integer, foreignTable: child_record,
 foreignReference: id, required: true, primaryKey: true, onDelete:
 cascade }
     second_child:       { type: integer, foreignTable: child_record,
 foreignReference: id, required: true, primaryKey: true, onDelete:
 cascade }

 One child can have more than one slibling, but the essential part is
 that they are of equal standing. One is not the parent of the other,
 so I believe I need the intermediate table,
 What I need to do is create an easy way to manage these relations
 through the admin generator (a custom Widget), and appropriate peer
 methods for retrieval of all siblings of a given child. I am familiar
 enough with symfony to be able to implement those, but I'm wondering
 what would be the best way to do so.

 Is my approach to the database shema optimal?
 Any and all comments or suggestions are welcome.
--~--~-~--~~~---~--~~
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: Issue with url_for()

2009-09-10 Thread Jake Barnes


I recently had a problem like this. It turned out when I opened the
template file on someone else's machine, their odd text editor turned
some of my quote marks into smart quotes. It took me forever to
figure out what the problem was. In the end, the solution was simple:
delete the smart quotes and replace with normal quotes.


On Sep 10, 2:54 am, MrGlass mr.gl...@gmail.com wrote:
 Hi,

 I am fairly new to symfony and have been following along with jobeet
 and adapting each step to the needs of my site. I recently ran into an
 interesting problem when listing out links to the different posts on
 my site.

 I use a partial for listing out the tabular data. It simply outputs
 the fields I want along with a link to the actual post. The partial is
 below:

 *in the following code, $posts is an array of post objects returned by
 a doctrine query*

         ?php foreach ($posts as $post): ?
                 tr
                         td class=Titlea href=?php echo 
 url_for('post_pretty_url',
 $post) ?
                                 ?php echo $post-getTitle() ?/a/td
                         td class=Created_At?php echo 
 $post-getCreatedAt() ?/td
                         td class=Author?php echo $post-getAuthor() 
 ?/td
                         td class=Category?php echo 
 $post-getCategoryName() ?/td
                 /tr
         ?php endforeach; ?

 When I visit my page, there is a problem with the first link in the
 page. the generated url has an odd unicode character appended to the
 front, causing a broken. link I'm not sure if it will show up on
 google groups, but here is a short snippet  of the generated HTML:

                         tr
                         td class=Titlea 
 href=/frontend_dev.php/post/6/sdfgsfg
                                 sdfgsfg/a/td
                         td class=Created_At2009-09-03 19:23:48/td
                         td class=Authortester 3/td
                         td class=CategoryTest Cat 4/td

                 /tr
                         tr
                         td class=Titlea 
 href=/frontend_dev.php/post/2/form-test-1
                                 form test 1/a/td
                         td class=Created_At2009-08-25 16:32:26/td
                         td class=Authorform tester/td
                         td class=CategoryTest Cat 2/td

                 /tr

 A few things I have noticed: no matter what order i select the posts
 in, what posts are there, etc, the problem always occurs with the
 first item in the list and only with the first item. If i remove the
 post with the bad url, the links will work, but when I refresh the
 cache the top one will again have the same issue.

 Any info or advice would be appreciated.
--~--~-~--~~~---~--~~
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: an intermitent bug, involving an error about favicon.ico

2009-09-09 Thread Jake Barnes

 An easy fix for your problem is adding a favicon.ico to your document
 root. Also make sure that the login page doesn't require any other
 images that do not exist on the server.

I'm sorry if I wasn't clear, but I've already tried this. Now what
happens is that you fill in your username and password and then you
hit submit and then you end up looking at an URL like this:

http://www.mydomain.com/favicon.ico

At which point, you can see the favicon, but that is all you can see,
because that is where the browser is now pointing.

If you log out, and then log back in, the problem vanishes. As I said
before, the problem is intermittent.

 lawrence




On Sep 9, 5:36 am, Bernhard Schussek bschus...@gmail.com wrote:
 Hi Jake,

 Can you try to access the favicon directly on the server? The problem
 probably is that the favicon is requested by the login page. Instead
 of loading an image, the symfony stack is launched, redirects to the
 login page and stores the requested page in the session, which was the
 favicon.

 Once you sign in successfully, symfony recalls the remembered page and
 redirects to it.

 An easy fix for your problem is adding a favicon.ico to your document
 root. Also make sure that the login page doesn't require any other
 images that do not exist on the server.

 Bernhard
 --
 Software Architect  Engineer
 Blog:http://webmozarts.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: Symfony aspires to be pure OOP, so why the hell are helpers implemented as functions instead of as methods of classes?

2009-09-08 Thread Jake Barnes

 Does it make sense to load an entire class for a few functions designed to
 make writing templates easier?

Isn't that an argument against auto-loading in general? The big
frameworks (Drupal, CakePHP, Symfony) are wasteful when it comes to
resources. And they are slow. We don't use Symfony because we are we
want to be careful about resources, we use Symfony because we want to
maximize programmer productivity. If I was concerned about resource
use, I probably wouldn't be using Symfony. (If I was really worried
about resource use, I probably wouldn't be using PHP.) Given how much
Symfony auto-loads, are a few more library classes a big deal?













On Sep 7, 1:55 am, Eno symb...@gmail.com wrote:
 On Sun, 6 Sep 2009, Jake Barnes wrote:
  So I am puzzled: why are helpers implemented as functions, instead of
  as methods of classes?

 Does it make sense to load an entire class for a few functions designed to
 make writing templates easier?

  The use of functions seems incongruous with the
  stated aims of Symfony. It seems clunky to have such an advanced
  framework that falls back to functions for some things.

 In that case, you may also ask why Ruby on Rails also uses helpers despite
 Ruby being a pure OOP language? I think symfony is more pragmatic than
 purist.

 --
--~--~-~--~~~---~--~~
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] Symfony aspires to be pure OOP, so why the hell are helpers implemented as functions instead of as methods of classes?

2009-09-06 Thread Jake Barnes


I am confused. In most respects Symfony presents itself an OOP
framework which implements several best-practice   design patterns,
such as MVC and Front Controller, and Symfony takes advantage of some
of the most advanced aspects of PHP 5. On the symfony-project.org
site, the first headline of body text says:

Symfony is a full-stack framework, a library of cohesive classes
written in PHP.

I note the use of cohesive classes.

So I am puzzled: why are helpers implemented as functions, instead of
as methods of classes? The use of functions seems incongruous with the
stated aims of Symfony. It seems clunky to have such an advanced
framework that falls back to functions for some things.

Does anyone know why this particular decision was made?







--~--~-~--~~~---~--~~
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: Symfony aspires to be pure OOP, so why the hell are helpers implemented as functions instead of as methods of classes?

2009-09-06 Thread Jake Barnes



On Sep 6, 9:43 pm, Sid Bachtiar sid.bacht...@gmail.com wrote:
 I believe helper is a remnant of symfony 1.0 when it was framework
 for lazy developers or something like that.

 I get the feeling that helper is slowly being phased out.


Okay, so what is considered best practice right now? When we write our
own helpers, is there any reason we should write them as functions?

I'm assuming that at this point we should write helpers as classes?
Especially since the classes get included automatically, whereas the
helpers have to be loaded by hand?










 On Mon, Sep 7, 2009 at 1:20 PM, Jake Barneslkrub...@geocities.com wrote:

  I am confused. In most respects Symfony presents itself an OOP
  framework which implements several best-practice   design patterns,
  such as MVC and Front Controller, and Symfony takes advantage of some
  of the most advanced aspects of PHP 5. On the symfony-project.org
  site, the first headline of body text says:

  Symfony is a full-stack framework, a library of cohesive classes
  written in PHP.

  I note the use of cohesive classes.

  So I am puzzled: why are helpers implemented as functions, instead of
  as methods of classes? The use of functions seems incongruous with the
  stated aims of Symfony. It seems clunky to have such an advanced
  framework that falls back to functions for some things.

  Does anyone know why this particular decision was made?

 --
 Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz
--~--~-~--~~~---~--~~
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: Preferred Linux servers for symfony?

2009-09-04 Thread Jake Barnes

 As for development itself, develop on a Mac for better compatibility
 and fewer surprises when you sync your code to a Unix host later. You

I missed the beginning of this conversation, but this bit seems very
odd to me. Why would you develop on a Mac? Why not develop on a Ubuntu
machine?



On Sep 4, 9:48 am, Tom Boutell t...@punkave.com wrote:
 [Moving this thread to symfony-users as it does not belong in -devs]

 Actually, CentOS and Red Hat Enterprise Linux do not have PHP 5.2.x
 yet, so it is fair to say they are actively bad choices for Symfony.
 You have to take on maintenance of PHP via some less official
 repository or build it yourself, and other distributions don't require
 you to do that. So don't go there.

 Ubuntu, on the other hand, is a very good choice for Symfony. A very
 recent PHP 5.2.x is standard, APC has been compiled and is easily
 enabled... there's even an improved mechanism for cleaning up stale
 PHP sessions which you don't have to do anything special to turn on.
 So I recommend it.

 As for development itself, develop on a Mac for better compatibility
 and fewer surprises when you sync your code to a Unix host later. You
 can use MAMP or MacPorts to get a version of Apache and PHP that is
 good enough for the job. The standard PHP in MacOS Leopard won't cut
 it (I'm not sure whether it's improved in Snow Leopard).





 On Fri, Sep 4, 2009 at 9:36 AM, Pablo Godelpgo...@gmail.com wrote:

  Hi Bob,

  This is a question that should be posted on the users list, not in the
  devs list which is only used for development OF symfony.

  In reality, symfony runs on any Linux distro (or OS for that matter)
  that has an acceptable installation of PHP. I would recommend you use
  the distro that your are most comfortable with.

  regards,
  Pablo

  On Thu, Sep 3, 2009 at 11:05 PM, Robert Acetibob...@cogeco.ca wrote:

  Please let me know which 'nix you are using to develop in symfony and
  pros cons discovered in installation of symfony.  Thank you.

  Bob

  --
  Pablo Godel
  ServerGrove Networks
 http://servergrove.com/

 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.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] MVC architecture: where do most Symfony developers resize images, in the Form class, or in a validator?

2009-09-04 Thread Jake Barnes


No one has any thoughts on this? I'm basically asking about the
application of the MVC ideal - what is pure, in terms of MVC. To put
the resizing code in the form class or in the action? Or in the
validator?


On Sep 3, 1:35 am, Jake Barnes lkrub...@geocities.com wrote:
 I've a form that allows users to upload images that can represent them
 on the site. I need to crop and resize the images to be sure they are
 all the same size. I am curious where do most Symfony developers put
 their code for resizing images? In the form class? I assume it is bad
 practice to do this in the action?
--~--~-~--~~~---~--~~
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: where do most Symfony developers resize images, in the Form class, or in a validator?

2009-09-03 Thread Jake Barnes

 I will create a class that handle that, and passing some parameters I
 will do the resize/crop there.

 In this way you can reuse the code say from a batch script or the
 backend, etc.

So you do this in a helper? Okay, but then where do you call the
helper? The form class? The action? The validator?






On Sep 3, 2:31 am, harryjekyll harryjek...@gmail.com wrote:
 I will create a class that handle that, and passing some parameters I  
 will do the resize/crop there.

 In this way you can reuse the code say from a batch script or the  
 backend, etc.

 On Sep 3, 2009, at 1:35 PM, Jake Barnes wrote:





  I've a form that allows users to upload images that can represent them
  on the site. I need to crop and resize the images to be sure they are
  all the same size. I am curious where do most Symfony developers put
  their code for resizing images? In the form class? I assume it is bad
  practice to do this in the action?
--~--~-~--~~~---~--~~
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: my first plugin

2009-09-03 Thread Jake Barnes

 name it *sfGoogleAnalyticsPlugin*

I thought the initials sf were suppose to indicate that the plugin
came from the core Symfony team? I remember asking about this once
last year, and someone suggested to me that I use my own initials for
the first 2 letters.

 lawrence




On Sep 3, 6:46 am, Thomas Rabaix thomas.rab...@gmail.com wrote:
 name it *sfGoogleAnalyticsPlugin*





 On Thu, Sep 3, 2009 at 12:25 PM, berni andr...@itma.pl wrote:

  hello,

  I write my first plugin. This plugin will fetch data from google
  analytics api but I have one problem - plugin not work. I make default
  structure:

  plugins
  + sfGoogleAnalytics (name of my plugin)
  + + config
  + + modules
  + + + googleAnalytics
  + + + + actions
  + + + + lib
  + + + + config

  I enable plugin module in settings.yml in my application
  ( enabled_modules:        [default, sfGuardAuth, comment, jsThumbnail,
  googleAnalytics] )

  When I try to call the addresshttp://my_host.com/googleAnalyticsi
  have Action googleAnalytics/index does not exist.

  What's going on?

 --
 Thomas Rabaixhttp://rabaix.net
--~--~-~--~~~---~--~~
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: Is it possible to get PHP arrays through Symfony's url_for() helper?

2009-08-31 Thread Jake Barnes

After a bunch of searches on Google, I found that we could do this:

?php echo link_to('All Current Students', 'content/search', array
('query_string' = 'uva_status[]=Undergrad studentamp;uva_status[]
=Grad Student/Postdoc')) ?


It is hard to find the documentation on this stuff, but there it is.
This allows a query string to get passed through to the browser, with
getting converted in the way that url_for() converts things.






On Aug 31, 7:12 pm, Jake Barnes lkrub...@geocities.com wrote:
 In the old days, if I needed to get a PHP array through an URL, I
 could just do it. But now, I use Symfony to build websites. I tried to
 get this through url_for():

 url_for('content/search?uva_status[]=Undergrad studentamp;uva_status[]
 =Undergrad student')

 I got this:

 test_dev.php/content/search/uva_status[]/Undergrad+student/
 amp;uva_status[]/Undergrad+student

 Clearly, that doesn't work.

 So if I need one variable to hold several values what I should I do?
 Is there a way to get a PHP array through an URL when using Symfony?
--~--~-~--~~~---~--~~
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 do I found our if anything has been added to a Criteria object? How do I find the length of the current query?

2009-08-31 Thread Jake Barnes


Untill we get Lucene working, I was going to write some simple code
that would allow very simple searches. So I tried this:


$this-listOfMembersWhoMeetSearchCriteria = array();
$c = new Criteria();

  $uvaStatusArray = $request-getParameter('uva_status');
  if (is_array($uvaStatusArray)) {
for ($i=0; $i  count($uvaStatusArray); $i++) {
  if ($i  0) {
$c-addOr(sfGuardUserProfilePeer::UVA_STATUS,
$uvaStatusArray[$i]);
  } else {
$c-add(sfGuardUserProfilePeer::UVA_STATUS, $uvaStatusArray
[$i]);
  }
}
  }

  $this-listOfMembersWhoMeetSearchCriteria =
sfGuardUserProfilePeer::doSelect($c);


This works well, except for when uva_status is empty. If uva_status is
empty, then the code arrives on the last line without any conditions
having been added to the Criteria object, so every row in the database
is returned. This is the opposite of what I want. Is there any way to
test and see whether conditions have been added to the Criteria
object?
--~--~-~--~~~---~--~~
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: symfony forms

2009-08-25 Thread Jake Barnes



On Aug 25, 9:27 pm, hcwang hcw...@gmail.com wrote:
 Simply for posterity and my own sanity I wanted to post a fix to a
 problem I had but couldn't find an answer for in all my searches.

 Basic stuff, I created a new form and placed it into sfproject/apps/
 frontend/lib/form but the damn thing wouldn't autoload.  Nothing in
 the help ilehttp://www.symfony-project.org/forms/1_2/en/01-Form-Creation
 explained what might be wrong.  The php error was PHP Fatal error:
 Class 'PopularForm' not found in...

 The fix is to run php symfony clear-cache which i guess forces a
 refreshed autoload.

 Hopefully this will help other newbies


That's true for anything that goes into the top level lib folder, too.
New helpers, new classes, new forms, etc. Always run clear cache
before trying to use them.

This should probably be given more emphasis in the documentation.



--~--~-~--~~~---~--~~
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: how do I lock down the sf_guard_user module?

2009-08-24 Thread Jake Barnes

Nevermind, I am an idiot. Forgot to add these to Subversion, so they
were not being deployed to the server.


On Aug 23, 10:54 pm, Jake Barnes lkrub...@geocities.com wrote:
 Hmm, created these:

 apps/test/modules/sfGuardUser/config/security.yml
 apps/test/modules/sfGuardGroup/config/security.yml
 apps/test/modules/sfGuardPermission/config/security.yml

 Then:

 symfony cc

 then I logged out, then I logged back in. The dummy account I'm using,
 which has no privileges (sf_guard_user_permission has a permission of
 2 for this user - normal), but I still manage to log in and edit user
 accounts at URLs like:

 index.php/sf_guard_user/3/edit.html

 On Aug 23, 11:15 am, Tom Boutell t...@punkave.com wrote:

  Jake Barnes says:

  I created a test user account with no privileges. I log in as this
  test user. I point my brownser here:
  test_dev.php/sf_guard_user
  I now see listed all of the users, and I can edit any of them. So I
  open:
  plugins/sfGuardPlugin/modules/sfGuardAuth/config/security.yml
  And I add in: ...

  Three things:

  1. Don't edit directly in a plugin folder unless you are the author.
  Your changes will get smooshed when you update the plugin. And you
  will update the plugin, because bugs and security holes are bound to
  be found over time in anything (not knocking sfGuard here, it's true
  for pretty much anything).

  Symfony provides for modules to be overridden at the application
  level. This is the correct way to change plugin behavior for your
  particular application.

  2. Look at that URL:

  test_dev.php/sf_guard_user

  sf_guard_user, not sf_guard_auth. You're locking down the wrong
  module. There are several modules in sfGuardPlugin.

  sfGuardAuth is the one you DON'T want to secure, because it is the one
  that allows you to log in.

  You want to lock down sfGuardUser, sfGuardGroup, and sfGuardPermission.

  Do it here:

  apps/frontend/modules/sfGuardUser/config/security.yml
  apps/frontend/modules/sfGuardGroup/config/security.yml
  apps/frontend/modules/sfGuardPermission/config/security.yml

  These can be really simple, as you noted:

  default:
    is_secure: on
    credentials: admin

  Then symfony cc and you're good to go.

  3. You might very reasonably ask why these modules are not secured by
  default. I'd like to know that too. As acceptance of Symfony grows,
  exploits for common holes like this will probably become common. I
  guess it might be a bit awkward to override if you wanted to set up
  security differently, but I'm pretty sure it's doable.

  In our own applications we never enable sfGuardUser, sfGuardGroup and
  sfGuardPermission. Since these are simple admin generator modules,
  we've copied them to pkToolkitPlugin, themed them and enabled security
  by default. For sfGuardGroup and sfGuardPermission we choose to
  require superadmin status, because the set of groups and permissions
  that are actually implemented in a project typically shouldn't be
  changed by our clients; these modules are used only in the event we
  make a design change. For sfGuardUser we remove the user-by-user
  setting of permissions, keeping only groups (guest, editor, admin) to
  simplify things for client admins.

  --
  Tom Boutell
  P'unk Avenue
  215 755 1330
  punkave.com
  window.punkave.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] shouldn't a lack of an id in a form get some kind of error?

2009-08-24 Thread Jake Barnes

Here I had a form that tested valid yet would not save to the
database. Doesn't that seem broken?

I was hand coding a form, so that the HTML/PHP in the template looked
(in part) like this:


div class=fieldgrp
label for=sf_guard_user_profile_school
School
/label
div class=field
?php echo $form['school']-renderError() ?
select id=UVA-status-registration 
class=longfield-select
name=sf_guard_user_profile[school]
option?php echo 
$form[school]-getValue() ?/option
optionArchitecture/option
optionArts nbsp; Sciences/option
optionBusiness (Darden MBA)/option
optionEngineering/option
optionLaw/option
optionMedicine/option
optionNursing (Curry)/option
/select
/div
/div
div class=fieldgrp
label for=sf_guard_user_profile_program
Major/Concentration
/label
div class=field
?php echo $form['program']-renderError() ?
?php echo $form['program'] ?
/div
/div


Finally, I tried to save the form, and I found that it would not save.
I got no errors. I switched over to the dev front controller in the
hopes that I would get an error, but no, I got no error.


My action looked like this:



  public function executeUpdateUser($request)
  {
if ($this-getUser()-getGuardUser())
{
  $this-form = new sfGuardUserProfileForm
(sfGuardUserProfilePeer::retrieveByPk($this-getUser()-getGuardUser()-
getProfile()-getId()));

  $submittedValuesArray = $request-getParameter
('sf_guard_user_profile');
  if (is_array($submittedValuesArray)) {
$submittedValuesArray[user_id] = $this-getUser()-
getGuardUser()-getId();

$this-form-bind($submittedValuesArray, $request-getFiles
('sf_guard_user_profile'));
if ($this-form-isValid())
{
  $userProfile = $this-form-save();
}
  }

  $this-getUser()-setFlash('profile_saved', 'Your info is
updated');
}
  }


After the form-save() line, I tried to echo out data from the saved
userProfile object:

echo $userProfile-getProgram();
die();

Sure enough, this showed the correct information on the screen.
Whatever I had just typed in as my program, that is what was now
stored in $userProfile.

After awhile of testing, I realized that I'd stupidly left out the id
of the profile. So, finally, I added this line:

$submittedValuesArray[id] = $this-getUser()-getGuardUser()-
getProfile()-getId();


And now the form saved!

My action now looked like this:



  public function executeUpdateUser($request)
  {
if ($this-getUser()-getGuardUser())
{
  $this-form = new sfGuardUserProfileForm
(sfGuardUserProfilePeer::retrieveByPk($this-getUser()-getGuardUser()-
getProfile()-getId()));

  $submittedValuesArray = $request-getParameter
('sf_guard_user_profile');
  if (is_array($submittedValuesArray)) {
$submittedValuesArray[id] = $this-getUser()-getGuardUser()-
getProfile()-getId();
$submittedValuesArray[user_id] = $this-getUser()-
getGuardUser()-getId();

$this-form-bind($submittedValuesArray, $request-getFiles
('sf_guard_user_profile'));
if ($this-form-isValid())
{
  $userProfile = $this-form-save();
}
  }

  $this-getUser()-setFlash('profile_saved', 'Your info is
updated');
}
  }


Then I thought, I guess all the times I tried to save before, without
an id, I was creating a new record in the database. But I looked in
the database, and there were no new records. So now I'm thinking that
id needs to be there in the array of submitted values, even if  it has
no value, it needs to be there before the form will save it to the
database. But if this is so, shouldn't there be some kind of error,
for those situations where there is no id?

Here I had a form that tested valid yet would not save to the
database. Doesn't that seem broken?





--~--~-~--~~~---~--~~
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: how do I lock down the sf_guard_user module?

2009-08-23 Thread Jake Barnes


Thanks much for your reply Tom. As always, you are very informative.


On Aug 23, 11:15 am, Tom Boutell t...@punkave.com wrote:
 Jake Barnes says:

 I created a test user account with no privileges. I log in as this
 test user. I point my brownser here:
 test_dev.php/sf_guard_user
 I now see listed all of the users, and I can edit any of them. So I
 open:
 plugins/sfGuardPlugin/modules/sfGuardAuth/config/security.yml
 And I add in: ...

 Three things:

 1. Don't edit directly in a plugin folder unless you are the author.
 Your changes will get smooshed when you update the plugin. And you
 will update the plugin, because bugs and security holes are bound to
 be found over time in anything (not knocking sfGuard here, it's true
 for pretty much anything).

 Symfony provides for modules to be overridden at the application
 level. This is the correct way to change plugin behavior for your
 particular application.

 2. Look at that URL:

 test_dev.php/sf_guard_user

 sf_guard_user, not sf_guard_auth. You're locking down the wrong
 module. There are several modules in sfGuardPlugin.

 sfGuardAuth is the one you DON'T want to secure, because it is the one
 that allows you to log in.

 You want to lock down sfGuardUser, sfGuardGroup, and sfGuardPermission.

 Do it here:

 apps/frontend/modules/sfGuardUser/config/security.yml
 apps/frontend/modules/sfGuardGroup/config/security.yml
 apps/frontend/modules/sfGuardPermission/config/security.yml

 These can be really simple, as you noted:

 default:
   is_secure: on
   credentials: admin

 Then symfony cc and you're good to go.

 3. You might very reasonably ask why these modules are not secured by
 default. I'd like to know that too. As acceptance of Symfony grows,
 exploits for common holes like this will probably become common. I
 guess it might be a bit awkward to override if you wanted to set up
 security differently, but I'm pretty sure it's doable.

 In our own applications we never enable sfGuardUser, sfGuardGroup and
 sfGuardPermission. Since these are simple admin generator modules,
 we've copied them to pkToolkitPlugin, themed them and enabled security
 by default. For sfGuardGroup and sfGuardPermission we choose to
 require superadmin status, because the set of groups and permissions
 that are actually implemented in a project typically shouldn't be
 changed by our clients; these modules are used only in the event we
 make a design change. For sfGuardUser we remove the user-by-user
 setting of permissions, keeping only groups (guest, editor, admin) to
 simplify things for client admins.

 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.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: how do I lock down the sf_guard_user module?

2009-08-23 Thread Jake Barnes

Hmm, created these:

apps/test/modules/sfGuardUser/config/security.yml
apps/test/modules/sfGuardGroup/config/security.yml
apps/test/modules/sfGuardPermission/config/security.yml

Then:

symfony cc

then I logged out, then I logged back in. The dummy account I'm using,
which has no privileges (sf_guard_user_permission has a permission of
2 for this user - normal), but I still manage to log in and edit user
accounts at URLs like:

index.php/sf_guard_user/3/edit.html






On Aug 23, 11:15 am, Tom Boutell t...@punkave.com wrote:
 Jake Barnes says:

 I created a test user account with no privileges. I log in as this
 test user. I point my brownser here:
 test_dev.php/sf_guard_user
 I now see listed all of the users, and I can edit any of them. So I
 open:
 plugins/sfGuardPlugin/modules/sfGuardAuth/config/security.yml
 And I add in: ...

 Three things:

 1. Don't edit directly in a plugin folder unless you are the author.
 Your changes will get smooshed when you update the plugin. And you
 will update the plugin, because bugs and security holes are bound to
 be found over time in anything (not knocking sfGuard here, it's true
 for pretty much anything).

 Symfony provides for modules to be overridden at the application
 level. This is the correct way to change plugin behavior for your
 particular application.

 2. Look at that URL:

 test_dev.php/sf_guard_user

 sf_guard_user, not sf_guard_auth. You're locking down the wrong
 module. There are several modules in sfGuardPlugin.

 sfGuardAuth is the one you DON'T want to secure, because it is the one
 that allows you to log in.

 You want to lock down sfGuardUser, sfGuardGroup, and sfGuardPermission.

 Do it here:

 apps/frontend/modules/sfGuardUser/config/security.yml
 apps/frontend/modules/sfGuardGroup/config/security.yml
 apps/frontend/modules/sfGuardPermission/config/security.yml

 These can be really simple, as you noted:

 default:
   is_secure: on
   credentials: admin

 Then symfony cc and you're good to go.

 3. You might very reasonably ask why these modules are not secured by
 default. I'd like to know that too. As acceptance of Symfony grows,
 exploits for common holes like this will probably become common. I
 guess it might be a bit awkward to override if you wanted to set up
 security differently, but I'm pretty sure it's doable.

 In our own applications we never enable sfGuardUser, sfGuardGroup and
 sfGuardPermission. Since these are simple admin generator modules,
 we've copied them to pkToolkitPlugin, themed them and enabled security
 by default. For sfGuardGroup and sfGuardPermission we choose to
 require superadmin status, because the set of groups and permissions
 that are actually implemented in a project typically shouldn't be
 changed by our clients; these modules are used only in the event we
 make a design change. For sfGuardUser we remove the user-by-user
 setting of permissions, keeping only groups (guest, editor, admin) to
 simplify things for client admins.

 --
 Tom Boutell
 P'unk Avenue
 215 755 1330
 punkave.com
 window.punkave.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: frontend and backend

2009-07-26 Thread Jake Barnes



On Jul 24, 11:18 am, juaninf juan...@gmail.com wrote:
 Hi everyone..

 Please i want to know when put modules within on the backend or within
 frontend,
 for example. If I have a user module this have that stay in frontend
 or both? or that criteria
 I have that do.


The first 2 sites I did, I only had one app. The dashboard for the
admins was just a module in that.

I'm not sure that you really need 2 apps, but, basically, the main
difference would be that with frontend you assume that everything is
public, till you lock it down, and with backend you assume that
everything is secure, unless you unlock it. And when I write you
assume, I'm actually talking about what settings you've put in the
apps security.yml.
--~--~-~--~~~---~--~~
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: why do the objects take so long to dump to screen?

2009-07-26 Thread Jake Barnes



On Jul 26, 7:19 am, Bernhard Schussek bschus...@gmail.com wrote:
 Hi Lawrence

 I suppose you are using Doctrine. The problem with dumping Doctrine
 records is that they contains cyclic references. That means, a record
 references a table, which references the record, which references the
 table ... you get the drill.

 If you try to dump this record, PHP tries to follow all these
 references and literally goes on forever. Your error schema probably
 contains a reference to such a Doctrine record (or any other object
 with cyclic references) and thus is affected by this problem.

 The solution is quite easy though, in your case: Use sfErrorSchema's
 __toString() function:

 print $form-getErrorSchema();

 (Note that I'm not using print_r() or var_dump(), because these don't
 implicitly convert the object to a string)


Thanks much for this, that is a hot tip. I was, in fact, using Propel,
but I'm sure the same thing is true. I had the impression that I was
dealing with an infinite loop, but I was having trouble imagining how
print_r() could trigger an infinite loop. Your explanation makes a lot
of sense.







--~--~-~--~~~---~--~~
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: Possible bug in Propel 1.3

2009-07-24 Thread Jake Barnes

It seems to me the mistake is yours. If it is perfectly legal for no
SubscriberUnitCoordinate to exist then you can not define a foreign
key involving it. Defining a foreign key makes it required, even if
you set required to false in your schema.yml.


On Jul 16, 2:52 pm, Trevor Lanyon trevor.lan...@lanyonconsulting.com
wrote:
 Hi,

 symfony propel:build-model builds this

 BaseSubscriberUnit.php:

 public function getSubscriberUnitCoordinate(PropelPDO $con = null)
 {
     if ($this-aSubscriberUnitCoordinate === null 
         (($this-mac !==   $this-mac !== null)           
          ($this-basestation_id !==  
           $this-basestation_id !== null))) {
         $c = new Criteria(SubscriberUnitCoordinatePeer::DATABASE_NAME);
         $c-add(SubscriberUnitCoordinatePeer::SUBSCRIBER_UNIT_MAC,
 $this-mac);
         $c-add(SubscriberUnitCoordinatePeer::BASESTATION_ID,
 $this-basestation_id);
         $this-aSubscriberUnitCoordinate =
 SubscriberUnitCoordinatePeer::doSelectOne($c, $con);
          // Because this foreign key represents a one-to-one
 relationship, we will create a bi-directional association.
         $this-aSubscriberUnitCoordinate-setSubscriberUnit($this);
      }
      return $this-aSubscriberUnitCoordinate;
  }

 The problem is that it is perfectly legal for no
 SubscriberUnitCoordinate to exist and the program fails when it tries to
 assign any properties to an object that doesn't exist (ie: on this line
 '        $this-aSubscriberUnitCoordinate-setSubscriberUnit($this);').

 Is this a(nother) bug in propel?  Is there a work around?  Outside of
 either overriding the method in an inherited class or editing the basic
 class EVERYTIME I regenerate the model???

 Did I define my relationships  wrong?  Here's what my schema includes:

  table name=basestation phpName=Basestation
    column name=id type=BIGINT size=8 scale=0 primaryKey=true
 required=true/
    index name=PK_basestation
      index-column name=id/
    /index
  /table

    table name=subscriber_unit phpName=SubscriberUnit
      column name=basestation_id type=BIGINT size=8 scale=0
 primaryKey=true required=true/
      column name=mac type=VARCHAR size=32 primaryKey=true
 required=true/
      column name=access_unit_slot type=INTEGER size=4 scale=0
 required=true defaultValue=((0))/
      foreign-key foreignTable=basestation
 name=FK_subscriber_unit_basestation
        reference local=basestation_id foreign=id/
      /foreign-key
      foreign-key foreignTable=access_unit
 name=FK_subscriber_unit_access_unit
        reference local=basestation_id foreign=basestation_id/
        reference local=access_unit_slot foreign=slot/
      /foreign-key
      foreign-key foreignTable=subscriber_unit_coordinate
 name=FK_subscriber_unit_subscriber_unit_coordinate
        reference local=mac foreign=subscriber_unit_mac/
        reference local=basestation_id foreign=basestation_id/
      /foreign-key
    /table

    table name=subscriber_unit_coordinate
 phpName=SubscriberUnitCoordinate
      column name=basestation_id type=BIGINT size=8 scale=0
 primaryKey=true required=true/
      column name=subscriber_unit_mac type=VARCHAR size=32
 primaryKey=true required=true/
      foreign-key foreignTable=basestation
 name=FK_subscriber_unit_coordinate_basestation
        reference local=basestation_id foreign=id/
      /foreign-key
    /table
--~--~-~--~~~---~--~~
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: where does symfony hard-code paths?

2009-06-16 Thread Jake Barnes

Weird. Today the problem has returned. Yet if I look for 'bp2':

grep -R bp2 *

All I get is what is left over from when the files were auto-generated
at the original site:

apps/frontend/modules/authority_status/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/payment_type/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/category/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/contact/actions/actions.class.php: * @package
bp2
apps/frontend/modules/authority/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/prize_type/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/user/actions/actions.class.php: * @package
bp2
apps/frontend/modules/wait_list/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/priority/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/question_status/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/authority_type/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/page/actions/actions.class.php: * @package
bp2
apps/frontend/modules/payment_status/actions/actions.class.php: *
@packagebp2
apps/frontend/modules/email/actions/actions.class.php: * @package
bp2
apps/frontend/modules/question/actions/actions.class.php: *
@packagebp2
apps/backend/modules/category/actions/actions.class.php: * @package
bp2
apps/backend/modules/dashboard/actions/actions.class.php: *
@packagebp2
apps/backend/modules/category-bak/actions/actions.class.php: *
@packagebp2
apps/backend/modules/sf_guard_user/actions/actions.class.php: *
@packagebp2
apps/backend/modules/sf_guard_user/lib/
sf_guard_userGeneratorConfiguration.class.php: * @packagebp2
apps/backend/modules/sf_guard_user/lib/
sf_guard_userGeneratorHelper.class.php: * @packagebp2
apps/backend/modules/page/actions/actions.class.php: * @packagebp2


but if I switch over to this path:

/home/mypail/home/sfprojects/betatest/

and try this:

symfony cc

I once again get this:

Fatal error: Cannot redeclare class ProjectConfiguration in /home/
mypail/home/sfprojects/bp2/config/ProjectConfiguration.class.php on
line 28

So somewhere, somehow, the symfony commands are hardcoded to the old
path. But I can not find where that hard-coding is.

Any thoughts?





On Jun 15, 3:53 am, Lawrence lkrub...@geocities.com wrote:
 This was a surprising problem. I suppose it shows how poorly I
 understand Symfony.

 We were doing development on our server at this path:

 /home/mypail/home/sfprojects/bp2/

 On the server, in the directory that is available on the web, we
 created an alias so that the above path could be reached at an url
 like:

 http://www.domain.com/v1/

 After 2 months of hard-work, it was time to let some people test the
 site. Of course, we didn't want beta-testers looking at a site that
 the programmers were working on, since there was always the chance of
 some transitory bug arising during work. So I created a new directory,
 and then I copied everything over:

 cp -r /home/mypail/home/sfprojects/bp2/* /home/mypail/home/sfprojects/
 betatest/

 Then I created an alias so that our beta testers could see this site
 by pointing their browsers here:

 http://www.domain.com/v1/

 But when I ssh'ed to the server and cd'ed to here:

 /home/mypail/home/sfprojects/betatest/

 Every command I entered went back to the other, earlier path. For
 instance, if I went here:

 /home/mypail/home/sfprojects/betatest/

 and did this:

 # symfony cc

 then I got this error:

 Fatal error: Cannot redeclare class ProjectConfiguration in /home/
 mypail/home/sfprojects/bp2/config/ProjectConfiguration.class.php on
 line 28

 That is the path of the other site.

 I did all the obvious things:

 1.) I deleted everything in the cache folder.

 2.) I chased down every reference to the first site in the config
 files:

 grep bp2 config/*

 I looked in the symfony file itself, but I didn't see anything
 hardcoded there, other than the shebang line.

 Still the problem persisted.

 Finally, I tracked down, and changed, every single instance of bp2:

 grep -R bp2 *

 I deleted everything in the log folder, I deleted an error_log file
 that someone had started in the web directory. I deleted a backup of
 the database that had bp2 in it.

 None of these files struck me as important, but once I had deleted or
 changed every single instance of 'bp2', the symfony cc command began
 to work again.

 But where was the reference to the other path? It wasn't in the cache
 and it wasn't in any of the config files, because I took care of those
 early on. So where was it? Where else would Symfony store a hard-coded
 path?
--~--~-~--~~~---~--~~
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] Re: where does symfony hard-code paths?

2009-06-15 Thread Jake Barnes



On Jun 15, 4:31 am, alvaro harryjek...@gmail.com wrote:
 Depends on the version of symfony you are using.

 Check on the config.php files or in the ProjectConfiguration
 ones.  
 There should be the path to the symfony libraries.


As I said before, those were the first files that I checked.


















  This was a surprising problem. I suppose it shows how poorly I
  understand Symfony.

  We were doing development on our server at this path:

  /home/mypail/home/sfprojects/bw2/

  On the server, in the directory that is available on the web, we
  created an alias so that the above path could be reached at an url
  like:

 http://www.domain.com/v1/

  After 2 months of hard-work, it was time to let some people test the
  site. Of course, we didn't want beta-testers looking at a site that
  the programmers were working on, since there was always the chance of
  some transitory bug arising during work. So I created a new directory,
  and then I copied everything over:

  cp -r /home/mypail/home/sfprojects/bp2/* /home/mypail/home/sfprojects/
  betatest/

  Then I created an alias so that our beta testers could see this site
  by pointing their browsers here:

 http://www.domain.com/v1/

  But when I ssh'ed to the server and cd'ed to here:

  /home/mypail/home/sfprojects/betatest/

  Every command I entered went back to the other, earlier path. For
  instance, if I went here:

  /home/mypail/home/sfprojects/betatest/

  and did this:

  # symfony cc

  then I got this error:

  Fatal error: Cannot redeclare class ProjectConfiguration in /home/
  mypail/home/sfprojects/bp2/config/ProjectConfiguration.class.php on
  line 28

  That is the path of the other site.

  I did all the obvious things:

  1.) I deleted everything in the cache folder.

  2.) I chased down every reference to the first site in the config
  files:

  grep bp2 config/*

  I looked in the symfony file itself, but I didn't see anything
  hardcoded there, other than the shebang line.

  Still the problem persisted.

  Finally, I tracked down, and changed, every single instance of bp2:

  grep -R bp2 *

  I deleted everything in the log folder, I deleted an error_log file
  that someone had started in the web directory. I deleted a backup of
  the database that had bp2 in it.

  None of these files struck me as important, but once I had deleted or
  changed every single instance of 'bp2', the symfony cc command began
  to work again.

  But where was the reference to the other path? It wasn't in the cache
  and it wasn't in any of the config files, because I took care of those
  early on. So where was it? Where else would Symfony store a hard-coded
  path?
--~--~-~--~~~---~--~~
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: where does symfony hard-code paths?

2009-06-15 Thread Jake Barnes



On Jun 15, 9:38 am, Eno symb...@gmail.com wrote:
 On Mon, 15 Jun 2009, Lawrence wrote:
  This was a surprising problem. I suppose it shows how poorly I
  understand Symfony.

 Yes, probably.

 http://www.symfony-project.org/book/1_2/19-Mastering-
 Symfony-s-Config...


You are sending me to a URL that has no relevance to what I wrote. Did
you mean to post this in a different thread?









--~--~-~--~~~---~--~~
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] need advice: am switching from a Linux to a Windows development environment

2009-05-06 Thread Jake Barnes

I just searched the archives and was surprised not to see this issue
come up more often.

I have, till now, done all my development work on Linux. I typically
install symfony using pear. I'm used to the core files being stored
here:

/usr/share/php/symfony

Now, for a month, I'm switching to a laptop running Windows XP. I've
got the WampServer installed and PHP running.

I'm curious, though, where do people put the core Symfony files on a
Windows machine?
--~--~-~--~~~---~--~~
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: Jobeet: Doctrine: Day 5 -- Problem with Apache rewrite on Vista

2009-05-06 Thread Jake Barnes



On Apr 1, 5:09 pm, Emily Berk em...@armadillosoft.com wrote:
 When I put in the changes listed in the day 5 tutorial, the following
 URL 
 works:http://localhost:8080/frontend_dev.php/job/sensio-labs/paris-france/1...

 But THIS URL does NOT work: (gives 
 404)http://localhost:8080/index.php/job/sensio-labs/paris-france/1/web-de...

 (Only difference is the index.php vs. frontend_dev.php)

 http://localhost:8080/index.php/jobworks fine.

  From the Apache rewrite log, it looks like the rewrite rules are
 giving me a url of
 job/sensio-labs/paris-france/1/web-developer.html/sensio-labs/paris-france/1/web-developer
 which doesn't match my route ...


I'm curious if you found out the problem? In my experience, when an
URL works through the dev controller, but not the prod controller, the
problem is with the cache, and php symfony cc usually fixes it.

Did it turn out, in your case, that there was some other problem?




--~--~-~--~~~---~--~~
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] Is this documentation still correct? Form input_tag() in Symfony 1.2?

2009-05-06 Thread Jake Barnes

I'm curious about the documentation on this page:

http://www.symfony-project.org/book/1_2/11-Ajax-Integration

The URL says this is the 1.2 version of the book.  Yet I see this:

Listing 11-11 - Ajax Form with the form_remote_tag() Helper

div id=item_list/div
?php echo form_remote_tag(array(
'update'   = 'item_list',
'url'  = 'item/add',
)) ?
  label for=itemItem:/label
  ?php echo input_tag('item') ?
  ?php echo submit_tag('Add') ?
/form


Isn't stuff like input_tag() from the 1.0 version of Symfony?
--~--~-~--~~~---~--~~
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: need advice: am switching from a Linux to a Windows development environment

2009-05-06 Thread Jake Barnes



On May 6, 9:23 pm, Pablo Godel pgo...@gmail.com wrote:
 Have you considered running linux on vmware or virtual box?

Yes, but I've read that is very slow?

My preference would be to blank the harddrive and install Ubuntu on
the laptop, but the laptop isn't mine, it is a company loan.






 On Wed, May 6, 2009 at 9:18 PM, Jake Barnes lkrub...@geocities.com wrote:

  I just searched the archives and was surprised not to see this issue
  come up more often.

  I have, till now, done all my development work on Linux. I typically
  install symfony using pear. I'm used to the core files being stored
  here:

  /usr/share/php/symfony

  Now, for a month, I'm switching to a laptop running Windows XP. I've
  got the WampServer installed and PHP running.

  I'm curious, though, where do people put the core Symfony files on a
  Windows machine?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---