[symfony-users] Re: Easiest way to filter HTML inputs
If you want to whitelist certain type of tags and attributes look into HTMLPurifier(http://htmlpurifier.org/). Brian Adrien Mogenet wrote: > Hi everyone, > > I was wondering what's the better way (or the easier) to filter HTML > inputs ? > I mean, users can in a form submit inputs like this : > "foobar" > > Comments are welcome ! > > -- > Adrien > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Help with sfDoctrineGuard [SOLVED]
Just an update to this, Lee's advice fixed my first question. My second question(fixture load error) was because in my schema.yml file, I had defined email's type as a varchar instead of a string. Whoops! Apparently that doesn't cause an error, *and* creates the proper field. You just can't save anything into it via Doctrine :) *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.com> Lee Bolding wrote: > At a guess, I'd say your foreign key reference doesn't work because > it's the primary key in your sf_guard_user_profile. > > Create an id column, and then I think it will start working (you can > always make user_id unique if you want only 1 profile per user). > > On 4 Mar 2009, at 23:56, Brian Racer wrote: > > >> I have used sfGuard before, but I would like to start taking >> advantage of Doctrine. I installed sfDoctrineGuard and followed the >> README and got a basic setup working. Next I wanted to add a custom >> profile. The README docs still use the Propel schema format, so I >> created this: >> >> sfGuardUserProfile: >> actAs: { Timestampable: ~ } >> tableName: sf_guard_user_profile >> columns: >> user_id: { type: integer, primary: true } >> email: { type: varchar(128), notnull: true } >> relations: >> sfGuardUser: >> local: user_id >> foreign: id >> onDelete: CASCADE >> >> This works, but no foreign reference is setup for that table. Any >> ideas why that is? >> >> Next I created a fixture for the profile: >> >> sfGuardUserProfile: >> admin_profile: >> user_id: 1 >> email: f...@bar.com >> >> When I run ./symfony doctrine:build-all-reload I receive the >> following error message: >> >> Validation failed in class sfGuardUserProfile >> 1 field had validation error: >> * 1 validator failed on email (type) >> >> If I remove the email from the fixture(and set emails to allow null) >> a row gets inserted. If I manually try and insert those values into >> the database they get inserted. >> >> So if anyone can shed some light one why this fixture doesn't work, >> and why the foreign key reference doesn't get inserted I would >> appreciate it! >> >> -- >> Brian Racer >> Lead Developer >> JetPack Web Development, LLC >> (715) 834-3349 office >> br...@jetpackweb.com >> >> >> > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: Help with sfDoctrineGuard
That fixed it. I actually tried that before, but would get SQL errors adding the foreign key. I realized Doctrine's integer default is BIGINT on mysql, so I changed it to integer(4) and it worked. The fixture still gets the same error though. There are two lines that stand out to me in the base class that gets generated: $this->hasColumn('email', 'varchar', 128, array('type' => 'varchar', 'notnull' => true, 'length' => '128')); $this->option('attributes', array('export' => 'all', 'validate' => true)); I don't really see why my fixture would be failing validation(all fixtures load in except the sfGuardUserProfile one), but I also don't really understand what validation is going on. *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.com> Lee Bolding wrote: > At a guess, I'd say your foreign key reference doesn't work because > it's the primary key in your sf_guard_user_profile. > > Create an id column, and then I think it will start working (you can > always make user_id unique if you want only 1 profile per user). > > On 4 Mar 2009, at 23:56, Brian Racer wrote: > > >> I have used sfGuard before, but I would like to start taking >> advantage of Doctrine. I installed sfDoctrineGuard and followed the >> README and got a basic setup working. Next I wanted to add a custom >> profile. The README docs still use the Propel schema format, so I >> created this: >> >> sfGuardUserProfile: >> actAs: { Timestampable: ~ } >> tableName: sf_guard_user_profile >> columns: >> user_id: { type: integer, primary: true } >> email: { type: varchar(128), notnull: true } >> relations: >> sfGuardUser: >> local: user_id >> foreign: id >> onDelete: CASCADE >> >> This works, but no foreign reference is setup for that table. Any >> ideas why that is? >> >> Next I created a fixture for the profile: >> >> sfGuardUserProfile: >> admin_profile: >> user_id: 1 >> email: f...@bar.com >> >> When I run ./symfony doctrine:build-all-reload I receive the >> following error message: >> >> Validation failed in class sfGuardUserProfile >> 1 field had validation error: >> * 1 validator failed on email (type) >> >> If I remove the email from the fixture(and set emails to allow null) >> a row gets inserted. If I manually try and insert those values into >> the database they get inserted. >> >> So if anyone can shed some light one why this fixture doesn't work, >> and why the foreign key reference doesn't get inserted I would >> appreciate it! >> >> -- >> Brian Racer >> Lead Developer >> JetPack Web Development, LLC >> (715) 834-3349 office >> br...@jetpackweb.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] Help with sfDoctrineGuard
I have used sfGuard before, but I would like to start taking advantage of Doctrine. I installed sfDoctrineGuard <http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin/3_0_0> and followed the README and got a basic setup working. Next I wanted to add a custom profile. The README docs still use the Propel schema format, so I created this: sfGuardUserProfile: actAs: { Timestampable: ~ } tableName: sf_guard_user_profile columns: user_id: { type: integer, primary: true } email: { type: varchar(128), notnull: true } relations: sfGuardUser: local: user_id foreign: id onDelete: CASCADE This works, but no foreign reference is setup for that table. Any ideas why that is? Next I created a fixture for the profile: sfGuardUserProfile: admin_profile: user_id: 1 email: f...@bar.com When I run ./symfony doctrine:build-all-reload I receive the following error message: Validation failed in class sfGuardUserProfile 1 field had validation error: * 1 validator failed on email (type) If I remove the email from the fixture(and set emails to allow null) a row gets inserted. If I manually try and insert those values into the database they get inserted. So if anyone can shed some light one why this fixture doesn't work, and why the foreign key reference doesn't get inserted I would appreciate it! -- *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.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: sfErrorLoggerPlugin
Does it fix the issue of trying to serialize a PDO instance(sfDatabaseException I think)? *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.com> Lee Bolding wrote: > It already is working with Symfony 1.2 > > Has been since version 1.0.4. > > What specifically did you change? create a patch and send it to me, I'll QA, > apply and test. > > - Original Message - > From: "Jan De Coster" > To: symfony-users@googlegroups.com > Sent: Monday, 2 March, 2009 1:50:15 PM GMT +00:00 GMT Britain, Ireland, > Portugal > Subject: [symfony-users] sfErrorLoggerPlugin > > > Hi, > > I made some adjustments at the plugin so it's 1.2 ready ... is there > anyway to get this in the working repo's ? > > > Kr, > Jan De Coster > > > > > > --~--~-~--~~~---~--~~ 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: a blank white screen
There is sfErrorLogger <http://www.symfony-project.org/plugins/sfErrorLoggerPlugin> and sfDoctrineErrorLogger <http://www.symfony-project.org/plugins/sfDoctrineErrorLoggerPlugin>. However when I was testing sfErrorLogger with Propel(Symfony 1.2 and Propel 1.3), it would break with database exceptions since it would try and serialize the exception object which contained a PDO instance which you cannot do. I posted this to the dev mailing list <http://groups.google.com/group/symfony-devs/browse_thread/thread/8fb331f2171474a0?hl=en&q=%22brian+racer%22#a0d15f1b7f600cf9>, but it never received any response. *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.com> Sid Bachtiar wrote: >> "Exception in sfCache". So? What should I do with that info? It took >> me a while to figure out what the real problem was - a permissions >> conflict. >> > > So, you should get stack trace rather than just short error like that! > Your user should not see any error (which is what sfErrorHandlerPlugin > does) but you as developer should see the stack trace. > > Look at Firefox, IE, and etc ... they all have a feature that when it > crash, it will try to send stack trace back to the developer. > > Why? Because there is no way you can ever 100% test your application > for every possible situations, so when it crash or throw error, the > stack trace is very valuable information to developer. > > On Sat, Feb 28, 2009 at 4:49 PM, Lawrence Krubner > wrote: > >> >> On Feb 27, 8:57 pm, Sid Bachtiar wrote: >> >>> I think log4php is not really needed as symfony has built in logging >>> capability. But sending error to an email address is definitely >>> missing from Symfony. >>> >>> Any website owner would want to know if there's an error on their >>> website because it would affect their users/visitors. >>> >> It is simple to write a cron job to sift through the error logs and >> send you an email when there is an error on your site. I've written >> such scripts before, they generally take me 15 to 30 minutes, >> depending on the number of if() conditions I need to add. >> >> Or you can simply make it a habit to look at your error logs. Big >> sites normally have a programmer or sysadmin who is watching that kind >> of stuff. >> >> But in the end, the result is always the same. No matter whether you >> use a plugin, a cron script, or if you manually look at the error logs >> - you still end up seeing the same error message either way. And, at >> least for me, the error message was almost useless. It was cryptic - >> "Exception in sfCache". So? What should I do with that info? It took >> me a while to figure out what the real problem was - a permissions >> conflict. >> >> >> >> >> >> >> >> >> >> >> >>> On Sat, Feb 28, 2009 at 2:50 PM, Lee Bolding wrote: >>> >>> >>>> I started thinking about that - look in SVN, and you'll see I started >>>> adding Log4PHP ;) >>>> >>>> I never got round to finishing it though. Ideally, Log4PHP wouldn't be >>>> integrated in this plugin anyway - it would be another plugin to >>>> dynamically replace Symfony's built in logging classes... a job for >>>> another day ;) >>>> >>>> At the moment it works as-is - I'm concerntrating on >>>> sfDynamicFormsPlugin at the moment :) >>>> >>>> On 28 Feb 2009, at 00:36, Sid Bachtiar wrote: >>>> >>>>> Hey, that's a nice plugin! >>>>> >>>>> One very very useful feature that could be added is send stack trace >>>>> error to an email address, e.g.: when there's error (any error), send >>>>> email to the developer/admin. >>>>> >>>>> On Sat, Feb 28, 2009 at 1:28 PM, Lee Bolding wrote: >>>>> >>>>>> Or, install sfErrorHandlerPlugin >>>>>> >>>>>> http://www.symfony-project.org/plugins/sfErrorHandlerPlugin >>>>>> >>>>>> :) >>>>>> >>>>>> On 28 Feb 2009, at 00:21, Lawrence Krubner wrote: >>>>>> >>>>>>> What a mess. >>>>>>> >>>>
[symfony-users] Re: Validating rich text?
I don't know of any validator included with symfony that does that, but it wouldn't be hard to create your own in conjunction with the HTML Purifier <http://htmlpurifier.org/>. *Brian Racer * Lead Developer JetPack Web Development, LLC (715) 834-3349 office br...@jetpackweb.com <mailto:br...@jetpackweb.com> Sid Bachtiar wrote: > Hi all, > > When using rich text input, is there a validator that makes sure the > html tags used are only those enabled? > > Regards, > > Sid > > > > --~--~-~--~~~---~--~~ 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 error
Couldn't you just use a Pager if you still want to use propel? Something like: $batchSize = 500; $pager = new sfPropelPager('ModelClass', $batchSize); $pager->setCriteria(new Criteria()); $keepGoing = true; $currentPage = 1; while($keepGoing) { $pager->setPage($currentPage); $pager->init(); foreach($pager->getResults() as $item) { ... process items ... } if($currentPage >= $pager->getLastPage()) { $keepGoing = false; } $currentPage++; } That was typed from memory, but you get the idea. Brian Racer Jetpack LLC http://jetpackweb.com Eno wrote: > On Nov 13, 8:10 am, Sumedh <[EMAIL PROTECTED]> wrote: > > >> Yeah...sorry about the foolish question... >> >> Actually, I am doing exactly that since beginning...I have used Creole >> directly to fire queries and the used the resultset returned...I am >> not hydrating using Propel at all... >> > > Maybe you could get a count first, then loop through them and do the > query in smaller batches by setting a LIMIT in the SQL query? > > > -- > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: /SF
Copy the contents of /usr/share/php/data/symfony/web/sf into [your_project]/web/sf Brian Racer Jetpack LLC http://jetpackweb.com roberto german puentes diaz wrote: > How, only use PHP, in ProjectConfiguration class, we can avoid use > Alias /sf /usr/share/php/data/symfony/web/sf > and continue use styles and images of my SF installation ? > > -- > Cr. Puentes Diaz > MP 10.12726.9 > Córdoba - Argentina > > www.puentesdiaz.com.ar/blog/ <http://www.puentesdiaz.com.ar/blog/> > www.puentesdiaz.com.ar/blog/novedades > <http://www.puentesdiaz.com.ar/blog/novedades> > www.puentesdiaz.com.ar/blog/curriculum-vitae > <http://www.puentesdiaz.com.ar/blog/curriculum-vitae> > Linux User n° 441474 > Ubuntu/Symfony/Eclipse Rocks! > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---