[symfony-users] Re: Free opensource Symfony-friendly PHP IDE: NetBeans 6.8

2010-01-07 Thread Crafty_Shadow
I have been using NuSphere's PhpED for the past six months. It is not
free (though a trail version is available), however it is better than
Eclipse/Netbeans by leaps and bounds. If feels much more coherent,
there is no excessive overfunctionality. Writing macros for symfony is
a piece of cake, there is a GREAT debugger, and last but not least -
it is goddamn fast. Unlike what most IDEs seem to be going for right
now (Java), PhpED is written in C++. The one downside I guess would be
the fact that its only available for Windows (well, that and the quite
hefty price tag, but you really do get what you pay for).

On Jan 7, 2:32 pm, pghoratiu pghora...@gmail.com wrote:
 I converted to Netbeans 6.8 from the latest Eclipse version,
 personally I had problems with
 Eclipse unreliable code completion and high resource usage (both cpu
 and memory).
 Unfortunately not everything is perfect with Netbeans, I experienced
 also the high CPU usage lockup
 (i suspect it has something to do with code completion that fails and
 goes into an infinite loop).

 So if there are better IDE's than these I'm looking forward :)

 For anyone using Java based editors my suggestion is to use the Sun
 JRE (for both Eclipse and Netbeans)
 the one that comes bundled with a Linux distributions may not work as
 well.

     gabriel

 On Jan 7, 12:55 pm, Christopher Schnell ty...@mda.ch wrote:

  I use Eclipse, too, but would like to use Netbeans. I can't because
  since updateing to Fedora 12, it freezes radomly and crashes my entire
  system. And I can't use another Distribution because Fedora is the only,
  I know of that supports my 2 monitors.

  Netbeans has better code-completion with static functions which is great
  when using Propel.

  Regards,
  Christopher.

  Gareth McCumskey schrieb:

   Personally I use Eclipse and struggle to do without the features this IDE 
   gives me. Never used Netbeans but may give it a go, because I like the 
   idea of having symfony support builtin

   - Original Message -
   From: Christopher Schnell ty...@mda.ch
   To: symfony-users@googlegroups.com
   Sent: Thursday, January 7, 2010 10:44:13 AM GMT +02:00 Harare / Pretoria
   Subject: Re: [symfony-users] Free opensource Symfony-friendly PHP IDE:  
   NetBeans 6.8

   There is also a video tutorial at

  http://netbeans.org/kb/docs/php/symfony-screencast.html

   Regards,
   Christopher.

   P.S. I still can't believe there are so many of you NOT working with a
   decent IDE like Eclipse or Netbeans.

   FractalizeR schrieb:

   NetBeans 6.8 has built-in Symfony support. I have composed small blog-
   post about setting up symfony project in NetBeans:

  http://www.fractalizer.ru/frpost_393/free-opensource-symfony-friendly...

   I consider now NetBeans as a replacement for Zend Studio ;)


-- 
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: plugin:install not working for 1.3/1.4?

2009-12-20 Thread Crafty_Shadow
You really don't read very carefully, do you? :)

The plugin:install task is supposed to download the dependencies as
well, streamlining the process of installing a plugin. Dependencies
currently DO NOT WORK.

On Dec 20, 1:08 pm, Alexandre Salomé alexandre.sal...@gmail.com
wrote:
 Another solution is to download manually sourcecode, because PEAR doesn't do
 much more stuff (in my opinion).

 2009/12/20 Crafty_Shadow vankat...@gmail.com



  Alexandre Salomé wrote:
   You should use SVN to manage your development and define your plugins as
  svn
   externals.

  While I agree with you that this is the best way to manage plugins, it
  is not the default one. New users are not advised to do that, instead
  they are told that the symfony plugins system is there to ease their
  development. As far as I can see, this is a bug in the symfony plguins
  system, and a pretty serious one at that - what's the point of
  dependencies if they make your plugin impossible to install
  automatically?

  On Dec 20, 12:06 am, Alexandre Salomé alexandre.sal...@gmail.com
  wrote:
   You should use SVN to manage your development and define your plugins as
  svn
   externals.

   2009/12/18 Kevin kevinb...@gmail.com

I should have clarified, all these plugins I am trying to install are
compatible with 1.3.

On Dec 18, 9:24 am, Stéphane stephane.er...@gmail.com wrote:
 There are plugins not yet ready for sf1.3/1.4.

 You must install them manually and check their code by using symfony
 project:validate (to see used deprecated stuff).

 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!

 On Fri, Dec 18, 2009 at 3:22 PM, Kevin kevinb...@gmail.com wrote:
  I seem to be having trouble installing plugins through the
  plugin:install command in sf1.3/4.

  In a new project I run symfony plugin:install sfDoctrineGuardPlugin
  I
  get:

  Unable to get plugin licence information for plugin
  sfDoctrineGuardPlugin: Unknown package: sfDoctrineGuardPlugin
  in
  channel 

  Debug: File

 http://plugins.symfony-project.org:80/REST/p/sfdoctrineguardplugin/in.
..
  not valid
  (received: HTTP/1.0 404 No version available with the installed
  symfony version) (use --force-license to force installation)

  when I add --force-license I get:

  Unable to get download information for plugin
  sfDoctrineGuardPlugin |
  4.0.1 | stable: Package sfDoctrineGuardPlugin does not have REST
  info xml available

  I get the problem with other plugins, sfFormExtraPlugin for
  example.

  When I try to install my own plugin, sfAdminDashPlugin (using:
  symfony
  plugin:install -s beta --install_deps sfAdminDashPlugin), which
  requires sfJqueryReloadedPlugin as a dependency,
  sfJqueryReloadedPlugin installs fine but I get this error for
  sfAdminDashPlugin:

  Plugin sfAdminDashPlugin installation failed: Download failed

  Anyone have any ideas? Something I am missing?

  --

  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.comsymfony-users%2bunsubscr...@googlegroups.com
  symfony-users%2bunsubscr...@googlegroups.comsymfony-users%252bunsubscr...@googlegroups.com

symfony-users%2bunsubscr...@googlegroups.comsymfony-users%252bunsubscr...@googlegroups.com
  symfony-users%252bunsubscr...@googlegroups.comsymfony-users%25252bunsubscr...@googlegroups.com

  .
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.

--

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.comsymfony-users%2bunsubscr...@googlegroups.com
  symfony-users%2bunsubscr...@googlegroups.comsymfony-users%252bunsubscr...@googlegroups.com

.
For more options, visit this group at
   http://groups.google.com/group/symfony-users?hl=en.

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

  --

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

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

--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email

[symfony-users] Failing tests in symfony:test

2009-12-07 Thread Crafty_Shadow
This was run in windows, php 5.2.9-2 with symfony checked out from SVN
(rev 25046)

Result:
Failed Test Stat  Total   Fail  List of Failed
--
 functional/ActionRedirectTest   255  1  1  0
trine] functional/AdminGenTest   255  1  1  0
unctional/EnvironmentSetupTest   255  1  1  0
] functional/FormGeneratorTest   255  1  1  0
fDoctrine] functional/FormTest   255  1  1  0
fDoctrine] functional/I18nTest   255  1  1  0
Doctrine] functional/PagerTest   255  1  1  0
Doctrine] functional/RouteTest   255  1  1  0
ne] functional/Ticket/5269Test   255  1  1  0
ne] functional/Ticket/7774Test   255  1  1  0
octrine] functional/UniqueTest   255  1  1  0
octrine] functional/UploadTest   255  1  1  0
unctional/sfDoctrineRecordTest   255  1  1  0
] unit/form/sfFormDoctrineTest   255  1  1  0
/form/sfFormFilterDoctrineTest   255  1  1  0
unit/pager/sfDoctrinePagerTest   255  1  1  0
it/record/sfDoctrineRecordTest   255  1  1  0
functional/cacheTest   0  1  1  0
elper/JavascriptBaseHelperTest 0  9  1  7
unit/log/sfFileLoggerTest  0  7  4  4 5 6 7
unit/task/sfBaseTaskTest   0  7  2  4 5
/validator/sfValidatorFileTest 0 65  7  8 10 11 19 52 57
59
Failed 22/226 test scripts, 90.27% okay. 32/7038 subtests failed,
99.55% okay.

Can anyone else confirm 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: Failing tests in symfony:test

2009-12-07 Thread Crafty_Shadow
Well, mine too was sf 1.4 checked out from SVN (same as lking). This
may be a windows specific issue that causes the tests to fail

On Dec 8, 5:16 am, lking zgonia...@gmail.com wrote:
 on win xp. PHP 5.2.11 with sf1.4 rev 25061

 Failed Test                     Stat  Total   Fail  List of Failed
 --
  functional/ActionRedirectTest     0      1      1  0
 trine] functional/AdminGenTest     0      1      1  0
 unctional/EnvironmentSetupTest     0      1      1  0
 ] functional/FormGeneratorTest     0      1      1  0
 fDoctrine] functional/FormTest     0      1      1  0
 fDoctrine] functional/I18nTest     0      1      1  0
 Doctrine] functional/PagerTest     0      1      1  0
 Doctrine] functional/RouteTest     0      1      1  0
 ne] functional/Ticket/5269Test     0      1      1  0
 ne] functional/Ticket/7774Test     0      1      1  0
 octrine] functional/UniqueTest     0      1      1  0
 octrine] functional/UploadTest     0      1      1  0
 unctional/sfDoctrineRecordTest     0      1      1  0
 ] unit/form/sfFormDoctrineTest     0      1      1  0
 /form/sfFormFilterDoctrineTest     0      1      1  0
 unit/pager/sfDoctrinePagerTest     0      1      1  0
 it/record/sfDoctrineRecordTest     0      1      1  0
 el] functional/crud/crud10Test     0      1      1  0
 pel] functional/crud/crud2Test     0      1      1  0
 pel] functional/crud/crud3Test     0      1      1  0
 pel] functional/crud/crud6Test     0      1      1  0
 pel] functional/crud/crud7Test     0      1      1  0
 pel] functional/crud/crud9Test     0      1      1  0
 pel] functional/crud/rest1Test     0      1      1  0
 pel] functional/crud/rest2Test     0      1      1  0
 [sfPropel] functional/formTest     0      1      1  0
 [sfPropel] functional/i18nTest     0      1      1  0
 sfPropel] functional/pagerTest     0      1      1  0
 Propel] functional/poolingTest     0      1      1  0
 elper/JavascriptBaseHelperTest     0      9      1  7
 unit/log/sfFileLoggerTest          0      7      4  4 5 6 7
 unit/task/sfBaseTaskTest           0      7      2  4 5
 /validator/sfValidatorFileTest     0     65      7  8 10 11 19 52 57
 59
 Failed 33/226 test scripts, 85.40% okay. 43/6237 subtests failed,
 99.31% okay.

 On 8 дек, 00:57, Daniel Lohse annismcken...@googlemail.com wrote:

  Mhm, I have another story to tell.

  Mac OS X 10.6.2, PHP 5.2.6 with symfony 1.4 stable tag

  All tests successful; 225 files; 8187 tests.

  Daniel

  On 2009-12-07, at 7/December, 11:51 PM, Crafty_Shadow wrote:

   This was run in windows, php 5.2.9-2 with symfony checked out from SVN
   (rev 25046)

   Result:
   Failed Test                     Stat  Total   Fail  List of Failed
   --
   functional/ActionRedirectTest   255      1      1  0
   trine] functional/AdminGenTest   255      1      1  0
   unctional/EnvironmentSetupTest   255      1      1  0
   ] functional/FormGeneratorTest   255      1      1  0
   fDoctrine] functional/FormTest   255      1      1  0
   fDoctrine] functional/I18nTest   255      1      1  0
   Doctrine] functional/PagerTest   255      1      1  0
   Doctrine] functional/RouteTest   255      1      1  0
   ne] functional/Ticket/5269Test   255      1      1  0
   ne] functional/Ticket/7774Test   255      1      1  0
   octrine] functional/UniqueTest   255      1      1  0
   octrine] functional/UploadTest   255      1      1  0
   unctional/sfDoctrineRecordTest   255      1      1  0
   ] unit/form/sfFormDoctrineTest   255      1      1  0
   /form/sfFormFilterDoctrineTest   255      1      1  0
   unit/pager/sfDoctrinePagerTest   255      1      1  0
   it/record/sfDoctrineRecordTest   255      1      1  0
   functional/cacheTest               0      1      1  0
   elper/JavascriptBaseHelperTest     0      9      1  7
   unit/log/sfFileLoggerTest          0      7      4  4 5 6 7
   unit/task/sfBaseTaskTest           0      7      2  4 5
   /validator/sfValidatorFileTest     0     65      7  8 10 11 19 52 57
   59
   Failed 22/226 test scripts, 90.27% okay. 32/7038 subtests failed,
   99.55% okay.

   Can anyone else confirm 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 
   athttp://groups.google.com/group/symfony-users?hl=en.



--

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: How to select thumbnail of sfAssetLibraryPlugin from tinyMCE ?

2009-11-08 Thread Crafty_Shadow

There is no straightforward way to do that, the only thing I can think
of is modify sfAssetPlugin's image browser for tiny to include an
extra button for every image that would return the path to the
thumbnail. It shouldn't be more than a few lines of html/js

On Nov 7, 11:32 am, Sid Bachtiar sid.bacht...@gmail.com wrote:
 Hi all,

 I've got sfAssetLibraryPlugin working with tinyMCE, all good. But I
 can't figure out how one is supposed to be able to select the
 thumbnail when browsing from tinyMCE. I seem to only be able to insert
 the original image uploaded instead of the thumbnail. Any idea?

 --
 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: Out of memory everywhere /slow page response

2009-10-01 Thread Crafty_Shadow

I'm sorry, but I just couldn't let this go:

 Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
 allocate 83 bytes) in /var/www/1.2/lib/config/
 sfAutoloadConfigHandler.class.php on line 115

 ...quadcore x3360, x64bit linux, 8gb ram, 1333fsb, 1 rpm
 disks, 512 mb for php max mem, apache2, mysql  tuned but page response
 is slow due to sf, cant get this down...

This is not 512mb for php max mem, it's 32mb; You probably have
different php.ini for apache/cli; A similar mishap may explain your
other memory errors, and it is quite astounding you didn't read the
simple error message and infer the problem.

As others said, simfony is always slow in DEV mode. It is meant to be
that way, for you know... development? All configuration files with
the exception of the sfAutoloadCache are parsed from yaml to php
arrays with every request, there is full logging, the dev bar itself
is executed and so on.

You can read some general tips on optimization in the symfony book,
chapter 18 I think.

Also, check out symfony 1.3 - 
http://www.symfony-project.org/blog/2009/09/26/hey-look-symfony-1-3-alpha1
It is very close to release and offers even better performance than
1.2

There are case studies, google for either yahoo or dailymotion.


Best of luck on your project

On Oct 1, 9:44 am, Gareth McCumskey gmccums...@gmail.com wrote:
 We in fact have a site that has over 1000 users and processes millions of
 database records daily with no major memory issues.

 @OP: You mentioned that caching was turned off during your test. Well, I
 hate to break it to you, but the cache is there for a reason. The memory
 consumption is very large with no cache as it now needs to build every
 config file, reference every class for its class autoloading mechanism and a
 lot of other tasks in order to run properly. Caching puts all that
 information into a low memory format that is quickly loaded each time.

 As has been mentioned, development environment is even more memory hungry
 because of the fact that the dev environment builds and stores cache (no
 caching in dev), stores all variables and generates logs, all of which is
 not present in the production environment.

 Lastly, APC cache (or another similar caching package) is a must, even, in
 my opinion, for a non-symfony application, as this will cache commonly
 accessed items into memory far more efficiently than symfony does.

 Rather learn more about the framework instead of a 10 minute exploration and
 then deem it crappy. There is a lot more behind the scenes that you are
 totally missing.



 On Wed, Sep 30, 2009 at 3:41 PM, Eno symb...@gmail.com wrote:

  On Tue, 29 Sep 2009, alexp wrote:

   I dont want to be -ve but just exploring this f/w for testing it out
   but getting a decent test case running is taking more than enough
   time.

  It takes time to learn symfony well enough to set it up right. There are
  people here running big sites using symfony that don't have the problems
  you're seeing.

  --

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

2009-09-09 Thread Crafty_Shadow

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: Primary Key Forgery Attack?

2009-09-03 Thread Crafty_Shadow

Would you share your solution?
I would suspect one way to go about doing it is keeping the current ID
in the session (as a flash variable) and comparing it upon post.

On Sep 2, 7:03 pm, Jeremy Thomerson jeremythomer...@gmail.com wrote:
 Yeah - but it's better to have both kinds of security.  The validation that
 the same ID is coming back in is simple and can be generically added to all
 Propel forms from a single place.  That makes securing it with business
 logic easier, because you don't have to worry about invalid IDs.  I
 implemented the ID forge protection in my BasePropelForm last night and it
 works great, so now I have both that and the security of verifying that the
 record being edited is allowed to be edited by the authenticated user.

 It just seems like this is something that would be built in - just like CSRF
 protection.  It's a basic web attack strategy that could (and I think
 should) easily be defended against by the framework - making it that much
 better for the user.  And it's not difficult - it only took me a couple
 hours to create it.

 Jeremy Thomerson

 On Wed, Sep 2, 2009 at 3:10 AM, Sid Bachtiar sid.bacht...@gmail.com wrote:

  Hi Jeremy,

  Those Symfony / Propel generated forms are basic with no security. You
  will need to secure them based on the requirements of your project.

  You don't secure a record from unauthorized access by obscuring the
  ID, you actually have to check to make sure that a user is allowed to
  access particular record when they try to.

  Sid

  On Wed, Sep 2, 2009 at 5:55 PM, Jeremy
  Thomersonjeremythomer...@gmail.com wrote:

   I have a question.  In Symfony / Propel forms, when I am editing an
   object, the primary key is a hidden field.  I have verified that by
   using Tamper Data (or anything of the nature), I can modify a
   different row in the database (iow, someone else's information) by
   simply changing the ID value in the HTTP submission.

   This is very bad default behavior.  Is there a way to turn this off?

   I have come up with a way to overcome it - similar to the CSRF
   protection.  But I've hit one snag.  Here's the thought:

   1 - In BasePropelForm __construct, I add a field to the form that has
   a hash of the form class, the primary key value, and some secret
   internal salt (other things could be added).

   2 - I add a validator to the primary key field of the form that
   verifies that the value that comes in on submission also hashes out to
   the hash that was in the form.

   This works in my tests.  The only snag is that I can't find an
   automated way of getting the primary key field name.  Is there a way?

   Thanks,
   Jeremy Thomerson


--~--~-~--~~~---~--~~
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 could I switch to Lime 2.0 (I understand it's not complete)

2009-08-30 Thread Crafty_Shadow

Should I choose to use lime 2.0, would I be able to do so by simply
creating a lime directory in my lib folder, and rely on Symfony's
autoloading to take care of the inclusion order?
--~--~-~--~~~---~--~~
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 could I switch to Lime 2.0 (I understand it's not complete)

2009-08-30 Thread Crafty_Shadow

I am currently developing with windows, it would be great if you could
provide a few pointers.

On Aug 30, 10:40 pm, Bernhard Schussek bschus...@gmail.com wrote:
 Hi,

 If you are working on a Unix based OS, this is very easy.

 The following steps assume that you have downloaded Lime2 to
 lib/vendor/Lime2 and that the symfony source code is located in
 lib/vendor/symfony.

 1. Rename the original lime.php
 cd lib/vendor/symfony/lib/vendor/lime
 mv lime.php lime.php.bak

 2. Create a symlink pointing to the lime.php of Lime2
 ln -s ../../../../Lime2/lib/lime.php lime.php

 (You might have to fiddle with the paths if your setup is different.)

 If you are working on Windows, things are a bit more complicated. I
 will post a guide if this is the case :-)

 That's all. Please tell me if you encounter any bugs.

 Bernhard
 --
 Software Architect  Engineer
 Blog:http://webmozarts.com

 2009/8/30 Crafty_Shadow vankat...@gmail.com:



  Should I choose to use lime 2.0, would I be able to do so by simply
  creating a lime directory in my lib folder, and rely on Symfony's
  autoloading to take care of the inclusion order?


--~--~-~--~~~---~--~~
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 could I switch to Lime 2.0 (I understand it's not complete)

2009-08-30 Thread Crafty_Shadow

I have noticed that lime 2.0 is no longer marked as Experimental in
the SVN branch, does that mean it is closing completion?
I intend to use mainly for testing purposes (no pun intended), but
still, it would be good to know when does the current revision stand.

On Aug 30, 10:53 pm, Bernhard Schussek bschus...@gmail.com wrote:
 Okay.

 In this case you could simply copy the contents of Lime2/lib/ and
 paste them into symfony/lib/vendor/lime/. Make sure you create a
 backup of symfony/lib/vendor/lime/lime.php before that.

 Not as clean, but should work.

 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: Timeout loading yaml files 1MB

2009-07-29 Thread Crafty_Shadow

I have loaded a 6mb yaml fixtures file without the slightest problem.
One option would be to use set_time_limit(0), thus giving the script
an infinite time to run. (or you could set it to any other value in
seconds that you feel comfortable with.

Or, you could post a snippet of your code. I dunno how you're using
that yaml file.

If you are inserting propel objects, it's a bit faster to do it this
way:

$c = new Criteria();
foreach ($fixtures as $fixture)
{
 $c-clear();
 $c-add(ArticlePeer::TITLE, $fixture['title']);
 $c-add(ArticlePeer::CONTENT, $fixture['content']);
 ArticlePeer::doInsert($c);
}

You also save on memory (effectively, only the criteria objects stays
in memory, instead of every single propel object if you create them
and call -save() ), which becomes an issue quite easily when
inserting over 100 000 records.

In case you want to insert IDs too, you can but must call
BasePeer::doInsert() instead, and have in mind, it doesn't use
transaction for the insert, you have to build one yourself.

On Jul 28, 2:57 pm, danielwinter spinw...@gmail.com wrote:
 Has anyone had any success loading yaml files  1MB?
 I have a script that loads yaml files using sfYaml and the load()
 method takes several minutes to load files  1MB.
 Is there a faster way to handle large files? Anyone?
 :)
--~--~-~--~~~---~--~~
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: Reading mail from smtp with symfony.

2009-07-25 Thread Crafty_Shadow

In the end, I went with a task that is called through a corn job.
The task uses php's IMAP set of functions, some of my code is based on
http://davidwalsh.name/gmail-php-imap and various other sources that
come up when you do a simple google search. Depending on your host,
finding way to access your mailbox may pose a bit of a problem, what I
found to work well for 2 of the hosts I use was {yourhost.com:993/imap/
ssl/novalidate-cert}INBOX

As for my particular problem, I used symfony to send automatic e-mails
concerning the status of orders on my site. Every e-mails set is kept
as a conversation and is attached to the order in question, and a
serial number of the order is present in the auto-emails body and
subject (+ a small note not to delete the SN from the subject when
replying (which I do think anyone would do anyway, but just to be on
the safe side), then I perform a regex, and attach every e-mail to the
appropriate order. Makes for a pretty neat system.

On Jul 24, 7:52 pm, Gábor Fási maerl...@gmail.com wrote:
 You misunderstood me :) I fetch data from websites, not mail accounts.

 On Fri, Jul 24, 2009 at 18:17, Richtermeisternex...@gmail.com wrote:

  Hey Gabor,

  I'd be interested in what software you use to access the imap servers.
  Any pointers? :)

  Thanks,
  Daniel

  On Jul 24, 6:33 am, Gábor Fási maerl...@gmail.com wrote:
  I have a site that needs to regularly collect info from other
  locations, not mails though, but websites. I achieved this via tasks
  scheduled with cron. They all boil down to the simple
  connect-process-store steps, I believe a similar approach is ok for
  you.

  On Fri, Jul 24, 2009 at 15:08, Crafty_Shadowvankat...@gmail.com wrote:

   Everybody knows how to send e-mails from symfony, or php in general.
   It's a trivial task.
   However, I am now faced with the need to do the reverse - use imap to
   read e-mails.
   From what I gather, one way to do so would be a task that is called
   through a cron job

   If anyone has any experience with this, please advice.


--~--~-~--~~~---~--~~
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] Reading mail from smtp with symfony.

2009-07-24 Thread Crafty_Shadow

Everybody knows how to send e-mails from symfony, or php in general.
It's a trivial task.
However, I am now faced with the need to do the reverse - use imap to
read e-mails.
From what I gather, one way to do so would be a task that is called
through a cron job

If anyone has any experience with this, please advice.
--~--~-~--~~~---~--~~
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: i18n in model::Peer method

2009-07-16 Thread Crafty_Shadow

What you've written, setting an static property of an object as an
associative array with translation calls does not work.
I have had the same problem before, what I usually do is call the
widget with something along the lines of:
  'choices'=array_map(array('TextTools ', '__'), JobeetJobPeer::
$types)

Unfortunately, when using this you can't rely on i18n-extract.

If someone knows a better way, please do share.

On Jul 16, 8:37 am, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
wrote:
 I didn't mentioned that I have leatest php 5.2 version on debian. I
 think that php don't allow to set dynamic date to the class variable.
 @Alexandru-Emil can You show Your implementation ?

 On 15 Lip, 21:34, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
 wrote:

   TextTools != myTools

  Bad copy  paste :-), so this is no problem.

  I have syntax error here:   'full-time' = TextTools::__('Full
  time'),

  On Jul 15, 9:21 pm, Gábor Fási maerl...@gmail.com wrote:

   TextTools != myTools
   also, which line do you have the syntax error in? This part you showed
   us looks fine to me.

   On Wed, Jul 15, 2009 at 20:33, Mateusz

   Kaczmarekmateusz.kaczma...@gmail.com wrote:

Hmm. Are You sure ? I have something like this:

class myTools {
 public static function __($text) {
   return sfContext::getInstance()-getI18N()-__($text);
 }
}

and this:

static public $types = array(
 'full-time' = TextTools::__('Full time'),
 'part-time' = TextTools::__('Part time'),
 'freelance' = TextTools::__('Freelance'),
);

cause: Parse error: syntax error, unexpected '(', expecting ')'

On 15 Lip, 13:10, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
When i need to add I18N support i have made a class called TextTools,
which had a static method __() . Inside this method was a call to I18N
object (i had to dig a little bit in sf code ).
but, in the end, i was able to make a

// lib/model/JobeetJobPeer.php
class JobeetJobPeer extends BaseJobeetJobPeer
{
 static public $types = array(
   'full-time' = TextTools::__('Full time'),
   'part-time' = TextTools::__('Part time'),
   'freelance' = TextTools::__('Freelance'),
 );

 // ...

}

The 18n:extract task performs a recursive search for __(+What ever
here+).. If you'll digg the code, you'll figure it out ..,.

Also ... be aware that the templates call the __( ) function by 
default
... but won't help you too much ...

On Wed, Jul 15, 2009 at 10:27 AM, Mateusz Kaczmarek 

mateusz.kaczma...@gmail.com wrote:

 Hello, I have some trouble with i18n system. How to translate strings
 in form items that are generated automaticaly for example radio
 buttons or select. I use pattern from Jobbet Tutorial and I have
 something like this:

 // lib/model/JobeetJobPeer.php
 class JobeetJobPeer extends BaseJobeetJobPeer
 {
  static public $types = array(
    'full-time' = 'Full time',
    'part-time' = 'Part time',
    'freelance' = 'Freelance',
  );

  // ...
 }

 and

 $this-widgetSchema['type'] = new sfWidgetFormChoice(array(
  'choices'  = JobeetJobPeer::$types,
  'expanded' = true,
 ));

 But when i use i18n:extract task, this string aren't included in
 result. How can I take advantages of great i18n in this case ? Thanx
 in advance for help

--
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: i18n in model::Peer method

2009-07-16 Thread Crafty_Shadow

The problem is not the loading order but the fact that php doesn't
allow this syntax:
  static public $types = array(
   'full-time' = TextTools::__('Full time'),
   'part-time' = TextTools::__('Part time'),
   ...

Try it and you'll see.
It gives unexpected '(', expecting ')' because it anticipates the
closing parentheses for the array.


On Jul 16, 3:31 pm, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
 HI!
 i do not have access to the sources atm, but, i think it would work:

 ?php class myTools{

 public static function __($text, $args = array(), $catalogue = 'messages')
 {
   if (sfConfig::get('sf_i18n'))
   {
     return sfContext::getInstance()-getI18N()-__($text, $args,
 $catalogue);
   }
   else
   {
     if (empty($args))
     {
       $args = array();
     }

     // replace object with strings
     foreach ($args as $key = $value)
     {
       if (is_object($value)  method_exists($value, '__toString'))
       {
         $args[$key] = $value-__toString();
       }
     }

     return strtr($text, $args);
   }

 }
 }?

 practically i have rewritten  the helper function into a class. However... i
 have used in an action / component .. not in a Peer class...
 Those might be loaded a little bit earlier than I18N

 Alecs



 On Thu, Jul 16, 2009 at 11:37 AM, Crafty_Shadow vankat...@gmail.com wrote:

  What you've written, setting an static property of an object as an
  associative array with translation calls does not work.
  I have had the same problem before, what I usually do is call the
  widget with something along the lines of:
   'choices'=array_map(array('TextTools ', '__'), JobeetJobPeer::
  $types)

  Unfortunately, when using this you can't rely on i18n-extract.

  If someone knows a better way, please do share.

  On Jul 16, 8:37 am, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
  wrote:
   I didn't mentioned that I have leatest php 5.2 version on debian. I
   think that php don't allow to set dynamic date to the class variable.
   @Alexandru-Emil can You show Your implementation ?

   On 15 Lip, 21:34, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
   wrote:

 TextTools != myTools

Bad copy  paste :-), so this is no problem.

I have syntax error here:   'full-time' = TextTools::__('Full
time'),

On Jul 15, 9:21 pm, Gábor Fási maerl...@gmail.com wrote:

 TextTools != myTools
 also, which line do you have the syntax error in? This part you
  showed
 us looks fine to me.

 On Wed, Jul 15, 2009 at 20:33, Mateusz

 Kaczmarekmateusz.kaczma...@gmail.com wrote:

  Hmm. Are You sure ? I have something like this:

  class myTools {
   public static function __($text) {
     return sfContext::getInstance()-getI18N()-__($text);
   }
  }

  and this:

  static public $types = array(
   'full-time' = TextTools::__('Full time'),
   'part-time' = TextTools::__('Part time'),
   'freelance' = TextTools::__('Freelance'),
  );

  cause: Parse error: syntax error, unexpected '(', expecting ')'

  On 15 Lip, 13:10, Alexandru-Emil Lupu gang.al...@gmail.com
  wrote:
  When i need to add I18N support i have made a class called
  TextTools,
  which had a static method __() . Inside this method was a call to
  I18N
  object (i had to dig a little bit in sf code ).
  but, in the end, i was able to make a

  // lib/model/JobeetJobPeer.php
  class JobeetJobPeer extends BaseJobeetJobPeer
  {
   static public $types = array(
     'full-time' = TextTools::__('Full time'),
     'part-time' = TextTools::__('Part time'),
     'freelance' = TextTools::__('Freelance'),
   );

   // ...

  }

  The 18n:extract task performs a recursive search for __(+What
  ever
  here+).. If you'll digg the code, you'll figure it out ..,.

  Also ... be aware that the templates call the __( ) function by
  default
  ... but won't help you too much ...

  On Wed, Jul 15, 2009 at 10:27 AM, Mateusz Kaczmarek 

  mateusz.kaczma...@gmail.com wrote:

   Hello, I have some trouble with i18n system. How to translate
  strings
   in form items that are generated automaticaly for example radio
   buttons or select. I use pattern from Jobbet Tutorial and I have
   something like this:

   // lib/model/JobeetJobPeer.php
   class JobeetJobPeer extends BaseJobeetJobPeer
   {
    static public $types = array(
      'full-time' = 'Full time',
      'part-time' = 'Part time',
      'freelance' = 'Freelance',
    );

    // ...
   }

   and

   $this-widgetSchema['type'] = new sfWidgetFormChoice(array(
    'choices'  = JobeetJobPeer::$types,
    'expanded' = true,
   ));

   But when i use i18n:extract task, this string aren't included in
   result. How can I take advantages of great i18n in this case ?
  Thanx
   in advance for help

  --
  As programmers create bigger  better idiot

[symfony-users] Re: i18n in model::Peer method

2009-07-16 Thread Crafty_Shadow

This is quite different from op's question. You can do this when
sending parameters for a constructor, but the problem was how to
translate values in an associative array which is a static property of
an object. It's something of a everyday occurrence, really, so finding
a valuable solution would be most useful.

One way to do it would be through a static method I guess:

class JobeetJobPeer extends BaseJobeetJobPeer
{
  static public $types = array(
'full-time' = 'Full time',
'part-time' = 'Part time',
'freelance' = 'Freelance',
  );
  public static function getTranslatedTypes()
  {
$i18n_object = sfContext::getInstance()-getI18n();
return array_map(array($i18n_object, '__'), self::$types);
  }
.


On Jul 16, 9:34 pm, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
 i have this

   public function executeCommentsForPostFeed()
   {
     $text = $this-getRequestParameter('stripped_title');
     $date = sfDoctrineBlogTools::getDateFromRequest();

     $this-post = sfDoctrineBlogPost::findByStrippedTitleAndDate($text,
 $date);

     $this-forward404Unless($post);
     $this-feed = sfFeedPeer::createFromObjects(
       $comments,
       array(
         'format'      = $this-getRequestParameter('format', 'atom1'),
         'title'       = sfDoctrineBlogTools::__('Comments on post %1%
 from %2%', array('%1%' = $post-getTitle(), '%2%' =
 sfConfig::get('app_sfSimpleBlog_title', ''))),
         'link'        =
 $this-getController()-genUrl('sfSimpleBlog/show?stripped_title='.$post-getStrippedTitle()),
         'authorName'  = sfConfig::get('app_sfSimpleBlog_author', ''),
         'methods'     = array('title' = 'getPostTitle', 'authorEmail' =
 '')
       )
     );
     $this-setTemplate('feed');
   }

 and this

 class sfDoctrineBlogTools
 {

   public static function __($text, $args = array(), $catalogue = 'messages')
      {
        if (sfConfig::get('sf_i18n'))
        {
          return sfContext::getInstance()-getI18N()-__($text, $args,
 $catalogue);
        }
        else
        {
          if (empty($args))
          {
            $args = array();
          }

          // replace object with strings
          foreach ($args as $key = $value)
          {
            if (is_object($value)  method_exists($value, '__toString'))
            {
              $args[$key] = $value-__toString();
            }
          }

          return strtr($text, $args);
        }
      }

 On Thu, Jul 16, 2009 at 3:49 PM, Alexandru-Emil Lupu
 gang.al...@gmail.comwrote:



  I will paste in this topic my usage tonight .. when i will get home.
  Alecs

  On Thu, Jul 16, 2009 at 3:39 PM, Crafty_Shadow vankat...@gmail.comwrote:

  The problem is not the loading order but the fact that php doesn't
  allow this syntax:
    static public $types = array(
    'full-time' = TextTools::__('Full time'),
    'part-time' = TextTools::__('Part time'),
     ...

  Try it and you'll see.
  It gives unexpected '(', expecting ')' because it anticipates the
  closing parentheses for the array.

  On Jul 16, 3:31 pm, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
   HI!
   i do not have access to the sources atm, but, i think it would work:

   ?php class myTools{

   public static function __($text, $args = array(), $catalogue =
  'messages')
   {
     if (sfConfig::get('sf_i18n'))
     {
       return sfContext::getInstance()-getI18N()-__($text, $args,
   $catalogue);
     }
     else
     {
       if (empty($args))
       {
         $args = array();
       }

       // replace object with strings
       foreach ($args as $key = $value)
       {
         if (is_object($value)  method_exists($value, '__toString'))
         {
           $args[$key] = $value-__toString();
         }
       }

       return strtr($text, $args);
     }

   }
   }?

   practically i have rewritten  the helper function into a class.
  However... i
   have used in an action / component .. not in a Peer class...
   Those might be loaded a little bit earlier than I18N

   Alecs

   On Thu, Jul 16, 2009 at 11:37 AM, Crafty_Shadow vankat...@gmail.com
  wrote:

What you've written, setting an static property of an object as an
associative array with translation calls does not work.
I have had the same problem before, what I usually do is call the
widget with something along the lines of:
 'choices'=array_map(array('TextTools ', '__'), JobeetJobPeer::
$types)

Unfortunately, when using this you can't rely on i18n-extract.

If someone knows a better way, please do share.

On Jul 16, 8:37 am, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
wrote:
 I didn't mentioned that I have leatest php 5.2 version on debian. I
 think that php don't allow to set dynamic date to the class
  variable.
 @Alexandru-Emil can You show Your implementation ?

 On 15 Lip, 21:34, Mateusz Kaczmarek mateusz.kaczma...@gmail.com
 wrote:

   TextTools != myTools

  Bad copy  paste :-), so this is no problem

[symfony-users] Re: Propel and 1:1 relationships

2009-05-23 Thread Crafty_Shadow

Hey Richtermeister (damn, I tried saying your name out loud 3 times
and I bit my tongue )

You are right in assuming that normally this should be one model. I
however decided to divide it, seeing as the two parts do vastly
different work.
The division is purely for the sake of making the code and database
more tidy. You see, the record model contains VERY sensitive
information, and I have thusly decided to use encryption for it. It is
a mysql compatible 128bit AES, however I do my encryption and
decryption in php, as I don't want to transmit the password to the
mysql sever (And you are also familiar with how symfony shows queries
in plain view). The Record model also takes care of specific data
manipulation and some final validation (most of which I have in forms,
but because of the sensitivity of the information the last stretch is
in the model) and is over 700 lines of code, where as the
RecordCriteria model is pretty straight forward, all it does is
calculate the weight or score if you'd prefer and provide some
data-retrieval methods.

So, in my mind, the most sensible thing to do was to separate the two
models. I believe it's more clean, and more clear that way. The
foreign key is set to the ID column, so record of id 10 has a
recordCriteria of id 10. Essentailly a 1:1 relationship. Not something
that one should really need to use very often. As a matter of fact,
this is the very first time I have used one.

Once again, thanks to everyone for pointing me in the right direction.


PS And sorry for the double post before, especially one so lengthy

On May 23, 9:30 am, Richtermeister nex...@gmail.com wrote:
 Hey Crafty,

 glad to hear you found a solution. I get what you're trying to do, I
 guess I was just a little unclear on the term 1-to-1 relationship.

 I may be wrong on this, but it seems to me there is no such thing as a
 1-to-1 relationship in a propel model.. after all, the Record model
 has a foreign key pointing to a record in the RecordCriteria model,
 correct? Now, technically you could have many Records pointing to the
 same RecordCriteria, and this would give you a 1-to-many
 relationship.. At least nothing in the datamodel restricts a 1-to-1
 relationship.
 In my opinion, when you have a 1-to-1 relationship of data, the data
 should really be in the very same model. Does that make sense, or am I
 going wrong somethere?

 Have a good night everybody,
 Daniel

 On May 22, 5:38 am, Crafty_Shadow vankat...@gmail.com wrote:

  Ok, I managed to write a static method for the Peer class that does
  exactly what I need, thanks for the help.
  I'm going to post it here:

    public static function doSelectJoinRecordCriteria(Criteria
  $criteria, PropelPDO $con = null)
    {
      $criteria = clone $criteria;
      RecordPeer::addSelectColumns($criteria); // add columns of the
  Record object to the criteria
      $startcol = (RecordPeer::NUM_COLUMNS -
  RecordPeer::NUM_LAZY_LOAD_COLUMNS); // this will be used as offset to
  the RecordCriteria table columns later

      RecordCriteriaPeer::addSelectColumns($criteria); // add columns of
  the RecordCriteria
      $criteria-addJoin(RecordPeer::ID, RecordCriteriaPeer::ID); //
  join on ID

      $stmt = BasePeer::doSelect($criteria, $con);
      $results = array();

      while ($row = $stmt-fetch(PDO::FETCH_NUM))
      {
        $primary_key = RecordPeer::getPrimaryKeyHashFromRow($row, 0);
        if (!$record_object = RecordPeer::getInstanceFromPool
  ($primary_key)) // check Propel's object pool for our Record object,
  and create it if it's not found
        {
          $record_object = new Record();
          $record_object-hydrate($row);
          RecordPeer::addInstanceToPool($record_object,
  $primary_key);
        }

        $primary_key = RecordCriteriaPeer::getPrimaryKeyHashFromRow
  ($row, $startcol); // same as the record primary key, but I put it for
  clarification
        if (!$record_criteria_object =
  RecordCriteriaPeer::getInstanceFromPool($primary_key)) // this time
  check the pool for the RecordCriteria object and create if not found
        {
          $record_criteria_object = new RecordCriteria();
          $record_criteria_object-hydrate($row, $startcol);
          RecordCriteriaPeer::addInstanceToPool($record_criteria_object,
  $primary_key);
        }

        $record_criteria_object-setRecord($record_object);  // set the
  object relation

        $results[] = $record_object;
      }
      $stmt-closeCursor();

      return $results;
    }

  On May 22, 2:25 pm, Gareth McCumskey gmccums...@gmail.com wrote:

   Taken from the Propel upgrade info for moving from propel 1.2 to 1.3 
   (http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/Upgrading):

   ?php

   // example of how to manually hydrate objects
   $stmt = AuthorPeer::doSelectStmt(new Criteria());
   while($row = $stmt-fetch(PDO::FETCH_NUM)) {
     $a = new Author();
     $a-hydrate($row);

   }
   On Fri, May 22, 2009 at 1:19 PM, Crafty_Shadow vankat

[symfony-users] Re: Propel and 1:1 relationships

2009-05-22 Thread Crafty_Shadow

The manual hydration is the problem, I'm not really sure how to
accomplish it

On May 22, 8:11 am, Gareth McCumskey gmccums...@gmail.com wrote:
 You mentioned you manually created the join but the doSelect returns
 nothing. From my experience with Propel 1.2 you would need to use a
 doSelectRS to return the resultset. But in 1.3 you use doSelectStmt() to run
 your query with join and get aresaultset which you can then hydrate yourself
 manually.

 Would this help?



 On Thu, May 21, 2009 at 10:54 PM, Crafty_Shadow vankat...@gmail.com wrote:

  Thanks for the interest in my problem, Richtermister.
  The code I have shown above accounts only for a small part of my
  model, but I thought it would be sufficient to convey the point. There
  really isn't anything special about the Option 0,1,2,3,... etc, but I
  will provide you with as much information as I can considering the
  nature of the project
  Consider the following:
  The Record model accounts for a particular governmental system. It has
  the name and address of the person who submitted the request, an
  unique number, and a few other miscellaneous fields.
  There is a second model, RecordCriteria, tied in a 1:1 relationship
  with the first model. It has only boolean fields representing
  different sets of requirements that the applicant must meet, and a
  single float field that calculates the weight of the application,
  based on the requirements.

  There are MANY queries run on those 2 tables, and often a lot of
  records have to be displayed at once. Of course, this results in an
  additional query being executed for every single record that I show.
  This should really be avoided. It results in over 800 queries on one
  particular page, where about 10 should suffice.

  Normally Propel provides doSelectJoin(related_table) methods, and when
  I was designing the database, I believed that it would do so for the
  1:1 relation too, providing something like
  RecordPeer::doSelectJoinRecordCriteria().  I was wrong. No automatic
  method for joining the related table is available.

  So my question is simply, how to do a custom join for 1:1 in Propel
  1.3, in a fashion similar to what David Ashwood purposed. As I
  mentioned, the resources he provided are unfortunately not applicable
  to Propel 1.3.

  On May 21, 8:57 pm, Richtermeister nex...@gmail.com wrote:
   Hey Crafty,

   I think one issue is that it's not really clear what you're trying to
   do..
   I have no idea what this option0 / option1 setup is all about..

   If you can give an example of what you're trying to do, maybe we can
   help better.

   Daniel

   On May 20, 3:20 pm, Crafty_Shadow vankat...@gmail.com wrote:

Once again, a shameless bump!

I tried several approaches to no avail.
Halp!

On May 19, 12:48 pm, Crafty_Shadow vankat...@gmail.com wrote:

 Thanks for the links, but those are of no help to me.

 Each and every single of the resources you have pointed me to are
 about propel 1.2.
 As I mentioned in my original post, I have written such behavior for
 propel 1.2, but the problem is that I'm currently dealing with 1.3,
 which is quite different.

 On May 19, 12:09 pm, David Ashwood da...@inspiredthinking.co.uk
 wrote:

  Some links that talk about what you're after:

 http://forum.symfony-project.org/index.php/m/14692/http://groups.goog
  ..
  cb274ehttp://
  trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelect

  And a plugin written that appears to do what you're after:
 http://www.symfony-project.org/plugins/sfPropelImpersonatorPlugin

  Alternatively there's also the DbFinder plugin that gives you more
  control
  over what's happening and a very good way to have an app that
  allows you to
  switch ORM later should you wish to jump to Doctrine (far cleaner
  and more
  flexible than Propel imho):

 http://www.symfony-project.org/plugins/DbFinderPlugin

  -Original Message-
  From: symfony-users@googlegroups.com [mailto:
  symfony-us...@googlegroups.com]

  On Behalf Of Crafty_Shadow
  Sent: 19 May 2009 10:52
  To: symfony users
  Subject: [symfony-users] Re: Propel and 1:1 relationships

  I am going to perform what is know as a shameless bump.
  I believe that this problem requires discussion, as having a 1:1
  relationship should be fairly common, and it is only natural to
  seek
  way optimize it's workings.

  On May 17, 7:14 pm, Crafty_Shadow vankat...@gmail.com wrote:
   Hey guys,
   I have the following question - how do I makepropelhydrate1:1
   relationships automatically ?
   When we have a normal 1:m relationship the peer class provides
  methods
   like doSelectJoinWhaever, but no such method is available when
  using a1:1
   The relation itself works just as it's expected to, but every
  call to
   get the related object results in an extra query.

   from my schema.yml

[symfony-users] Re: Propel and 1:1 relationships

2009-05-22 Thread Crafty_Shadow

Ok, I managed to write a class that does exactly what I needed, thanks
for the help.
I'm going to post it here:


  public static function doSelectJoinRecordCriteria(Criteria
$criteria, PropelPDO $con = null)
  {
$criteria = clone $criteria;
RecordPeer::addSelectColumns($criteria); // add columns of the
Record object to the criteria
$startcol = (RecordPeer::NUM_COLUMNS -
RecordPeer::NUM_LAZY_LOAD_COLUMNS); // this will be used as offset to
the RecordCriteria table columns later

RecordCriteriaPeer::addSelectColumns($criteria); // add columns of
the RecordCriteria
$criteria-addJoin(RecordPeer::ID, RecordCriteriaPeer::ID); //
join on ID

$stmt = BasePeer::doSelect($criteria, $con);
$results = array();

while ($row = $stmt-fetch(PDO::FETCH_NUM))
{
  $primary_key = RecordPeer::getPrimaryKeyHashFromRow($row, 0);
  if (!$record_object = RecordPeer::getInstanceFromPool
($primary_key)) // check Propel's object pool for our Record object,
and create it if it's not found
  {
$record_object = new Record();
$record_object-hydrate($row);
RecordPeer::addInstanceToPool($record_object,
$primary_key);
  }

  $primary_key = RecordCriteriaPeer::getPrimaryKeyHashFromRow
($row, $startcol); // same as the record primary key, but I put it for
clarification
  if (!$record_criteria_object =
RecordCriteriaPeer::getInstanceFromPool($primary_key)) // this time
check the pool for the RecordCriteria object and create if not found
  {
$record_criteria_object = new RecordCriteria();
$record_criteria_object-hydrate($row, $startcol);
RecordCriteriaPeer::addInstanceToPool($record_criteria_object,
$primary_key);
  }

  $record_criteria_object-setRecord($record_object);  // set the
object relation

  $results[] = $record_object;
}
$stmt-closeCursor();

return $results;
  }


On May 22, 2:25 pm, Gareth McCumskey gmccums...@gmail.com wrote:
 Taken from the Propel upgrade info for moving from propel 1.2 to 1.3 
 (http://propel.phpdb.org/trac/wiki/Users/Documentation/1.3/Upgrading):

 ?php

 // example of how to manually hydrate objects
 $stmt = AuthorPeer::doSelectStmt(new Criteria());
 while($row = $stmt-fetch(PDO::FETCH_NUM)) {
   $a = new Author();
   $a-hydrate($row);



 }
 On Fri, May 22, 2009 at 1:19 PM, Crafty_Shadow vankat...@gmail.com wrote:

  The manual hydration is the problem, I'm not really sure how to
  accomplish it

  On May 22, 8:11 am, Gareth McCumskey gmccums...@gmail.com wrote:
   You mentioned you manually created the join but the doSelect returns
   nothing. From my experience with Propel 1.2 you would need to use a
   doSelectRS to return the resultset. But in 1.3 you use doSelectStmt() to
  run
   your query with join and get aresaultset which you can then hydrate
  yourself
   manually.

   Would this help?

   On Thu, May 21, 2009 at 10:54 PM, Crafty_Shadow vankat...@gmail.com
  wrote:

Thanks for the interest in my problem, Richtermister.
The code I have shown above accounts only for a small part of my
model, but I thought it would be sufficient to convey the point. There
really isn't anything special about the Option 0,1,2,3,... etc, but I
will provide you with as much information as I can considering the
nature of the project
Consider the following:
The Record model accounts for a particular governmental system. It has
the name and address of the person who submitted the request, an
unique number, and a few other miscellaneous fields.
There is a second model, RecordCriteria, tied in a 1:1 relationship
with the first model. It has only boolean fields representing
different sets of requirements that the applicant must meet, and a
single float field that calculates the weight of the application,
based on the requirements.

There are MANY queries run on those 2 tables, and often a lot of
records have to be displayed at once. Of course, this results in an
additional query being executed for every single record that I show.
This should really be avoided. It results in over 800 queries on one
particular page, where about 10 should suffice.

Normally Propel provides doSelectJoin(related_table) methods, and when
I was designing the database, I believed that it would do so for the
1:1 relation too, providing something like
RecordPeer::doSelectJoinRecordCriteria().  I was wrong. No automatic
method for joining the related table is available.

So my question is simply, how to do a custom join for 1:1 in Propel
1.3, in a fashion similar to what David Ashwood purposed. As I
mentioned, the resources he provided are unfortunately not applicable
to Propel 1.3.

On May 21, 8:57 pm, Richtermeister nex...@gmail.com wrote:
 Hey Crafty,

 I think one issue is that it's not really clear what you're trying to
 do..
 I have no idea what this option0 / option1 setup

[symfony-users] Re: Propel and 1:1 relationships

2009-05-21 Thread Crafty_Shadow

Thanks for the interest in my problem, Richtermister.
The code I have shown above accounts only for a small part of my
model, but I thought it would be sufficient to convey the point. There
really isn't anything special about the Option 0,1,2,3,... etc, but I
will provide you with as much information as I can considering the
nature of the project
Consider the following:
The Record model accounts for a particular governmental system. It has
the name and address of the person who submitted the request, an
unique number, and a few other miscellaneous fields.
There is a second model, RecordCriteria, tied in a 1:1 relationship
with the first model. It has only boolean fields representing
different sets of requirements that the applicant must meet, and a
single float field that calculates the weight of the application,
based on the requirements.

There are MANY queries run on those 2 tables, and often a lot of
records have to be displayed at once. Of course, this results in an
additional query being executed for every single record that I show.
This should really be avoided. It results in over 800 queries on one
particular page, where about 10 should suffice.

Normally Propel provides doSelectJoin(related_table) methods, and when
I was designing the database, I believed that it would do so for the
1:1 relation too, providing something like
RecordPeer::doSelectJoinRecordCriteria().  I was wrong. No automatic
method for joining the related table is available.

So my question is simply, how to do a custom join for 1:1 in Propel
1.3, in a fashion similar to what David Ashwood purposed. As I
mentioned, the resources he provided are unfortunately not applicable
to Propel 1.3.



On May 21, 8:57 pm, Richtermeister nex...@gmail.com wrote:
 Hey Crafty,

 I think one issue is that it's not really clear what you're trying to
 do..
 I have no idea what this option0 / option1 setup is all about..

 If you can give an example of what you're trying to do, maybe we can
 help better.

 Daniel

 On May 20, 3:20 pm, Crafty_Shadow vankat...@gmail.com wrote:

  Once again, a shameless bump!

  I tried several approaches to no avail.
  Halp!

  On May 19, 12:48 pm, Crafty_Shadow vankat...@gmail.com wrote:

   Thanks for the links, but those are of no help to me.

   Each and every single of the resources you have pointed me to are
   about propel 1.2.
   As I mentioned in my original post, I have written such behavior for
   propel 1.2, but the problem is that I'm currently dealing with 1.3,
   which is quite different.

   On May 19, 12:09 pm, David Ashwood da...@inspiredthinking.co.uk
   wrote:

Some links that talk about what you're after:

   http://forum.symfony-project.org/index.php/m/14692/http://groups.goog..
cb274ehttp://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelect

And a plugin written that appears to do what you're 
after:http://www.symfony-project.org/plugins/sfPropelImpersonatorPlugin

Alternatively there's also the DbFinder plugin that gives you more 
control
over what's happening and a very good way to have an app that allows 
you to
switch ORM later should you wish to jump to Doctrine (far cleaner and 
more
flexible than Propel imho):

   http://www.symfony-project.org/plugins/DbFinderPlugin

-Original Message-
From: symfony-users@googlegroups.com 
[mailto:symfony-us...@googlegroups.com]

On Behalf Of Crafty_Shadow
Sent: 19 May 2009 10:52
To: symfony users
Subject: [symfony-users] Re: Propel and 1:1 relationships

I am going to perform what is know as a shameless bump.
I believe that this problem requires discussion, as having a 1:1
relationship should be fairly common, and it is only natural to seek
way optimize it's workings.

On May 17, 7:14 pm, Crafty_Shadow vankat...@gmail.com wrote:
 Hey guys,
 I have the following question - how do I makepropelhydrate1:1
 relationships automatically ?
 When we have a normal 1:m relationship the peer class provides methods
 like doSelectJoinWhaever, but no such method is available when using 
 a1:1
 The relation itself works just as it's expected to, but every call to
 get the related object results in an extra query.

 from my schema.yml:

   record:
     id:                 ~
     sequential_number:  { type:      integer, required: true }
     status:             { type:     smallint, required: true }
   record_option:
     id:               { type: integer, primaryKey: true, foreignTable:
 record, foreignReference: id, required: true, onDelete: cascade }
 ##1:1relational mapping
     option0:       { type: boolean, default: false }
     option1:       { type: boolean, default: false }

 $record-getRecordOption()-getOption0();  - an extra query here, and
 given that I have to show MANY records at once (many being a random
 number between 10 and 5000, without pagination

[symfony-users] Re: Propel and 1:1 relationships

2009-05-20 Thread Crafty_Shadow

Once again, a shameless bump!

I tried several approaches to no avail.
Halp!

On May 19, 12:48 pm, Crafty_Shadow vankat...@gmail.com wrote:
 Thanks for the links, but those are of no help to me.

 Each and every single of the resources you have pointed me to are
 about propel 1.2.
 As I mentioned in my original post, I have written such behavior for
 propel 1.2, but the problem is that I'm currently dealing with 1.3,
 which is quite different.

 On May 19, 12:09 pm, David Ashwood da...@inspiredthinking.co.uk
 wrote:

  Some links that talk about what you're after:

 http://forum.symfony-project.org/index.php/m/14692/http://groups.goog..
  cb274ehttp://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelect

  And a plugin written that appears to do what you're 
  after:http://www.symfony-project.org/plugins/sfPropelImpersonatorPlugin

  Alternatively there's also the DbFinder plugin that gives you more control
  over what's happening and a very good way to have an app that allows you to
  switch ORM later should you wish to jump to Doctrine (far cleaner and more
  flexible than Propel imho):

 http://www.symfony-project.org/plugins/DbFinderPlugin

  -Original Message-
  From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]

  On Behalf Of Crafty_Shadow
  Sent: 19 May 2009 10:52
  To: symfony users
  Subject: [symfony-users] Re: Propel and 1:1 relationships

  I am going to perform what is know as a shameless bump.
  I believe that this problem requires discussion, as having a 1:1
  relationship should be fairly common, and it is only natural to seek
  way optimize it's workings.

  On May 17, 7:14 pm, Crafty_Shadow vankat...@gmail.com wrote:
   Hey guys,
   I have the following question - how do I makepropelhydrate1:1
   relationships automatically ?
   When we have a normal 1:m relationship the peer class provides methods
   like doSelectJoinWhaever, but no such method is available when using a1:1
   The relation itself works just as it's expected to, but every call to
   get the related object results in an extra query.

   from my schema.yml:

     record:
       id:                 ~
       sequential_number:  { type:      integer, required: true }
       status:             { type:     smallint, required: true }
     record_option:
       id:               { type: integer, primaryKey: true, foreignTable:
   record, foreignReference: id, required: true, onDelete: cascade }
   ##1:1relational mapping
       option0:       { type: boolean, default: false }
       option1:       { type: boolean, default: false }

   $record-getRecordOption()-getOption0();  - an extra query here, and
   given that I have to show MANY records at once (many being a random
   number between 10 and 5000, without pagination - as required by
   application specifications) this could prove to be a pretty serious
   issue

   Simply adding a join clause to the criteria does nothing, I suppose I
   need to override the hydration.
   I have used the method described
  here:http://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelecton
   previous projects, but this project usesPropel1.3 and this is forPropel1.2

   Any help would be deeply 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: Propel and 1:1 relationships

2009-05-19 Thread Crafty_Shadow

I am going to perform what is know as a shameless bump.
I believe that this problem requires discussion, as having a 1:1
relationship should be fairly common, and it is only natural to seek
way optimize it's workings.

On May 17, 7:14 pm, Crafty_Shadow vankat...@gmail.com wrote:
 Hey guys,
 I have the following question - how do I makepropelhydrate1:1
 relationships automatically ?
 When we have a normal 1:m relationship the peer class provides methods
 like doSelectJoinWhaever, but no such method is available when using a1:1
 The relation itself works just as it's expected to, but every call to
 get the related object results in an extra query.

 from my schema.yml:

   record:
     id:                 ~
     sequential_number:  { type:      integer, required: true }
     status:             { type:     smallint, required: true }
   record_option:
     id:               { type: integer, primaryKey: true, foreignTable:
 record, foreignReference: id, required: true, onDelete: cascade }  
 ##1:1relational mapping
     option0:       { type: boolean, default: false }
     option1:       { type: boolean, default: false }

 $record-getRecordOption()-getOption0();  - an extra query here, and
 given that I have to show MANY records at once (many being a random
 number between 10 and 5000, without pagination - as required by
 application specifications) this could prove to be a pretty serious
 issue

 Simply adding a join clause to the criteria does nothing, I suppose I
 need to override the hydration.
 I have used the method described 
 here:http://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelecton
 previous projects, but this project usesPropel1.3 and this is forPropel1.2

 Any help would be deeply 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: Propel and 1:1 relationships

2009-05-19 Thread Crafty_Shadow

Thanks for the links, but those are of no help to me.

Each and every single of the resources you have pointed me to are
about propel 1.2.
As I mentioned in my original post, I have written such behavior for
propel 1.2, but the problem is that I'm currently dealing with 1.3,
which is quite different.

On May 19, 12:09 pm, David Ashwood da...@inspiredthinking.co.uk
wrote:
 Some links that talk about what you're after:

 http://forum.symfony-project.org/index.php/m/14692/http://groups.google.com/group/symfony-users/browse_thread/thread/40d...
 cb274ehttp://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelect

 And a plugin written that appears to do what you're 
 after:http://www.symfony-project.org/plugins/sfPropelImpersonatorPlugin

 Alternatively there's also the DbFinder plugin that gives you more control
 over what's happening and a very good way to have an app that allows you to
 switch ORM later should you wish to jump to Doctrine (far cleaner and more
 flexible than Propel imho):

 http://www.symfony-project.org/plugins/DbFinderPlugin

 -Original Message-
 From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com]

 On Behalf Of Crafty_Shadow
 Sent: 19 May 2009 10:52
 To: symfony users
 Subject: [symfony-users] Re: Propel and 1:1 relationships

 I am going to perform what is know as a shameless bump.
 I believe that this problem requires discussion, as having a 1:1
 relationship should be fairly common, and it is only natural to seek
 way optimize it's workings.

 On May 17, 7:14 pm, Crafty_Shadow vankat...@gmail.com wrote:
  Hey guys,
  I have the following question - how do I makepropelhydrate1:1
  relationships automatically ?
  When we have a normal 1:m relationship the peer class provides methods
  like doSelectJoinWhaever, but no such method is available when using a1:1
  The relation itself works just as it's expected to, but every call to
  get the related object results in an extra query.

  from my schema.yml:

    record:
      id:                 ~
      sequential_number:  { type:      integer, required: true }
      status:             { type:     smallint, required: true }
    record_option:
      id:               { type: integer, primaryKey: true, foreignTable:
  record, foreignReference: id, required: true, onDelete: cascade }
  ##1:1relational mapping
      option0:       { type: boolean, default: false }
      option1:       { type: boolean, default: false }

  $record-getRecordOption()-getOption0();  - an extra query here, and
  given that I have to show MANY records at once (many being a random
  number between 10 and 5000, without pagination - as required by
  application specifications) this could prove to be a pretty serious
  issue

  Simply adding a join clause to the criteria does nothing, I suppose I
  need to override the hydration.
  I have used the method described
 here:http://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelecton
  previous projects, but this project usesPropel1.3 and this is forPropel1.2

  Any help would be deeply 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] Propel and 1:1 relationships

2009-05-17 Thread Crafty_Shadow

Hey guys,
I have the following question - how do I make propel hydrate 1:1
relationships automatically ?
When we have a normal 1:m relationship the peer class provides methods
like doSelectJoinWhaever, but no such method is available when using a
1:1
The relation itself works just as it's expected to, but every call to
get the related object results in an extra query.

from my schema.yml:

  record:
id: ~
sequential_number:  { type:  integer, required: true }
status: { type: smallint, required: true }
  record_option:
id:   { type: integer, primaryKey: true, foreignTable:
record, foreignReference: id, required: true, onDelete: cascade }  ##
1:1 relational mapping
option0:   { type: boolean, default: false }
option1:   { type: boolean, default: false }

$record-getRecordOption()-getOption0();  - an extra query here, and
given that I have to show MANY records at once (many being a random
number between 10 and 5000, without pagination - as required by
application specifications) this could prove to be a pretty serious
issue

Simply adding a join clause to the criteria does nothing, I suppose I
need to override the hydration.
I have used the method described here:
http://trac.symfony-project.org/wiki/ApplyingCustomJoinsInDoSelect on
previous projects, but this project uses Propel 1.3 and this is for
Propel 1.2

Any help would be deeply 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: changing the default signin form's layout in sfGuardAuth

2009-04-18 Thread Crafty_Shadow

I too am interested in a more detailed explanation of form formatters
and their usage when one simply does ?php echo $form; ?
Google wasn't of much help regarding this matter, so does anybody know
of a reliable information source (aside from reading the code itself)
on how to use decorators?

On Apr 18, 9:57 am, naholyr naho...@gmail.com wrote:
 Maybe you could try a fully explicit insertion of the form (with
 helpers for labels, helps, errors, etc...) as described here in the
 chapter forms for web designers 
 :http://www.symfony-project.org/forms/1_2/en/03-Forms-for-web-Designers

 On 18 avr, 05:03, ckemmler ckemm...@gmail.com wrote:

  I did that. But the problem I have is that the forms are dynamic, i.e.
  they can include error messages for example. Thus, what I need is a
  formatter. The documentation seems to be incomplete in that regard. It
  speaks of setting a form formatter (I tried the list one, but it
  didn't work) and also that it's going to explain more about custom
  formatting a form in Chapter 5, which doesn't exist!

  You can see what I did athttp://www.twittbook.com(thesignin form),
  but it's broken, as it is (it just resets the form in case of an
  error).

  On Apr 17, 7:33 pm, Nathanael D. Noblet nathan...@gnat.ca wrote:

   ckemmler wrote:
I mean: just the form, not the layout of the entire page

   Create a module in your application with the same name as the module in
   the plugin, then create a templates folder, with a template for that 
   action.

   --
   Nathanael d. Noblet
   T: 403.875.4613
--~--~-~--~~~---~--~~
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 Production Performance improvements

2009-03-10 Thread Crafty_Shadow
 specific code, so it's hard to compete with that on pure
  speed considerations. The only way to mitigate that is by using all
  forms of caching, and yes, this may include the function cache
  (although I don't like it much). However, the higher up you can
  cache, i.e. a complete action, the less you have to cache on the model
  level.

  Just my 2 cents. Good luck,
  Daniel

  On Mar 9, 8:42 am, Sumedh sumedh.inam...@gmail.com wrote:
   My 2 cents...slow query log in mysql should help a lot...

   Please let us know your insights at the end of your exercise... :)

   On Mar 9, 3:41 pm, Gareth McCumskey gmccums...@gmail.com wrote:

I just tried using Propel 1.3 on our application and while I would
  love to
continue using it (as it seemed to produce a little more efficieny) we
  can't
use it for now because the servers that the app will run on are Centos
  4
with PHP 5.1.x as its maximum version for now. The sysadmins here say
  that
to force an upgrade to 5.2.x would be a hard task as to retain RedHat
support it means they would need to upgrade to Centos 5.

I am currently looking at the chapter about Optimising symfony and the
function cache seems to be something we cna consider doing in a lot of
  our
model calls from the action to help speed things up, especially for
  model
methods that access historical data (i.e. stuff dated in the past that
obviously wont change on subsequent calls) but these are relatively
  large
coding changes which we will probably only do during our beta
  development
phase.

I am still looking through more advise recieved from this post and I
  have to
thank everyone for their input. I honestly didn't expect this response
  and
it has been fantastic and very helpful.

On Mon, Mar 9, 2009 at 12:49 AM, Crafty_Shadow vankat...@gmail.com
  wrote:

 Symfony 1.1 came by default with Propel 1.2
 You can try upgrading to 1.3 (it isn't really a trivial task, but it
 shouldn't be a big problem)
 There is thorough explanation on the symfony site how to do it:
http://www.symfony-project.org/cookbook/1_1/en/propel_13
 It should fare a measurable increase in performance. Also, a site
  that
 makes good use of cache should have caching for absolutely
  everything
 not session-dependent. I find it hard to imagine a php app, no
  matter
 how fast, that would run faster than symfony's cached output.

 Alvaro:
 Is your plugin based on Propel 1.3?
 If you believe you have made significant improvements to Propel, why
 not suggest them for version 2.0, which is still under heavy
 development?

 On Mar 8, 4:33 pm, alvaro harryjek...@gmail.com wrote:
  At the company I developed a symfony plugin to optimize the Propel
  queries and also the Propel hydrate method, improving even 5 times
  query speed and also memory usage.

  The plugins supports joins and thanks to PHP features the plugin
  returns Propel objects populated with custom AS columns.

  We are thinking on release it on the following weeks so stay tuned
  :)

  Regards,

  Alvaro

  On Mar 8, 2009, at 10:20 PM, Gareth McCumskey wrote:

   We have put numerous caching techniques into effect, from Cache-
   Expires headers to compression of static files like js and html
   files. Currently we use symfony 1.1 and Propel as the ORM. We
  have
   identified the bottleneck generally as being the application
   processing after the db queries have run to extract the data.

   The entire point of my question was to get some info on general
  tips
   and tricks we can try out to see if anything helps or if perhaps
  we
   have missed any obvious issues that may actually be the cause of
  the
   slow performance we are getting. As it is I have gotten quite a
  few
   and look forward to getting into the office tomorrow to try them
   out. Anymore is greatly appreciated.

   Of course I am looking through the code to see if there is
  anyway we
   can streamline it on that end, but every little bit helps.

   Gareth

   On Sun, Mar 8, 2009 at 12:27 PM, Crafty_Shadow 
  vankat...@gmail.com
   wrote:

   Gareth, you didn't mention what version of symfony you were
  using,
   also what ORM (if any).
   The best course of optimization will depend on those. Also, as
  already
   mentioned, caching is your best friend.

   On Mar 8, 9:43 am, Gareth McCumskey gmccums...@gmail.com
  wrote:
Well, consider a single database table that looks something
  like
   this:

From_address
to_address (possibly multiple addresses comma-seperated)
headers
spam_report
subject

And we would have millions of those records in the database.
   Repeated
entries, especially on to_address, means the data

 ...

 read more

[symfony-users] Re: Symfony Production Performance improvements

2009-03-08 Thread Crafty_Shadow

Gareth, you didn't mention what version of symfony you were using,
also what ORM (if any).
The best course of optimization will depend on those. Also, as already
mentioned, caching is your best friend.

On Mar 8, 9:43 am, Gareth McCumskey gmccums...@gmail.com wrote:
 Well, consider a single database table that looks something like this:

 From_address
 to_address (possibly multiple addresses comma-seperated)
 headers
 spam_report
 subject

 And we would have millions of those records in the database. Repeated
 entries, especially on to_address, means the data is hugely redundant. By
 normalising we are turning a text search across millions of records with
 redundant repeated data into a text search over a unique list, then an
 integer search over primary key (which of course is indexed).

 On Sun, Mar 8, 2009 at 9:37 AM, Lawrence Krubner 
 lkrub...@geocities.comwrote:



  On Mar 8, 3:26 am, Gareth McCumskey gmccums...@gmail.com wrote:
   We had a speed increase because we had a lot of text searches in the old
   system, all going through text fields where the same values were repeated
   over and over. Its therefore a lot faster to search a much smaller table,
   where the text fields are unique, and find the value once, then use an ID
   comparison, being much faster to match integers than text.

  In sounds like you got a speed boost from doing intelligent indexing.
  What you are describing sounds more like indexing than normalization,
  at least to 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: Symfony Production Performance improvements

2009-03-08 Thread Crafty_Shadow

Symfony 1.1 came by default with Propel 1.2
You can try upgrading to 1.3 (it isn't really a trivial task, but it
shouldn't be a big problem)
There is thorough explanation on the symfony site how to do it:
http://www.symfony-project.org/cookbook/1_1/en/propel_13
It should fare a measurable increase in performance. Also, a site that
makes good use of cache should have caching for absolutely everything
not session-dependent. I find it hard to imagine a php app, no matter
how fast, that would run faster than symfony's cached output.

Alvaro:
Is your plugin based on Propel 1.3?
If you believe you have made significant improvements to Propel, why
not suggest them for version 2.0, which is still under heavy
development?

On Mar 8, 4:33 pm, alvaro harryjek...@gmail.com wrote:
 At the company I developed a symfony plugin to optimize the Propel  
 queries and also the Propel hydrate method, improving even 5 times  
 query speed and also memory usage.

 The plugins supports joins and thanks to PHP features the plugin  
 returns Propel objects populated with custom AS columns.

 We are thinking on release it on the following weeks so stay tuned :)

 Regards,

 Alvaro

 On Mar 8, 2009, at 10:20 PM, Gareth McCumskey wrote:

  We have put numerous caching techniques into effect, from Cache-
  Expires headers to compression of static files like js and html  
  files. Currently we use symfony 1.1 and Propel as the ORM. We have  
  identified the bottleneck generally as being the application  
  processing after the db queries have run to extract the data.

  The entire point of my question was to get some info on general tips  
  and tricks we can try out to see if anything helps or if perhaps we  
  have missed any obvious issues that may actually be the cause of the  
  slow performance we are getting. As it is I have gotten quite a few  
  and look forward to getting into the office tomorrow to try them  
  out. Anymore is greatly appreciated.

  Of course I am looking through the code to see if there is anyway we  
  can streamline it on that end, but every little bit helps.

  Gareth

  On Sun, Mar 8, 2009 at 12:27 PM, Crafty_Shadow vankat...@gmail.com  
  wrote:

  Gareth, you didn't mention what version of symfony you were using,
  also what ORM (if any).
  The best course of optimization will depend on those. Also, as already
  mentioned, caching is your best friend.

  On Mar 8, 9:43 am, Gareth McCumskey gmccums...@gmail.com wrote:
   Well, consider a single database table that looks something like  
  this:

   From_address
   to_address (possibly multiple addresses comma-seperated)
   headers
   spam_report
   subject

   And we would have millions of those records in the database.  
  Repeated
   entries, especially on to_address, means the data is hugely  
  redundant. By
   normalising we are turning a text search across millions of  
  records with
   redundant repeated data into a text search over a unique list,  
  then an
   integer search over primary key (which of course is indexed).

   On Sun, Mar 8, 2009 at 9:37 AM, Lawrence Krubner  
  lkrub...@geocities.comwrote:

On Mar 8, 3:26 am, Gareth McCumskey gmccums...@gmail.com wrote:
 We had a speed increase because we had a lot of text searches  
  in the old
 system, all going through text fields where the same values  
  were repeated
 over and over. Its therefore a lot faster to search a much  
  smaller table,
 where the text fields are unique, and find the value once,  
  then use an ID
 comparison, being much faster to match integers than text.

In sounds like you got a speed boost from doing intelligent  
  indexing.
What you are describing sounds more like indexing than  
  normalization,
at least to 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: I can not get sfWidgetFormTextareaTinyMCE to work, even when I copy the examples straight from the Symfony website

2009-03-04 Thread Crafty_Shadow

A discussion about just this and other problems with
sfWidgetFormTextareaTinyMCE took place a few days ago here, next time
first search the mailing list please:

http://groups.google.com/group/symfony-users/browse_thread/thread/b4950dd116b8aa3e?hl=en


On Mar 4, 3:41 pm, Lawrence Krubner lkrub...@geocities.com wrote:
 On Mar 4, 4:51 am, Garakkio garak...@gmail.com wrote:

  My humble opinion: it's better to use directly javascript to get
  tinyMCE working.
  So, simple add a class=rich to yout textarea and write (and
  include it in your page, of course) a js like this one:

  tinyMCE.init({
    theme : advanced,
    mode: textareas,
    editor_selector : rich,
   // any options you like, 
  seehttp://wiki.moxiecode.com/index.php/TinyMCE:Configuration

  });

 Here is an odd thing. The controls are appearing at the bottom of the
 textarea. You can see a screenshot here:

 http://lawrence.sds5.com/text_editor_at_bottom.gif

 This is the script that I've defined in layout.php:

 script type=text/javascript
         tinyMCE.init({
                 theme : advanced,
                 mode: textareas,
                 editor_selector : rich_text_editor
         });
 /script

 Following your advice, this is how I defined the widget in my form
 class:

     $this-widgetSchema['description'] = new sfWidgetFormTextarea(array
 (), array('class' = 'rich_text_editor'));

 Any insight why the control is at the bottom of the textarea?
--~--~-~--~~~---~--~~
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: sfWidgetFormTextareaTinyMCE() not working

2009-02-27 Thread Crafty_Shadow

This is gonna be a pretty long, but here's my custom
sfWidgetFormTextareaTinyMCE.class.php
It works with TinyMCE 3 and up, and also produces fully XHTML
compatible output.
It also allows for gzip compression; Sample usage:

$this-widgetSchema['content']  = new
sfWidgetFormTextareaTinyMCE(array('tinymce_gzip' = true),array
('size'='102x30'));





class sfWidgetFormTextareaTinyMCE extends sfWidgetFormTextarea
{

  public function __construct($options = array(), $attributes = array
())
  {
  /**
  * We need to override the constructor in order to be able to remove
keys from the $attributes array;
  * if we don't remove the pseudo key 'size', it results in invalid
xhtml markup
  */
if (array_key_exists('size', $attributes))
{
  //This code handles textarea size input in 140x30 format
  list ($cols, $rows) = explode ('x', $attributes['size']);
  unset ($attributes['size']);
  $attributes['cols'] = $cols;
  $attributes['rows'] = $rows;
  $this-setAttributes($attributes);
}

parent::__construct($options, $attributes);
  }

  /**
   * Constructor.
   *
   * Available options:
   *
   *  ** Options **
   *  * theme:  The Tiny MCE theme
   *  * width:  Width
   *  * height: Height
   *  * config: The javascript configuration
   *  * tinymce_gzip: Wether to use gzip compression for TinyMCE
   *  * file_browser_callback:  a JS callback function for embending a
file browser into TinyMCE
   *  * content_css:  A css file that will be applied to the editor
window; Should be the same css as the one used in the real output
   *
   *  ** Attributes **
   *  * cols/rows or size: sets the size of the TinyMCE window; size
is used in the format: COLSxROWS (100x30)
   *
   * @param array $options An array of options
   * @param array $attributes  An array of default HTML attributes
   *
   * @see sfWidgetForm
   */
  protected function configure($options = array(), $attributes = array
())
  {
$this-addOption('theme', 'advanced');
$this-addOption('width');
$this-addOption('height');
$this-addOption('config', '');
$this-addOption('tinymce_gzip');
$this-addOption('file_browser_callback',
'sfAssetsLibrary.fileBrowserCallBack');
$this-addOption('content_css', '/js/tiny_mce/css/
default.css');

if (!$this-getAttribute('cols') || !$this-getAttribute('rows'))
{
  $this-setAttribute('cols', 140);
  $this-setAttribute('rows', 30 );
}
  }

  /**
   * @param  string $nameThe element name
   * @param  string $value   The value selected in this widget
   * @param  array  $attributes  An array of HTML attributes to be
merged with the default HTML attributes
   * @param  array  $errors  An array of errors for the field
   *
   * @return string An HTML tag string
   *
   * @see sfWidgetForm
   */
  public function render($name, $value = null, $attributes = array(),
$errors = array())
  {
// use tinymce's gzipped js?
$tinymce_file = $this-getOption('tinymce_gzip') ? '/
tiny_mce_gzip.js' : '/tiny_mce.js';

// tinymce installed?
$js_path = sfConfig::get('sf_rich_text_js_dir') ? '/'.sfConfig::get
('sf_rich_text_js_dir').$tinymce_file : '/sf/tinymce/js'.
$tinymce_file;
if (!is_readable(sfConfig::get('sf_web_dir').$js_path))
{
  throw new sfConfigurationException('You must install TinyMCE to
use this widget (see rich_text_js_dir in settings.yml).');
}

sfContext::getInstance()-getResponse()-addJavascript
($js_path);

$gz_init = '
  tinyMCE_GZ.init({
plugins :
safari,spellchecker,pagebreak,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager,
themes: simple,advanced,
languages: en,bg,
disc_cache: true,
debug: false
  });';


$js = sprintf(EOF
script type=text/javascript
//![CDATA[

  // Start section reserved for GZIP init
  %s
  // End section reserved for GZIP init

  tinyMCE.init({
mode:   exact,
elements:   %s,
theme:  %s,
language:   %s,
file_browser_callback:  %s,
content_css:%s,
%s  //width
%s  //height
plugins :
safari,spellchecker,pagebreak,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager,

// Theme options
theme_advanced_buttons1 :
bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect,styleselect,
theme_advanced_buttons2 :

[symfony-users] Re: sfWidgetFormTextareaTinyMCE() not working

2009-02-27 Thread Crafty_Shadow

This one is based off the original, with my custom patches. Original
didn't work for me either and it didn't have some of the functionality
I needed (esp generating XHTML valid code) so I went and created this
one.

There is only one thing I'm not happy with, and that's line 110, the
part of the GZip version that defines which languages to be included.
I should probably just rewrite that with sfContext::getInstance()-
getUser()-getCulture() instead of the current en/bg.

Taking into account the way symfony autoloading works, all you need to
do is create a sfWidgetFormTextareaTinyMCE.class.php file with the
widget in your lib folder. It superseeds the one in the
sfFormExtraPlugin. Also, this widget is thoroughly tested and is
working in several of my released applications. I could create
a .patch file for the sfFormExtraPlugin, but I don't think it'd make
it into the plugin. Probably if you guys support the changes ?



On Feb 27, 1:20 pm, Denis Fingonnet dfingon...@gmail.com wrote:
 Thanks for your custom widget.

 But I wish I could make the original sfWidgetFormTextareaTinyMCE works,
 because it is bundled with the sfFormExtraPlugin.

 I can say you're able to make it works and to provide a patch if there is a
 bug in it.

 Could you have a look or have you done a custom widget because you weren't
 able to make the original widget works ?

 On Fri, Feb 27, 2009 at 11:58 AM, Crafty_Shadow vankat...@gmail.com wrote:

  This is gonna be a pretty long, but here's my custom
  sfWidgetFormTextareaTinyMCE.class.php
  It works with TinyMCE 3 and up, and also produces fully XHTML
  compatible output.
  It also allows for gzip compression; Sample usage:

     $this-widgetSchema['content']      = new
  sfWidgetFormTextareaTinyMCE(array('tinymce_gzip' = true),array
  ('size'='102x30'));

  class sfWidgetFormTextareaTinyMCE extends sfWidgetFormTextarea
  {

   public function __construct($options = array(), $attributes = array
  ())
   {
   /**
   * We need to override the constructor in order to be able to remove
  keys from the $attributes array;
   * if we don't remove the pseudo key 'size', it results in invalid
  xhtml markup
   */
     if (array_key_exists('size', $attributes))
     {
       //This code handles textarea size input in 140x30 format
       list ($cols, $rows) = explode ('x', $attributes['size']);
       unset ($attributes['size']);
       $attributes['cols'] = $cols;
       $attributes['rows'] = $rows;
       $this-setAttributes($attributes);
     }

     parent::__construct($options, $attributes);
   }

   /**
    * Constructor.
    *
    * Available options:
    *
    *  ** Options **
    *  * theme:  The Tiny MCE theme
    *  * width:  Width
    *  * height: Height
    *  * config: The javascript configuration
    *  * tinymce_gzip: Wether to use gzip compression for TinyMCE
    *  * file_browser_callback:  a JS callback function for embending a
  file browser into TinyMCE
    *  * content_css:  A css file that will be applied to the editor
  window; Should be the same css as the one used in the real output
    *
    *  ** Attributes **
    *  * cols/rows or size: sets the size of the TinyMCE window; size
  is used in the format: COLSxROWS (100x30)
    *
    * @param array $options     An array of options
    * @param array $attributes  An array of default HTML attributes
    *
    * @see sfWidgetForm
    */
   protected function configure($options = array(), $attributes = array
  ())
   {
     $this-addOption('theme', 'advanced');
     $this-addOption('width');
     $this-addOption('height');
     $this-addOption('config', '');
     $this-addOption('tinymce_gzip');
     $this-addOption('file_browser_callback',
  'sfAssetsLibrary.fileBrowserCallBack');
     $this-addOption('content_css', '/js/tiny_mce/css/
  default.css');

     if (!$this-getAttribute('cols') || !$this-getAttribute('rows'))
     {
       $this-setAttribute('cols', 140);
       $this-setAttribute('rows', 30 );
     }
   }

   /**
    * @param  string $name        The element name
    * @param  string $value       The value selected in this widget
    * @param  array  $attributes  An array of HTML attributes to be
  merged with the default HTML attributes
    * @param  array  $errors      An array of errors for the field
    *
    * @return string An HTML tag string
    *
    * @see sfWidgetForm
    */
   public function render($name, $value = null, $attributes = array(),
  $errors = array())
   {
     // use tinymce's gzipped js?
     $tinymce_file = $this-getOption('tinymce_gzip') ? '/
  tiny_mce_gzip.js' : '/tiny_mce.js';

     // tinymce installed?
     $js_path = sfConfig::get('sf_rich_text_js_dir') ? '/'.sfConfig::get
  ('sf_rich_text_js_dir').$tinymce_file : '/sf/tinymce/js'.
  $tinymce_file;
     if (!is_readable(sfConfig::get('sf_web_dir').$js_path))
     {
       throw new sfConfigurationException('You must install TinyMCE to
  use this widget (see rich_text_js_dir in settings.yml).');
     }

     sfContext

[symfony-users] Re: sfWidgetFormTextareaTinyMCE() not working

2009-02-27 Thread Crafty_Shadow

Ticket with patch created, the rest is up to fabien:

http://trac.symfony-project.org/ticket/5986
--~--~-~--~~~---~--~~
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: sfWidgetFormTextareaTinyMCE() not working

2009-02-27 Thread Crafty_Shadow

For i18n you should edit the representative form class;
that is to say, in the main form, let's call it
StaticPageForm.class.php you need:

$this-embendI18n(array('en','fr')); //embends English and French
//set labels so it's clearer
$this-widgetSchema-setLabel('en', 'English');
$this-widgetSchema-setLabel('fr', 'French');


Then in StaticPageI18nForm.class.php

$this-widgetSchema['content'] = new sfWidgetFormTextareaTinyMCE etc


On Feb 27, 4:29 pm, Denis Fingonnet dfingon...@gmail.com wrote:
 Does the tinyMCE widget used for a I18n field ?

 Because I managed to make the widget work without changing anything.
 I was doing this for a translated field called texte :
         $this-widgetSchema['texte'] = new
 sfWidgetFormTextareaTinyMCE(array(
           'width'  = 550,
           'height' = 350,
           'config' = 'theme_advanced_disable: anchor,image,cleanup,help',
         ), array(
             'class' = 'tinyMCE'
         ));

 But if I do this :
         $this-widgetSchema['fr']['texte'] = new
 sfWidgetFormTextareaTinyMCE(array(
           'width'  = 550,
           'height' = 350,
           'config' = 'theme_advanced_disable: anchor,image,cleanup,help',
         ), array(
             'class' = 'tinyMCE'
         ));

 It works very well.
 So it is not a bug but a lack of documentation about I18n and widget or I
 didn't get it...

 And a bad error message.

 On Fri, Feb 27, 2009 at 2:28 PM, Denis Fingonnet dfingon...@gmail.comwrote:



  I'll keep an eye on it.

  Thank you

  On Fri, Feb 27, 2009 at 1:43 PM, Crafty_Shadow vankat...@gmail.comwrote:

  Ticket with patch created, the rest is up to fabien:

 http://trac.symfony-project.org/ticket/5986

  --
  Denis Fingonnet

 --
 Denis Fingonnet
--~--~-~--~~~---~--~~
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: sfWidgetFormTextareaTinyMCE() not working

2009-02-27 Thread Crafty_Shadow

I will assume that this question was directed to me.
And no, the library itself is not included, the insanely-big portion
of the code is dedicated to producing XHTML compliant output.

On Feb 26, 9:00 pm, Jan Schlosser j...@steffiundjan.de wrote:
 Hey,

 just out of curiosity: Did you include the TinyMCE Javascript (the  
 library) into the HTML source?

 Regards,
 Jan

 Am 26.02.2009 um 15:18 schrieb we-create:

  when i try to call this function with:

  'inhoudnl' = new sfWidgetFormTextareaTinyMCE(
       array(
         'width'=550,
         'height'=350,
         'config'='theme_advanced_disable:
  anchor,image,cleanup,help',
         'theme'   =  sfConfig::get('app_tinymce_theme','advanced'),
       )

  it shows this in the html:

       tr
         thlabel for=pagina_inhoudnlInhoudnl/label/th
         td
                     textarea class=tiny_mce name=pagina[inhoudnl]
  id=pagina_inhoudnllt;pgt;html hierlt;/pgt;/textareascript
  type=text/javascript
   tinyMCE.init({
     mode:                              textareas,
     theme:                             advanced,
     editor_selector:                   tiny_mce,
     width:                             550px,
     height:                            350px,
     theme_advanced_toolbar_location:   top,
     theme_advanced_toolbar_align:      left,
     theme_advanced_statusbar_location: bottom,
     theme_advanced_resizing:           true
     ,
  theme_advanced_disable: anchor,image,cleanup,help
   });
  /script        /td
       /tr

  but i don't get the content ... is this a known issue and does anyone
  knows a fix for 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-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: Using hyphens instead of forward slashes in routing?

2009-02-18 Thread Crafty_Shadow

Anyone ?
--~--~-~--~~~---~--~~
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] Using hyphens instead of forward slashes in routing?

2009-02-15 Thread Crafty_Shadow

I am wondering whether it is possible to use hyphens instead of or in
combination with forward slashes in symfony's routing. My question is
for both symfony 1.0 and 1.2 (I want to implement the feature in some
older web sites I'm managing as well as possibly use it for one of my
more recent projects).

For example, something like this:
www.site.com/category-3/article-10

with routing:

route_for_category_article:
  url: /offers/category-:category_id/article-:article_id
  param: { module: show, action: article }

(this here doesn't work of course)
--~--~-~--~~~---~--~~
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] jQuery 1.3 and Symfony

2009-01-20 Thread Crafty_Shadow

A new version of the popular javascript library was recently released
(14th of January) that introduces a particular change to the $
(document).ready function, namely it now MUST be used ONLY after all
css files have been loaded. The default sfCommonFilter class,
responsible for the inclusion of both css and js files includes js
files ahead of css.

Creating a custom common filter is a trivial task. I was wondering
though, is there any particular reason one would want to include js
files before css ? And on another note, shouldn't the default common
filter in symfony be altered to allow js files to be included at the
bottom of the page, a practice I find to be increasingly popular
recently.
--~--~-~--~~~---~--~~
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: Any good file handling plugin

2009-01-14 Thread Crafty_Shadow

Both of these plugins actually don't work with Symfony 1.2

Making them compatible isn't very hard, and even if one is new to the
system one should be able to manage, but it still would take some time

On Jan 14, 7:45 am, Ant Cunningham prodigital...@vectrbas-d.com
wrote:
 Did you look at sfAssetsLibrary and sfMediaLibrary?

 lsolesen wrote:
  On Jan 13, 11:33 pm, lsolesen lsole...@gmail.com wrote:
  Is there any file handling plugin for symfony, where you can easily
  handle file uploading etc. to use with a cms system?

  ... or to use with a home grown system, so you can easily add files to
  some of your own posts?

  --
  Lars

 --
 Ant Cunningham
 Graphic Designer | Web Developer
 Vector Based Design
 a...@vectrbas-d.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: I18N of sfWidgetFormChoice

2009-01-13 Thread Crafty_Shadow

I'm sorry, but you're a bit wrong here; it is not text to translate
that goes as the second argument, but instead the translation function
name

if a custom function is defined in the form class, it should be:
$this-widgetSchema-getFormFormatter()-setTranslationCallable
('myCustomTranslationFunction');

if it is facilitated by a separate class it must be:
1) for a static function:
$this-widgetSchema-getFormFormatter()-setTranslationCallable(array
('myI18nClass', 'myCustomTranslationFunction'));
2) for non-static function, as in the example given in the
documentation
$this-widgetSchema-getFormFormatter()-setTranslationCallable(array
(new myI18nClass(), 'myCustomTranslationFunction'));

On Jan 13, 9:06 am, Nicolas Perriault nperria...@gmail.com wrote:
 On Mon, Jan 12, 2009 at 4:59 PM, google goo...@yucai.de wrote:
  But it doesn't seem very clean to have to define the __() and getI18N
  () methods in the Form. Is there a better place to define these static
  choice strings? To me it appears that they are part of the model.

 You can define a translation callable by using:
 $widgetSchema-getFormFormatter()-setTranslationCallable(array(new
 myI18n(), 'text to translate'));

 More information herehttp://bit.ly/6sNm

 ++

 --
 Nicolas 
 Perriaulthttp://prendreuncafe.com-http://symfonians.net-http://sensiolabs.com
 Phone: +33 660 92 08 67
--~--~-~--~~~---~--~~
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: Setting the label for fields inside a i18n embedded form

2009-01-07 Thread Crafty_Shadow

You generally would want to do something like:
in the main form class:
$this-embendI18n(array('en','fr'));

$this-widgetSchema-setLabel('en', 'English');
$this-widgetSchema-setLabel('fr', 'French');

then in the i18n form class:

$this-widgetSchema-setLabels(array(
  'fileld_name1'='field_name1_label',
  'field_name2'='field_name2_label'
));

Lastly, in the generator.yml you could have something like:
display:
  General: [ name, profile_id, created_at]
  Language Specific: [ en, bg]

On Jan 6, 9:27 pm, jukea jkea...@gmail.com wrote:
 Hi,

 Is there a way to modify the labels of a i18n embedded form (Ideally,
 by using directly the generator.yml file)?

 ex :

 DB:

 my_fieldname1 : VARCHAR
 my_fieldname2 : VARCHAR

 FORM :

 English:     my_customized_fieldname1 [       ]
                   my_customized_fieldname2 [       ]

 French:     my_customized_fieldname1 [       ]
                   my_customized_fieldname2 [       ]

 Thanks!
--~--~-~--~~~---~--~~
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: Admin generator and ordered list

2009-01-06 Thread Crafty_Shadow

It should be possible to create custom actions for moving up/down (and
even batch move up/down ?) similar to the Classic method described in
the tutorial, while forcing the list to be sorted by the rank field.
Unfortunately I cannot point you to a specific tutorial for this, but
figuring it out with the forms and admin generator documentation
should be pretty straight-forward.

As for the AJAX method, I actually had it implemented with the Symfony
1.0 generator, but later abandoned it as I was not really happy with
the user interaction it provided. I would suggest against it, but if
you really want to, probably using jQuery to insert a handle for each
item will do the trick (and of course you have to take into account
the pagination). Using jQuery to insert the handle element will allow
for unobstructive approach, and will also be only visible to users
with JavaScript enabled.
--~--~-~--~~~---~--~~
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: Admin generator filters in sf 1.2

2009-01-06 Thread Crafty_Shadow

This is what I managed to come up with, any comments and suggestions
are welcomed.
It allows you to search multiple fields with the
'search'=array('first_name','last_name',),
at the end, where the names of the fields are easily defined.

Keep in mind that I am relatively new to the sfForms framework, and
this code is based sorely on 30 minutes looking through the classes
themselves

class UserFormFilter extends BaseUserFormFilter
{
  public function configure()
  {
// First we add the field to the filters
$this-widgetSchema['search'] = new
sfWidgetFormFilterInput(array('with_empty'=true),array());
$this-validatorSchema['search']  = new
sfValidatorPass(array('required' = false));
  }

  /**
  * @desc This function handles the criteria generation; it's format
is addXXXColumnCriteria, where XXX stands for your extra field
  * @param Criteria The Criteria object
  * @param String The field name, as defined by getFields
  * @param Array The validated values of the field as an associative
array
  */
  public function addSearchColumnCriteria(Criteria $criteria, $field,
$values)
  {
$all_fields = $this-getFields();
$cols = $all_fields[$field];  //get the array with the database
columns we will be searching through
foreach ($cols as $col)
{
  $colname = $this-getColName($col); //get the database coluomn
name
  if (is_array($values)  isset($values['is_empty'])  $values
['is_empty'])  //checks wether the is_empty checkbox was triggered
  {
$criterion = $criteria-getNewCriterion($colname, '');
$criterion-addOr($criteria-getNewCriterion($colname, null,
Criteria::ISNULL));
$criteria-add($criterion);
  }
  else if (is_array($values)  isset($values['text'])  '' !=
$values['text']) //else create the criterions
  {
$criterions[] = $criteria-getNewCriterion($colname,'%'.$values
['text'].'%', Criteria::LIKE);
  }
}
if (isset($criterions)) //and add them to the criteria
{
  for ($i=1; $icount($criterions); $i++)
$criterions[0]-addOr($criterions[$i]);
  $criteria-add($criterions[0]);
}
  }

  /* Finally we need to manually insert our field here, and yes, this
is INSANELY ugly.
 If you take a look at the base filter class you will see
something like:
  public function getFields()
  {
return array(
  'id'   = 'Number',
  'name' = 'Text',
  'created_at'   = 'Date',
  'sf_guard_user_profile_id' = 'ForeignKey',
);
  }
  */
  public function getFields()
  {
return array_merge(array(
'search'=array('first_name','last_name',),
  ), parent::getFields()
);
  }

}

On Jan 6, 4:34 am, gestadieu gestad...@gmail.com wrote:
 Maybe I can formulate in a simpler way:
 in sf1.0 to add complex filters in admin generator, we simply create
 the partial and extend the addFilterCriteria() method in the admin
 generator module. This allow us to filter with foreign keys or any
 kind of filtering as long as you can create the Propel criteria.
 Now my problem is to understand how to do this in sf1.2 with the new
 form framework (not mentioning that I want to use Doctrine on top of
 this ;-).

 On Jan 3, 10:50 pm, gestadieu gestad...@gmail.com wrote:

  Yes I thought about using lucene but actually this is not really my
  problem. What I am trying to understand is how to customize filters in
  admin generator. It is easy to add filter for model attributes but I
  still do not understand yet how to go further than that, theorically I
  understood that I must use the filter form class.
  I do not have any experience yet with Doctrine but even if I use
  Propel my question would be the same. The ORM is not actually my main
  issue. Doctrine is quite good already, I just wish that we can find
  more info/tutorial/example for filter usage.

  Thx anyway for your comment.

  On Jan 2, 8:38 pm, zero0x zero0...@gmail.com wrote:

   Hm maybe you want to look at the Doctrine docs..

   For search you can also use Zend Lucene, which is described in Jobeet
   tutorial, day 17 (http://www.symfony-project.org/jobeet/1_2/Doctrine/
   en/17)

   On 2. Jan, 10:28 h., gestadieu gestad...@gmail.com wrote:

Hi all,

I am working on a project with sf 1.2 and Doctrine (new to me) and for
the backend I need to have a kind of live search (something similar
to Google Suggest).
My idea to achieve this is to create a customized filter text input
field with a partial, add to it some jQuery for the ajax part. This is
the easy part!
Forget about the ajax part, what I am looking for, is how to make the
filter on the server side, meaning how to customize my filter form
class to add a criteria in the query ( -buildQuery($this-getFilters
()) ) which is not based on a db field but a virtual field.
Basically what I want to add to my global filter criteria is something
like  and