[symfony-users] How do I exclude a directory from config scan?
The problem is that I have my deployment cache in my ./build folder and symfony is loading the config file from that folder every time the kernel is booted. Cannot import resource "'database_dev.yml'" from "'/home/jesse/ myProject/build/cached-copy/app/config/config_dev.yml'". Is there some silver bullet config parameter that lets me exclude directories from being scanned for config files? Thanks, Jesse -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Reduce coupling in entities
I've never had any success with extending entities because you always end up with a class that cant be used after you extend the entity. I see a lot of people using "Base" entities which is essentially the same thing as a model which an entity extends. Create a mapped super class which inherits your user model. Then create the entity to extend that mapped super class. In the mapped super class create mapping between your entity and user model. You don't need the oneb ut it's nice to have a mapping layer in between them in case the apps use different variable names. //Models/User.php namespace Models; /** @MappedSuperclass */ class User { protected $username; protected $userid; protected $groups; public function __call($method, $args) { if (strpos($method, 'get') === 0) { return $this->get(substr($method, 3)); } else if (strpos($method, 'set') === 0) { $this->set(substr($method, 3), $args[0]); } else { throw new \Exception('Method '.$method.' not found in class: ' . get_class($this)); } } public function get($name) { return $this->{strtolower($name)}; } public function set($name, $value) { $this->{strtolower($name)} = $value; } } //Entities/User.php namespace Entities; /** * User * * @Table(name="user") * @Entity */ class User extends \Models\User { public function __construct() { //parent::__construct doesn't exist by default //it only exists if it's explicitly defined if (is_callable('parent::__construct')) { parent::__construct(); } //set up default collections so it doesn't break on empty instantiation $this->groups = new \Doctrine\Common\Collections \ArrayCollection(); } /** * @var integer $id * * @Column(name="id", type="integer", nullable=true) * @Id * @GeneratedValue(strategy="IDENTITY") */ protected $id; /** * @var string $name * * @Column(name="name", type="string", length=16, nullable=false) */ protected $name; } On May 23, 5:06 pm, Problematic wrote: > I'm looking for an appropriate way to reduce coupling in a messaging bundle > I'm writing, so that I can easily use it between applications. > > Each instance of the Message entity should have a sender and a recipient, > instanceof Symfony\Component\Security\Core\User\UserInterface, which I can > require just fine in the setters for the properties. However, in setting up > the ORM relationships, it seems that I have to specifically set a > targetEntity (Foo\BarBundle\Entity\User, for example), which means that all > further uses of the Message entity in different applications will either > require a code change, or shoehorn them into using a User entity, which > doesn't seem to me to be in a messaging bundle's scope to require. > > Any suggestions/best practices on how I can reduce coupling in this > instance? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] [SF2] [forms] disabled attribute is needed -- distinction between read_only and disabled
My company is re-doing our online forms with symfony2 and we've run into a particular problem in the way that it handles disabled fields aka read_only. The problem, as we see it, is that often, some form fields need to start out as disabled, but later based on user input, those form fields may need to have user data binded to it, which is impossible (very tricky) if the field is rendered with read_only. Take for example, we have a form that needs the military affiliation only to be displayed, when certain occupational choices are selected. If military is enabled out of context, it will be detrimental to our business and therefore we cannot make military enabled by default, however if the user picks certain occupational choices, military affiliation is required, and therefore if it is rendered as read_only, it cannot be bound when the user submits the form, and therefore is also a problem for our business. I am not looking for suggestions on how to produce this effect with presentation and post rendered javascript solutions. I am trying to point out that there is a flaw in producing a semantically correct document with the current forms implementation as I see it. I suggest that there should be a way to flag a field as disabled, without making it read_only. Currently, the only way that I see of flagging a field as disabled is by making it read_only which I think there should be some distinction of purpose between the two terms. Thanks, Jesse -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Symfony Meetup tonight in NYC with Jonathan Wage of Doctrine. Topic is his Mongo (odm) and working with Mongo and Doctrine
Free Pizza and Beer/Soda will be provided. As well as door prizes! Come fill your brain and your stomach! Nov18 Thu 7:00 PM Meetup HQ 632 Broadway FLR DIEZ NY, NY 10012 More info available: http://www.meetup.com/Symfony-NYC/calendar/15221720/ -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Symfony now powering Startrek.com
I would like to announce that Symfony is now under the hood of the freshly re-launched startrek.com. Complete with a welcome letter from Leonard Nimoy himself the new Startrek.com is running on a custom Symfony backed CMS and frontend applications sitting on top of Doctrine and mysql and behind Varnish and Nginx. The bulletin boards which are really the focus of the fan base are a heavily modified version of the sfSimpleForum plugin and sfGuard is used for all authentication. A large portion of the development effort was actually spent on data migration and getting the old IKON/oracle based community content to play nice with our lovely Symfony driven app. If anyone is in the new york city metro area and would like to hear more about the history of this project from start to finish including detailed technical info on the migration and customization efforts please join the Symfony NYC meetup group tomorrow at 7pm in manhattan. More info is provided here: www.meetup.com/symfony-nyc "Live Long and Prosper" Symfony community, Jesse Sanford and the NYC-Symfony user group. P.S. we got a call out on the late show (start at 7:20): http://www.nbc.com/the-tonight-show/video/thursday-july-15-2010/1239193/ -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Symfony NYC user group
I did a bit of searching and could not for the life of me find a Symfony user group in the new york metro area. So I started one. How many users on this list are interested in meeting every once in a while to discuss Symfony and related topics? http://www.meetup.com/symfony-nyc http://www.facebook.com/pages/New-York-NY/Symfony-NYC/275705216620 I look forward to any and all help/suggestions/comments. 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-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 declare an array of input field with sfForm?
One way to do this is with embedded forms. A good example is available at http://trac.symfony-project.org/ticket/4906#comment:13, but here's a quick rundown of it: $form = new sfForm(); for ($i = 1; $i <= 5; $i++) { $form->widgetSchema[$i] = new sfWidgetFormInputFile(); $form->widgetSchema->setLabel($i, 'File ' . $i); } $this->embedForm('upload', $form); $this->widgetSchema->setLabel('upload', 'Upload files'); How this will look in the view (you can use the debug inspector in 1.3) is there'll be a field $form['upload'], and then each file widget will be $form['upload'][1] through $form['upload'][5]. You can also start with just one input widget and then use jQuery to add more input widgets to the embedded form (I can't give an example right now because I'm still figuring out how to do this). A couple more pages with some good discussion on embedded forms: http://blog.barros.ws/2009/01/01/using-embedformforeach-in-symfony-part-ii/ (focuses on multiple embedded forms using embedFormForEach, but still a good overview of the concept) http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin --jbh Jesse B. Hannah On Nov 14, 1:02 pm, Sid Bachtiar wrote: > Hi, > > How to declare an array of input field in sfForm? Is this where > embedded form come in? > > In this case I want to use jquery MultiUpload library but it works by > creating upload fields with the same field name, so when the form is > uploaded, it will be as array. > > Cheers, > > Sid > -- > 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] fcgi apache mod_rewrite problems aka No Input file specified.
So we have the following problem when trying to switch over to fcgi rather than mod_php I can get all normal symfony routes etc working fine. The only issue is when we try to do special rewrites for certain paths using mod_rewrite. For instance: (from .htaccess in the webroot) RewriteRule ^celebrities/$ index.php/celebrities [L] What I think happens is that fcgi is set to catch anything ending in .php Mod_rewrite catches that url and then redirects apache to index.php/celebrities When that happens apache fires off the fcgi process to parse index.php/ celebrities Then php responds with: "No Input file specified." Meaning it can't find the php file I have tried forcing php to look for the index.php file in the webroot by setting the doc_root="/usr/local/apache2/htdocs/web" variable in the php.ini but that didn't do anything. I have also tried to set the cgi.fix_pathinfo=1 also in the php.ini (tried both 1 and 0) And the FcgidFixPathinfo 1 in the httpd.conf (again tried both 1 and 0) And that didn't help either. I think that php is finding the docroot fine though because going to normal index.php or any route in symfony that does not have a mod_rewrite rule pointing it to So we have the following problem when trying to switch over to fcgi rather than mod_php I can get all normal symfony routes etc working fine. The only issue is when we try to do special rewrites for certain paths using mod_rewrite. For instance: (from .htaccess in /www/web/) RewriteRule ^celebrities/$ index.php/celebrities [L] What I think happens is that fcgi is set to catch anything ending in .php Mod_rerite catches that url first and then redirects apache to index.php/celebrities When that happens apache fires off the fcgi process to parse index.php/ celebrities Then php responds with: No Input file specified. Meaning it can't find the php file I have tried forcing php to look for the index.php file in the webroot by setting the doc_root=/usr/local/apache2/htdocs/web Variable but that didn't do anything. I have also tried to set the cgi.fix_pathinfo=1 in the php ini (tried both 1 and 0) And the FcgidFixPathinfo 1 in the httpd.conf (again tried both 1 and 0) And that didn't help either. I think that php is finding the docroot fine though because going to normal index.php or any route in symfony that does NOT have a mod_rewrite rule pointing it to index.php/blah works fine. I can only imagine that php is confused by the index.phpSLASH (SLASH being / obviously) Other people (using other frameworks software etc that use a querystring ie index.php?path=blah are able to use the above settings successfully albeit in a number of different combinations. All of which I have tried) Is there anyway to get symfony to work somehow with a ? Rather than a / when NOT using "pretty/clean/nice/short" urls Like could we setup symfony to recognize index.php?path=celebrities I think if we can do that we are golden. FYI the reason for the mod_rewrite rules in the first place is because there are also DIRECTORIES in the webroot that have the same name as those paths ie "/www/web/celebrities/". So without the rewrite rules apache throws a blank page because there is no index file in those directories. works fine. I can only imagine that php is confused by the index.phpSLASH (SLASH being / obviously) Other people (using other frameworks software etc that use a querystring ie index.php?path=blah are able to use the above settings successfully albeit in a number of different combinations. All of which I have tried) Is there anyway to get symfony to work somehow with a ? Rather than a / when NOT using "pretty/clean/nice/short" urls Like could we setup symfony to recognize index.php?path=celebrities FYI the reason for the mod_rewrite rules in the first place is because there are also DIRECTORIES in the webroot that have the same name as those paths ie "/www/web/celebrities/". So without the rewrite rules apache throws a blank page because there is no index file in those directories. --~--~-~--~~~---~--~~ 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: Synfony with smarty
In the plugins config directory there is a file settings.yml this file MUST BE all: smarty: helpers: [SmartyEscaping, SmartyJavascript, SmartyTag] this should NOT be changed. Your applications settings.yml should also have a minimum set of helpers standard_helpers: [Partial, Cache, Form] should probably be minimum. On Jan 5, 1:47 pm, Pavel wrote: > Guys, > > This is problem is due to a bug when no smarty helpers are loaded. > The workaround is to load some helpers even if you do not need to, add > the following line to settings.yml: > smarty_helpers: [AppUrl, Helper] > > Pavel > > On Jan 5, 6:42 pm, Jesse wrote: > > > Hi Saad, > > > Im the current lead developer of the smarty plugin. > > > I dont see your Symfony library path in that error which seems to be > > the problem. I have symfony installed as an external under project > > root/lib/vendor/symfony > > > the helper folder is project root/lib/vendor/symfony/lib/helper > > > im looking at your paths and I dont see your symfony data directory. > > Its not in your path. > > > Jesse > > > On Jan 5, 4:21 am, saad wrote: > > > > Dearest all, > > > > 1) I m using symfony1.2.1 and i configured smarty plugin for 1.2 from > > > this link > > > http://www.symfony-project.org/plugins/sfSmartyPlugin > > > symfony plugin:install sfSmartyPlugin --release=0.3.0 > > > > 2) I did change in app.xml and paste these lines > > > # default values > > > all: > > > sfSmarty: > > > class_path: lib/vendor/smarty/libs > > > template_extension: .tpl > > > template_security: false > > > > 3) Also paste smarty in project root lib/vendor/ > > > > 4) Then i create module file in my specific module/config/ > > > module.yml and paste these lines > > > default: > > > view_class: sfSmarty > > > partial_view_class: sfSmarty > > > > 5) Also did change layout.php into layout.tpl but it gived > > > error . > > > > Unable to load "Helper.php" helper in: /var/www/media/apps/ > > > frontend/lib/helper, /var/www/media/lib/helper, /var/www/media/lib/ > > > symfony/plugins/sfProtoculousPlugin/lib/helper, /var/www/media/plugins/ > > > sfSWFUploadPlugin/lib/helper, /var/www/media/plugins/sfSmartyPlugin/ > > > lib/helper, /var/www/media/lib/symfony/helper, /var/www/media/lib/ > > > symfony/plugins/sfPropelPlugin/lib/vendor, /var/www/media, /var/www/ > > > media/lib/symfony, ., /usr/share/php, /usr/share/pear. > > > > plz help me that how i run my application using smarty . > > > > Is it version problem or other > > > > plz explain it and also reply on this email id s...@softmatics.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: a question about smarty plugin
Asif, Make sure that the Symfony library is in your projects path. If it cant finder your symfony helpers then its because you dont have Symfony as part of your path. Jesse On Jan 5, 2:46 am, Asif wrote: > i have installed the symfony version 1.2.1 on my server and also > Smarty Plugin --release=0.2.3 for symfony but it is not working... i m > facing some errors like "it is not able to load helper.php " from > almost 10 paths..so plz help me that what is the problem > > regards --~--~-~--~~~---~--~~ 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: Synfony with smarty
Hi Saad, Im the current lead developer of the smarty plugin. I dont see your Symfony library path in that error which seems to be the problem. I have symfony installed as an external under project root/lib/vendor/symfony the helper folder is project root/lib/vendor/symfony/lib/helper im looking at your paths and I dont see your symfony data directory. Its not in your path. Jesse On Jan 5, 4:21 am, saad wrote: > Dearest all, > > 1) I m using symfony1.2.1 and i configured smarty plugin for 1.2 from > this link > http://www.symfony-project.org/plugins/sfSmartyPlugin > symfony plugin:install sfSmartyPlugin --release=0.3.0 > > 2) I did change in app.xml and paste these lines > # default values > all: > sfSmarty: > class_path: lib/vendor/smarty/libs > template_extension: .tpl > template_security: false > > 3) Also paste smarty in project root lib/vendor/ > > 4) Then i create module file in my specific module/config/ > module.yml and paste these lines > default: > view_class: sfSmarty > partial_view_class: sfSmarty > > 5) Also did change layout.php into layout.tpl but it gived > error . > > Unable to load "Helper.php" helper in: /var/www/media/apps/ > frontend/lib/helper, /var/www/media/lib/helper, /var/www/media/lib/ > symfony/plugins/sfProtoculousPlugin/lib/helper, /var/www/media/plugins/ > sfSWFUploadPlugin/lib/helper, /var/www/media/plugins/sfSmartyPlugin/ > lib/helper, /var/www/media/lib/symfony/helper, /var/www/media/lib/ > symfony/plugins/sfPropelPlugin/lib/vendor, /var/www/media, /var/www/ > media/lib/symfony, ., /usr/share/php, /usr/share/pear. > > plz help me that how i run my application using smarty . > > Is it version problem or other > > plz explain it and also reply on this email id s...@softmatics.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: disable smarty
you can try to create a module.yml for the specific module you want to disable smarty.. set all: view_class: sfPHP On Dec 22, 5:56 am, Prashanth wrote: > Hi, > > I am working on a project where people has used smaty for the > view class, I want to disable that for specific or the new module. How > to do that? > > app.yml: > > all: > sfSmartyView: > class_path: /usr/local/apache/htdocs/smarty/libs > template_extension: .htm > > module.yml > > all: > view_class: sfSmarty > > -- > regards, > > Prashanth --~--~-~--~~~---~--~~ 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] Sf1.2 and setDefault .. on page refresh the value doesnt get reset.. is this a browser issue?
OK so here is the problem.. I have a simple country / state selector .. $this->setWidget('state_id', new sfWidgetFormDoctrineSelect(array( 'model' => 'State', 'query' => Doctrine_Query::create()->from('State')->where ('country_id = ?', DEFAULT_COUNTRY_ID) ))); $this->object->setCountryId(DEFAULT_COUNTRY_ID); $this->setDefault('country_id', DEFAULT_COUNTRY_ID); using ajax.. upon selection of a country.. states dropdown gets updated.. easy. The problem here is when I hit refresh for the page.. the setDefault for country_id has no effect.. the country will show for instance US .. but the states listed will be for Canada. Could this be a browser issue? i have only tried this on Firefox (3.0.5) . On first page hit though.. the correct country is defaulted.. Canada. If I change this .. then hit page refresh.. the selected Country is the one before I hit refresh.. but the states is updated to back to default... Any help is appreciated.. cheers --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---