Re: [symfony-users] Doxygen Annotations Broken in Beta2
Put an @IgnoreAnnotation(fn) in the doc comment of the class where this annotation is used. Johannes On Mon, May 23, 2011 at 5:05 PM, Roger Webb webb.ro...@gmail.com wrote: Hey Everyone, I'm using Doxygen for my documentation generation. I updated to Beta2 and fixed all of the Doctrine annotations as described in the Update Document and found that all of my doxygen annotations are causing an exception to be thrown: [Semantical Error] The annotation @fn in method ARN\UserBundle \Controller\UserController::loginAction() was never imported. Any ideas on a workaround? Roger -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Doxygen Annotations Broken in Beta2
As I said, you need to put it in the doc comment of the _class_ even if @fn is used in a method of that class. I understand that it might be a bit tedious to update your code at first, but being a bit stricter in the parsing process allows us to catch errors early on. This will reduce the time that you spend with searching for missing imports, typos, or just sitting there wondering why something doesn't work. Johannes On Mon, May 23, 2011 at 5:26 PM, Roger Webb webb.ro...@gmail.com wrote: The comment in question is below. This is still throwing the same error. Also, it's generating this error based on the method. Will I have to put this annotation in every comment block that uses the fn annotation, or just in the first comment of the file? For the developers, it would IMHO be best if the Symfony/Doctrine annotations were namespaced and did not adversely affect annotations from other projects. /** * @IgnoreAnnotation(fn) * @fn loginAction * */ Thank you for your help, Roger On May 23, 10:17 am, Johannes Schmitt schmitt...@gmail.com wrote: Put an @IgnoreAnnotation(fn) in the doc comment of the class where this annotation is used. Johannes On Mon, May 23, 2011 at 5:05 PM, Roger Webb webb.ro...@gmail.com wrote: Hey Everyone, I'm using Doxygen for my documentation generation. I updated to Beta2 and fixed all of the Doctrine annotations as described in the Update Document and found that all of my doxygen annotations are causing an exception to be thrown: [Semantical Error] The annotation @fn in method ARN\UserBundle \Controller\UserController::loginAction() was never imported. Any ideas on a workaround? Roger -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: IDE code completion + service container ? (eclipse, netbeans)
Hi, using Netbeans you might use the magic vdoc mechanism - i tried it out and it worked for me. By typing vdoc and pressing the tabulator key, a phpdoc template is generated that allows you to type-hint variable types at any (!) scope. An example may look like /* @var $em \Doctrine\ORM\EntityManager */ $em = $this-get('doctrine.orm.entity_manager'); More information may be found behind this link: http://blogs.oracle.com/netbeansphp/entry/defining_a_variable_type_in Nevertheless i am of the opinion that these missing native getter and setter methods is a really annoing thing that rises the learning curve a lot - a no-go for framework beginners. At least there should be a default-controller that implements methods to return e.g. the interfaces the concrete services implement. So you could use at least a minimum subset of the php guessing code- completion features in various IDEs - not only netbeans. Unfortunately i have no idea how to archive this task without breaking this loose coupling paradigm - perhaps there could be some sort of code-auto-generating-features (similar to this that doctrine implements for annotated entity classes) that depend on @method or @var, or aliased @di:service annotations.This would provide some sort of trait functionality into php ... hm... On 7 Mai, 17:18, Donald Tyler chekot...@gmail.com wrote: I don't have this problem so much anymore, but I've been using Symfony 2 for quite some time now. I do however completely agree with you. Not only is the code completion this a problem, but having the argument to Controller-get be a string gives absolutely no guidance to what the possible values could be. If there were actual getters and setters it would be fare more structured. That being said, I understand why they did it this way. The Symfony 2 framework is supposed to be completely modular and extendable, so it's not possible to know to the valid values for get() until runtime. It all depends on what Bundles you're using. I think your current workaround is the best option at the moment. It will allow you as a developer to specify more clearly to your team what facilities *your* controllers will have available to them, while not imposing a rigid structure on the Framework for other teams. On Sat, May 7, 2011 at 9:55 AM, Tony Piper tpi...@tpiper.com wrote: I've already considered extending the Controller class to add some of those functions and having my own Controllers extend that class But changing my code (specially on this level) to help my editor feels really stupid ... Am I really the only developer out there who sucks at memorizing APIs ? or do you guys have some other ways of helping yourself in the process of working with sf2? You are not alone, Ruben and I'd be interested to hear what others have to say about this. I have found myself implementing my own Base Controller which provides, amongst other things, easy access to the Entity Manager which is going to be needed in pretty much every controller. I watched Fabien's keynote at Symfony Live and was absolutely amazed to see that he uses good 'ol TextMate which doesn't support autocompletion so I wonder if he's ever considered it necessary. I certainly wouldn't be very productive if it were not for PhpStorm's autocomplete goodness. cheers, Tony. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Symfony2 ACL Performance Question
The ACL system supports batch loading ACLs (up to 30 in two queries). Kind regards, Johannes On Tue, May 3, 2011 at 3:49 PM, Gediminas Morkevicius gediminas.morkevic...@gmail.com wrote: Your posts can have an author id, which can be mapped to all permissions, same as groups this user belongs and related permissions. If you would do it right, hierarchical structure of your ACL you may need only few specific access rights per user, like if user is banned from the specific topic, when he will have a specific permission set for it exactly. Otherwise everything is inheritance based. At least thats how I think ACL should be handled. Setting access rights for each object is insane. On Tue, May 3, 2011 at 3:37 PM, Marc MacLeod marbe...@gmail.com wrote: Yes I still need to deal with this problem (I've put it off for now until the documentation is more complete). Gediminas, what if the user has thousands of posts, comments, etc? Do you think it would still make sense to retrieve and store that large ACL tree in the session? I'm still having a hard time wrapping my head around getting good performance out of the ACL system. I have not looked at the Tims work on the comment bundle yet - will do that soon. Marc On May 2, 9:41 am, Gediminas Morkevicius gediminas.morkevic...@gmail.com wrote: I think when user logs in, his ACL tree should be stored in his session. This way it will issue only a single query on successful login. It may require extra time on making acl tree compact with role inheritance and other fancy stuff. On Mon, May 2, 2011 at 3:13 PM, winzou alexandre.ba...@gmail.com wrote: Any news from both of you? I'm very interested as well. What's the best practice here? On 16 avr, 06:45, Tim Nagel t...@nagel.com.au wrote: Normally we'll expect the developer to implement their own controllers/views if they need anything more advanced than what we're providing at the moment, but I'm considering making it easier for developers to get what they need without doing so. I am also experimenting with HTTP caching, but as everyones requirements vary, this is something the end developer should probably be implementing. I'll see what I can do though. I am not yet sure about using the Doctrine cache, we havent really done any performance tuning at this point. Great to hear you'll be using it. I'd love to hear feedback on how it goes for you. t On Fri, Apr 15, 2011 at 23:36, Marc MacLeod marbe...@gmail.com wrote: Hi Tim, thanks very much. I'm sure taking a look at that will be very helpful! Any chance you'll be making use of the HttpCache and/or Doctrine cache? Working examples of how to best utilize these systems would be extremely helpful as well, and are very applicable to a comment system. Btw I plan to use the comment bundle in one of my projects in the next month so looking forward to what you come up with. Regards, Marc On Apr 14, 6:19 pm, Tim Nagel t...@nagel.com.au wrote: I'm working on editing and deletion functionality for CommentBundle at the moment. I expect to have something committed by the end of the weekend. t On Fri, Apr 15, 2011 at 03:53, Marc MacLeod marbe...@gmail.com wrote: Hi all, I'm not sure I understand how to effectively use the ACL system. Say, for example, I have a list of user submitted posts. When a user views the list, for each post in the list I would use the ACL system to determine if the user has the right to edit the post. If they do, I show the edit button. However, this requires that the list of posts be hydrated as objects AND requires multiple calls to the ACL system for each post to determine whether or not to show the edit button. That means that for every user and every post in the list there are many DB queries. This doesn't seem very efficient, is there a better way to accomplish this? I've looked through many of the bundles, however none of them (that I've seen at least) really use the ACL system or the HttpCache/ Doctrine Cache. Even the comments bundle doesn't use the ACL system to determine if a user can edit or delete a post. I feel like this is a typical use case, any guidance would be much appreciated. Thanks, Marc -- 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
[symfony-users] [Sf2] - Documentation on ORM and CLI
Hi. (I am currently on PR11) 1. - Whenever I create an entity from the CLI, the annotations are not the same as used in the examples from The Book on ORM. My first thought was that this was just a sheet created. To let Doctrine manage the entity, one would have to add the real annotations manually. I had an existing database, and I imported the mappings and created the entities. As described above, my understanding is that one needs annotations as described in The book. But these entities works just fine, with no annotations starting on @orm: at all. So my questions is, whats it called and where is it, whatever that now lets Doctrine use this entity. There must be something external helping the entity and Doctrine specifying types on variables used in the database and so on... Why is this not mentioned in The Book. Thanks. 2. - Following the example on updating schemas from Overview on ORM does not work. I add fields to my entity, but nothing happens on schema update. --dump-sql on create shows the sql for the old entity without the field, and update won't do anything because nothing new happened (it claims...). Thanks. 3. - Do I need to create entities through CLI? Can't I just manually create the files? After doing this, how can I tell Doctrine to create a table for it? Thanks. Regards, Johannes Harestad -- 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
Re: [symfony-users] Re: [Symfony2] Security ACL: SQLSTATE 23000 error (duplicated entry) while updating field ACEs
I think even if it is a bit more work when changing permissions, you should definitely look into cumulative permissions since this will increase the performance of your application. It should be sufficient to have one ACE with all granting, and one ACE with all denying permissions for each security identity. Only changing the granting flag might cause problems in combination with the granting strategy, and I don't see the use case for it right now. Kind regards, Johannes On Fri, Apr 8, 2011 at 10:35 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Of course. I'll try to reproduce the issue in a test. In the meantime I want to clarify that I don't use cumulative permissions, because I need to configure for each permission if it's an ALLOW or DENY entry, and it's easier this way. Taking this fact into account, If I could update the granting property of an ACE, I'd just update the existing ACE instead of deleting and inserting it on the ACL. I've noticed that you can update a field ACE passing the following properties to the updateObjectFieldAce method of the Acl class: $index, $field, $mask, $strategy = null Could it be an issue if we add an additional property ($granting) to update the granting property of the ACE or this could be a problem at some point of the update? if it wouldn't be an issue I could try to add the functionality, but first I'd like to be sure if there's a technical reason to not update the $granting property of an ACE. Thanks! Best regards. 2011/4/8 Johannes Schmitt schmitt...@gmail.com It would be nice if you can provide a failing test case in MutableAclProviderTest, otherwise just create a ticket, and I'll take a look at it. Johannes On Fri, Apr 8, 2011 at 9:43 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: MySQL logs show: 2940 Query START TRANSACTION 2940 Query UPDATE acl_entries SET ace_order = 4 WHERE id = 464 2940 Query UPDATE acl_entries SET ace_order = 3 WHERE id = 465 2940 Query UPDATE acl_entries SET ace_order = 3 WHERE id = 466 2940 Query UPDATE acl_entries SET ace_order = 1 WHERE id = 479 2940 Query rollback It first changes ace_order's, so if I deleted the entry with ace_order = 1, at the time of synchronizing changes in the DB it first updates ace_order fields, so the ACE I deleted is still there (with ace_order = 1 too). This is, of course, for ACEs that are affected for the same unique index, which have this fields: class_id, object_identity_id, field_name and ace_order. Thanks. 2011/4/8 Gustavo Adrian comfortablynum...@gmail.com Hi all, During the update process of fields ACEs I'm getting this error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '12-1106-entityTypeFriendly-1' for key 'UNIQ_46C8B806EA000B103D9AB4A64DEF17BCE4289BF4' I explain what I'm doing: As I allow to change the type of granting of the permission (allow or deny), and I didn't find a way to update the granting property of an ACE with acl methods like updateObjectFieldACE or the like, I'm just deleting the ACE and inserting it again on the ACL with the new value for the granting property. I do all this stuff for every field and, at the end, I update the ACL with $aclProvider-updateACL($acl); . Could this way of updating the granting property of an ACE bring this exception? I'm looking at the MutableAclProvider and I see that the updateXXXProperty methods first insert new ACEs and finally delete old ACEs (the ones which were deleted from the ACL). Could this mean that, as I deleted and inserted a new ACE from an ACL at the same time, at the moment of the update on the DB it first try to insert the new ACE with the same ace_order as the one that is going to be deleted? it's just a guess. I'm trying to trace the error so I can give further details. Is there a way to update the granting property of an ACE so I can update the ACE instead of deleting it an reinserting it again? Thanks in advance! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please
Re: [symfony-users] php app/console init:acl PR10 not working anymore
This command is broken in PR10, but if you didn't change any of the table names, you can copy/paste the required SQL from Symfony/Component/Security/Acl/Resources/schema/. Johannes On Fri, Apr 8, 2011 at 12:49 AM, Malc walc...@clam.at wrote: Hello, I have a problem with the installation of the acl (Symfony PR10): The database connection is working the schema was generated without problems, but php app/console init:acl isn't working. I got the following console message: [InvalidArgumentException] The parameter security.acl.dbal.class_table_name must be defined. How can I set this security.acl.dbal.class_table_name parameter ? I have already set in the security.yml: security: acl: connection: default # any name configured in doctrine.dbal section The default connection is also set in the config.yml: doctrine: dbal: connections: default: driver: pdo_mysql dbname: db_symfony user: root password: root orm: auto_generate_proxy_classes: %kernel.debug% default_entity_manager: default entity_managers: default: mappings: AcmeDemoBundle: ~ FOSUserBundle: ~ Is there a way to fix it ? Thank you and kind regards, Malc -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: [Symfony2] Security ACL and hierarchical tree of users and groups.
Your idea is sound except for the behavior of the PermissionGrantingStrategy. If you take a closer look, you'll see that the first applicable ACE will make the ultimate decision for the permission bitmask. Only if you check for more than one mask, the loop will continue. Also see the documentation for the difference between permission attributes, and permission bitmasks. Kind regards, Johannes On Tue, Apr 5, 2011 at 10:41 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Ok I think I have an idea about this case. I'd appreciate if you can give me your opinion about this. Having the scenario commented before I'd do the following: . First, I'd need to implement my own SecurityIdentityRetrievalStrategy, since I have my own user - department tree. So I'd override the getSecurityIdentities method with something like the following: public function getSecurityIdentities(TokenInterface $token) { $sids = array(); // add user security identity if (!$token instanceof AnonymousToken) { try { $sids[] = UserSecurityIdentity::fromToken($token); // This is the only thing I'd change $user = $token-getUser(); while (($entity = $user-getParent()) !== null) { $sids[] = new UserSecurityIdentity($entity-getUsername(), get_class($entity)); } } catch (\InvalidArgumentException $invalid) { // ignore, user has no user security identity } } } So, $sids would have the $user and all its parents, in that order. The only thing left that I'd need to implement is another PermissionGrantingStrategy. This is because the default implementation keeps looking for a granting ACE, even if an ACE has a DENY permission type. In my case, even if Department 1 has a permission VIEW = ALLOW on an Article, if User 4 has the same permission but with a DENY, I don't want to keep checking up in the tree. I want to deny its access as soon as possible. So I'd extend the default PermissionGrantingStrategy and override the method hasSufficientPermissions and, if an ACE is found for a given SID / Permission combination, I'd return the $ace-isGranting() result. This way, as soon it finds an ALLOW or DENY, it returns the result. What do you think? 2011/4/5 Gustavo Adrian comfortablynum...@gmail.com Hi there! I recently came up with this question: How to implement ACL with a hierarchical tree of users and other entities? I had an idea before but now that I'm almost at the middle of the implementation and that I understand better the ACL I realized it was wrong. Having the following tree: Department 1: . Group 1 . User 1 . User 2 . User 3 . User 4 . Group 2 . User 5 Department 2: ... etc I'd like to check permissions from bottom to top. ie: if I want to check if User 4 has permissions to VIEW an instance of Article, the following checks would take place (in this order): . Check if User 4 has permissions to VIEW the Object Identity Article with ID = 124 (suppose this is the ID of the Article) . If not, check if User 4 has the permission VIEW for the Object Identity representing the class Article . If not, do the first two checks but for the parent of User 4 (User 2 in this case) . If not, do the first two checks but for the parent of User 2 (Group 1 in this case) . If not, do the first two checks but for the parent of Group 1 (Department 1 in this case) . If not, he/she has no access to the Article. To implement this, I'd first create an ACL for the Object Identity representing the class. Then I'd create an ACL for the Object Identity representing the instance of the Article, and I'd set the ACL of the Article class as the parent of the ACL of the instance of the Article. I'd then assign Class and Class-field ACEs to the Article class ACL, and object and object-field ACEs to the instance of the Article's ACL. If this instance of the Article has a child, then this child's ACL would have as parent the ACL of its parent Article. You may ask why I create two distinct ACL for the class and for the instance. This was the easier way I've found. The user has three options available for each permission to choose from: INHERIT (This would only remove the corresponding ACE), ALLOW and DENY. These three options are available for the four kinds of permissions: Class, Class-Field, Object, Object-Field. Now, the only problem left is how to do the permission check based on the position on the tree of the user. I can't use the setParent feature of the ACL for this, because it's only for object identities, not for security identities. Which would be the best way to implement this? Thanks in advance! -- If you want to report a vulnerability issue on symfony, please send it to security
Re: [symfony-users] [Symfony2] Access a service from a entity
Why is accessing a service from an entity a bad practice? The only problem here is the PHP language, the design pattern itself is fine imo. Kind regards, Johannes On Mon, Apr 4, 2011 at 6:35 PM, Christophe COEVOET s...@notk.org wrote: Le 04/04/2011 17:37, Chris a écrit : Hey everyone, I know this or a similar question has been asked several times, but I couldn't find a satisfying answer. The problem is that I need to access a service from a model/entity. In my case it's a layout manager object which is the only object which knows about page layout positions, position order etc. Here is a simplified code snippet: ?php class PageModel { // ... public function isValid() { $masterPosition = $layoutManager-getLayout('content')- getMasterPosition(); return $this-getPosition($masterPosition)-isValid(); } } So is there a official way to access a service or is this considered bad practice? Cheers, Chris It is a bad practice. The entity is meant to store data, not to call services. If it is about validating the object you should IMO do it by defining a custom validation constraint: http://symfony.com/doc/2.0/cookbook/validation/custom_constraint.html -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] Security ACL: Check for class-field / object-field permissions from the security context?
$securityContext-isGranted('CREATE', new FieldVote($oid, 'field')); On Mon, Apr 4, 2011 at 8:19 PM, Gustavo Adrian comfortablynum...@gmail.comwrote: Hi all, If we want to check a class permission / object permission like CREATE, we would do: if ($securityContext-isGranted('CREATE', $objectIdentity) { // Do something } Now, what if I want to check for class-field or object-field? I looked at the SecurityContext class but I didn't find a way to do this. Maybe it would be useful something like: if ($securityContext-isGranted('CREATE', $objectIdentity, 'field') { // Do something } But maybe there's a way to do this that I didn't see. Thanks in advance. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: How to retrieve related objects with ACL
Can you explain a bit what you want to do? On Tue, Mar 29, 2011 at 4:17 PM, badllama77 badllam...@gmail.com wrote: I am guessing there is no easy solution? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: [Symfony2] Security ACL: General questions
When you delete entries, I'd recommend that you iterate from back to front for ($i=count($aces)-1; $i=0; $i--) { /* ... */ } since deleting an entry will change all indices of the following entries. One of the principles of the ACL system is that each domain object instance has exactly one ACL instance. That ACL instance will also hold the class-scoped ACEs, but you need to create an ACL for each object instance. Kind regards, Johannes On Tue, Mar 29, 2011 at 10:11 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Another thing I'd want to know is the order in which permission are checked. The docs says it does the check like this: The PermissionGrantingStrategy first checks all your object-scope ACEs if none is applicable, the class-scope ACEs will be checked, if none is applicable, then the process will be repeated with the ACEs of the parent ACL. If no parent ACL exists, an exception will be thrown. But I have a class scope ACE already inserted and when I check if my user isGranted, it shows this log: SELECT a.ancestor_id FROM acl_object_identities o INNER JOIN acl_classes c ON c.id = o.class_id INNER JOIN acl_object_identity_ancestors a ON a.object_identity_id = o.id WHERE ((o.object_identifier = '24435' AND c.class_type = 'MyFullClassCurrency')) No ACL found for the object identity. Voting to deny access. It looks for an object-scope ACL (it's using the ID of the currency 24435) and if it doesn't found it, it doesn't check for class-scope permissions. It just denies me the action. The thing is that it couldn't do it anyway because to create a class-scope ACL I need to create an ObjectIdentity object with some random ID (in my case -1), so the ACL component has no way to know which object identity referers to my class-scope ACL. Is this the expected behaviour? if it is, should I create an ACL for the object and make it inherit from the class-scope ACL? Thanks in advance. On Tue, Mar 29, 2011 at 4:26 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi all, I'm still working with the ACL feature. Now I'm implementing class scope permissions. What I'd need to know is how to work with indexes. If I want to update a class ACE, I would have this: $acl = $aclProvider-findAcl( $classIdentity, array( $securityIdentity ) ); $classAces = $acl-getClassAces(); // Suppose I have an ACE with the CREATE permission with granting = true, but I want // to update it to inherit this permission from its parent ACL, so I would have to delete this // ACE foreach ( $classAces as $index = $ace ) { if ( $ace-getMask() === MaskBuilder::CREATE ) { $acl-deleteClassAce( $index ); } } The problem here is that it throws an exception claming that the index %d is undefined. How should I obtain the index of the ACE so I can delete or update it? and BTW, if I want to change a permission CREATE from GRANTED to NOT GRANTED or DENIED (changing granting from true to false), how could I do it? should I delete the ACE and insert a new one? Thanks in advance. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] Injecting routes with parameters into javascript
I had written a JS route implementation for symfony 1.4 which should work with minor modifications for Symfony2. If it helps someone, the code is here (and it's actually unit-tested :)): https://gist.github.com/3d39cf593ceb1ea63713 See the tests for how to use it. Kind regards, Johannes On Mon, Mar 28, 2011 at 3:17 PM, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: Again this would be hacking around the issue rather than solving it. I've already removed the requirement so I can use Jordi's approach for the time being but that's not really a solution either. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] Security ACL question
It would indeed be a good addition. Could you add something like if (!$domainObject instanceof ObjectIdentityInterface) { $domainObject = $oidRetrievalStrategy-getObjectIdentity($domainObject); } to the AclVoter class; please also add a unit test to verify this behavior. Thanks, Johannes On Thu, Mar 24, 2011 at 4:03 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Can anyone verify this? if this is indeed a bug then I'll create a pull request. If not, what I am doing wrong? Thanks. On Wed, Mar 23, 2011 at 4:55 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Ok, I think I've found the reason for this behaviour. On the ObjectIdentityRetrievalStrategy class the getObjectIdentity method public function getObjectIdentity($domainObject) { try { return ObjectIdentity::fromDomainObject($domainObject); } catch (InvalidDomainObjectException $failed) { return null; } } So, if it already receives an ObjectIdentity instance (like it does if I pass a new ObjectIdentity instance to the isGranted method of the SecurityContext object), it pass it anyway to the fromDomainObject method, so it returns an ObjectIdentity instance for the original ObjectIdentity I passed to the isGranted method. If I change the method to look like: public function getObjectIdentity($domainObject) { try { if ( get_class( $domainObject ) !== 'Symfony\Component\Security\Acl\Domain\ObjectIdentity' ) { return ObjectIdentity::fromDomainObject($domainObject); } else { return $domainObject; } } catch (InvalidDomainObjectException $failed) { return null; } } It works like I want and it successfully denies me the creation of a Comment object. What I still don't know if I'm doing the right thing when I try to check If a user has a class-scope permission to CREATE a Comment, like in the example I've shown before. Thanks :) On Wed, Mar 23, 2011 at 4:44 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Another thing that it recently came up is this. Having no ACL or even an entry for this ObjectIdentity, if I try this: // $comment domain object was loaded from DB if ( $securityContext-isGranted( 'UPDATE', $comment ) === false ) { throw new AccessDeniedException( 'Some error message' ); } It successfully denies me to update the object as expected. Logs show this: 2011-03-24T00:01:45-03:00 INFO: SELECT a.ancestor_id FROM acl_object_identities o INNER JOIN acl_classes c ON c.id = o.class_id INNER JOIN acl_object_identity_ancestors a ON a.object_identity_id = o.id WHERE ((o.object_identifier = '24435' AND c.class_type = 'MyCommentClass')) ([]) 2011-03-24T00:01:45-03:00 DEBUG: No ACL found for the object identity. Voting to deny access. Just what I was expecting. But When I try to create a new object: // A new ObjectIdentity representing the Comment class for class-scope ACE's $commentClassOID = new ObjectIdentity( -1, 'MyCommentClass' ); if ( $securityContext-isGranted( 'CREATE', $commentClassOID ) === false ) { throw new AccessDeniedException( 'Some error message' ); } It doesn't throw an exception, and the logs show this: 2011-03-24T00:05:12-03:00 DEBUG: Object identity unavailable. Voting to grant access What I don't know is what's the default behaviour of the ACL feature if it doesn't have an ACL for an ObjectIdentity, or if it doesn't have any object identity on the DB referring to the ObjectIdentity passed to the isGrant method. So I still don't know which of both cases is wrong. Thanks in advance! On Wed, Mar 23, 2011 at 12:14 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi Johannes, 1) My scenario is the following: a BusinessUnit has many Departments a Department has many Users So, having this example tree: BusinessUnit 1 |_ Department 1 |_ User 1 |_ User 2 |_ Deparment 2 |_ User 3 What I would like is to define rules in BusinessUnit's, and inherit them from Departments. The same with my Users. I'd like them to inherit their rules from Departments. So, if I want an ALLOW rule for the VIEW permission in some Article class, I'd create a class-scope ACE for that rule on BusinessUnit 1, and then every child of BusinessUnit 1 would inherit from it. So, for this case, I'd create an ACL for BusinessUnit 1, create all the ACEs I want in it (in this case, an ALLOW rule for the VIEW class-scope permission for the Article class) , and then create an ACL without ACEs (or with specific ACEs if I want, for example, to DENY the previous ALLOW permission) for the other entities, and inherit the ACL's to create a tree just like my entity tree. For example, create an ACL for Department 1 and make it inherit from the BusinessUnit 1's ACL I
Re: [symfony-users] [Symfony2] Security ACL question
1) Yes, granting specifies whether the entry is granting (true) or denying (false). Depending on the order of ACL entries, and the SIDs to which the ACEs have been assigned, this can be used to implement scenarios like grant access to all users, but for this specific user deny access. 2) The index is the index of the entry in the array. You can retrieve the array via -getXXXAces() method, and then loop over it to get the correct index for your entry. Do not call methods directly on the ACE instances, these changes will not be persisted to the database. 3) Since the order in which the entries are checked is significant, ace_order is used to preserve the order of the entries in the array. audit_success/_failure are only relevant if you have set-up an AuditLogger which then can log if someone has been granted permissions through the ACL system, based on which entry permissions was granted, to which object permission was granted, etc. The AuditLogger is only called if the value of audit_success/_failure is true. Kind regards, Johannes On Tue, Mar 22, 2011 at 9:42 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: After implementing class-scope permissions thanks to Christophe's tip, I now have more questions :) I've been looking at the ACE schema and I see a couple of interesting things that I'd like to know how to use them. 1) First I see a granting boolean field and a grant_strategy field (with value all in my case in each row) on the acl_entries table. Looking then at the MutableAclInterface I see that the method insertClassAce has these signature: *function insertClassAce(SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null);* Does the $granting field allow me to use something like a DENY permission if I pass false to it? if that's the case, could I use it to DENY a privilege that has an ALLOW permission somewhere up on the hierarchy? 2) I've noticed that I can insert multiple Class Ace's using the same object identity and the same security identity, but it increases the ace_order for each row I insert. I have a form for each type of entity on my app to give class-scope permissions to specific users. Each time a user updates them, how can I update the corresponding ACE? I see in the MutableAclInterface that it has a updateClassAce method, but it needs an $index parameter and I don't know what it is. Is this the primary key of the ACE? if this is the case, should I query myself the DB using the class ID and the SID ID to retrieve the corresponding ACE's PK or is there a method to update ACE's based on the SID and OID that I haven't found? 3) What's the purpose of the following fields on the acl_entries table?: ace_order, audit_success, audit_failure. I've seen the AuditableAclInterface. How methods like updateClassAuditing (with $auditSuccess and $auditFailure parameters) works? Thanks in advance and sorry if I asked too many questions, but this is a wonderful feature and I'd love to know all its possibilities :) On Mon, Mar 21, 2011 at 4:26 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Great! even easier than I thought. I'm beginning to love this feature :) Thanks a lot! On Mon, Mar 21, 2011 at 4:22 PM, Christophe COEVOET s...@notk.orgwrote: Le 21/03/2011 20:11, Gustavo Adrian a écrit : Hi all, I'm starting to implement the ACL feature on my app and, for what I''ve read and what I've already implemented, I must say: it's BEAUTIFUL. Great job guys. It's just what I was looking for :) I have one question about this wonderful feature: 1) I've already implemented object scope permissions using the ObjectIdentifier class. What I don't know is: How to grant a class scope and class-field scope permissions to a user? I didn't find how to do it in the docs and I didn't find in the API something like ClassIdentifier. Which is the right way to grant a class scope permission to a user? Do I have to check this permissions the same way I do it with object-scope permissions? ($securityContext-isGranted( 'UPDATE', $objectIdentity ) ) the key to create a class Ace is to use the insertClassAce method: $oid = new ObjectIdentity('whatever_you_want', 'Class\\Name'); $acl = $provider-createAcl($oid); $sid = UserSecurityIdentity::fromAccount($user); $acl-insertClassAce($sid, MaskBuilder::MASK_OWNER); And then your user will have OWNER rights for all instances of the Class\Name class. The way to check does not change. Regards -- Christophe | Stof -- 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
Re: [symfony-users] Re: Service Container's Service Scope
That's because there is no documentation on these features yet; they are very advanced, and most users won't need them, so they have no priority atm. While the fix that Gustavo posted virtually disables all scope sanity checks, it should be avoided at all cost; you'll only create problems for yourself if you go down this road. Kind regards, Johannes On Thu, Mar 17, 2011 at 3:36 PM, Hany El-Kerdany kerd...@gmail.com wrote: Thanks Gustavo, Where can I read about request scope and configuration attributes like scope and synthetic, I couldn't find information in the documentation. On Thu, Mar 17, 2011 at 15:16, Gustavo Adrian comfortablynum...@gmail.com wrote: I use this to inject the request in my services: service id=request synthetic=true / Then I can inject the request in my services. service id=myservice class=%my.class% argument type=service id=request / /service On 15 mar, 22:41, Hany El-Kerdany kerd...@gmail.com wrote: Hi All, I tried to abuse the service container a little, and use it to inject core container services (like the request) object into my controllers (that are implemented as services) as well. This is to avoid having to extend the Controller class, or implement the ContainerAware interface. However, i got this error: *Fatal error: Uncaught exception 'RuntimeException' with message 'Scope Widening Injection detected: The definition xx.xx.xx references the service request which belongs to a narrower scope. Generally, it is safer to either move xx.xx.xx to scope request or alternatively rely on the provider pattern by injecting the container itself, and requesting the service request each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.'* * * I'm a bit aware of Spring Dependency Injection Container's Bean Scope concept, where some beans have longer scope than others. I have some concerns though: - The concept of service scoping or the scope configuration option wasn't mentioned in the Service Container chapter in the Symfony2 book. Do we have an intention to improve that? - I wonder, if Symfony2 DIC makes service objects (e.g. controllers, services) outlive the request, or serve multiple user requests like in the java world and java containers. And is that possible in the PHP world? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Service Container's Service Scope
NP :) Unfortunately, there is no general solution, it depends. Maybe the following thread helps you: http://groups.google.com/group/symfony-devs/browse_thread/thread/a7207406c82ef07a/e2626c00f5cb9749 Kind regards, Johannes On Thu, Mar 17, 2011 at 4:01 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Ooops, I didn't know that :P. Which would be the right way to inject the request service on our own services? Should we use a Compiler pass? Thanks for clarifying this. I thought this was the right solution. Best regards. On Thu, Mar 17, 2011 at 11:54 AM, Johannes Schmitt schmitt...@gmail.comwrote: That's because there is no documentation on these features yet; they are very advanced, and most users won't need them, so they have no priority atm. While the fix that Gustavo posted virtually disables all scope sanity checks, it should be avoided at all cost; you'll only create problems for yourself if you go down this road. Kind regards, Johannes On Thu, Mar 17, 2011 at 3:36 PM, Hany El-Kerdany kerd...@gmail.comwrote: Thanks Gustavo, Where can I read about request scope and configuration attributes like scope and synthetic, I couldn't find information in the documentation. On Thu, Mar 17, 2011 at 15:16, Gustavo Adrian comfortablynum...@gmail.com wrote: I use this to inject the request in my services: service id=request synthetic=true / Then I can inject the request in my services. service id=myservice class=%my.class% argument type=service id=request / /service On 15 mar, 22:41, Hany El-Kerdany kerd...@gmail.com wrote: Hi All, I tried to abuse the service container a little, and use it to inject core container services (like the request) object into my controllers (that are implemented as services) as well. This is to avoid having to extend the Controller class, or implement the ContainerAware interface. However, i got this error: *Fatal error: Uncaught exception 'RuntimeException' with message 'Scope Widening Injection detected: The definition xx.xx.xx references the service request which belongs to a narrower scope. Generally, it is safer to either move xx.xx.xx to scope request or alternatively rely on the provider pattern by injecting the container itself, and requesting the service request each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.'* * * I'm a bit aware of Spring Dependency Injection Container's Bean Scope concept, where some beans have longer scope than others. I have some concerns though: - The concept of service scoping or the scope configuration option wasn't mentioned in the Service Container chapter in the Symfony2 book. Do we have an intention to improve that? - I wonder, if Symfony2 DIC makes service objects (e.g. controllers, services) outlive the request, or serve multiple user requests like in the java world and java containers. And is that possible in the PHP world? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue
Re: [symfony-users] Re: ACL Groups
You'll obviously run into performance issues if you're going to add hundreds of roles, but this is no different than adding the user to hundreds of groups. One way to cope with the problem is to normalize the permissions. So, if a user is added to a group you tie all the permissions he gets directly to that users account. If he is removed from the group, you delete these permissions from his user account. Kind regards, Johannes On Tue, Mar 15, 2011 at 6:03 PM, maxpowel maxpo...@gmail.com wrote: The blacklist is only an example. The problem is that every user belongs to multiple groups. For example, in my site there are the following users: userA userB userC userD userE UserA has a group called Friends. In this group there are userB and userC. UserC has also a group called Friends with the users userB, userA and userE In the friends group of userD there are userB and the same for userE. In this case, the userB would have the roles userA_friends, userC_friends, userD_friends and userE_friends. When the userB has 100 friends, userB will have at least 100 roles. On 15 mar, 10:30, Johannes Schmitt schmitt...@gmail.com wrote: You shouldn't run into performance problems unless one user is on many blacklists in which case you probably want to disable that user anyway. Kind regards, Johannes On Tue, Mar 15, 2011 at 10:17 AM, maxpowel maxpo...@gmail.com wrote: Then I can use the format ROLE_$groupName_$userId. The other option is how FOS user bundle does, wich is merge group roles and user roles. On 13 mar, 23:46, Johannes Schmitt schmitt...@gmail.com wrote: You're right, this is a bit more complex, yet possible. You can use one role for each blacklist (ROLE_BLACKLISTED_$userId) which you add to user accounts if that user account is put on a blacklist. If the user is removed from the blacklist, you simply remove the specific blacklist role from that user's account. Kind regards, Johannes On Sun, Mar 13, 2011 at 9:36 PM, maxpowel maxpo...@gmail.com wrote: For a blog your example is great, but I think that I have other requirements. In my app the users upload photos and this users decide who can view their photos. With ACL it's easy to do. The problem become when the user wants to grant (or deny) the access to several users. For example, an user creates a group called Black list. Then the user denied the access to a photo to this group. Any user who belongs to that group can't access the photo. Also, in the future the user can add (or remove) users from this group. My requirements are similar to those of an operating system for the management of users and permissions. On 13 mar, 20:55, Johannes Schmitt schmitt...@gmail.com wrote: If you mean something like $securityContext-isGranted('ROLE_EDITOR', $post), that wouldn't invoke the ACL system. Kind regards, Johannes On Sun, Mar 13, 2011 at 7:30 PM, stof s...@notk.org wrote: On Sun, 13 Mar 2011 18:50:44 +0100, Johannes Schmitt schmitt...@gmail.com wrote: First, are you sure you need groups? Most of the time, roles will be fine. For example, let's assume that you have a BlogPost, and a typical role would be editor. $post = /* get the blog post */; // setting up an acl entry $aclProvider = $this-container-get('security.acl.provider'); $sid = new RoleSecurityIdentity('ROLE_EDITOR'); $acl = $aclProvider-findAcl(ObjectIdentity::fromDomainObject($post)); $acl-insertObjectAce($sid, MaskBuilder::MASK_OWNER); $aclProvider-updateAcl($acl); // checking for permissions $user === $securityContext-getToken()-getUser() // true $user-getRoles() === array('ROLE_EDITOR'); // true Wouldn't it be better to chek if the role is granted instead ? the user could have some other roles which would make your statement fail. $securityContext-isGranted('EDIT', $post); // true Kind regards, Johannes -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users
Re: [symfony-users] [Symfony2] Services scoping question
On first sight, this looks like a bug. Could it be that you added a custom scope? Kind regards, Johannes On Wed, Mar 16, 2011 at 10:16 PM, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi all, I'm having some issues with service scoping. I'll try to describe my situation the best I can. If something is not clear, please tell me :). Having this base classes: , Module (which can have services) . Service (which can have other services) I could have something like this: UserModule has a UserService, which can have a ContactInformationService. ContactInformationModule has another instance of ContactInformationService. So, for the first case, I define in the DIC a user_module service, a user_service, and a contact_information_service. Then, in the user_module's definition, I add the user_service to the user_module with a call to a Module's method called addService. Finally, in the user_service's definition, I add to it the sub-service contact_information_service with a call to the method addService. My problem: Each Module should be instantiated only once. This is OK. But each Service should be instantiated once per Module and each time it's been added to a service, as a sub-service. This is because each service can have a different state, depending on if it's a subservice or not. So, I tried to change the scope of my services to prototype to accomplish this. But then I received the following error: *Scope Crossing Injection detected: The definition module_manager.module.user references the service module_manager.module.user.service which belongs to another scope hierarchy. This service might not be available consistently. Generally, it is safer to either move the definition module_manager.module.user to scope prototype, or declare container as a child scope of prototype. If you can be sure that the other scope is always active, you can set the reference to strict=false to get rid of this error* I tried to use strict=false but then I've got an infinite recursion problem. Is my approach correct in terms of the DIC? I mean, is it possible to have, in one hand, one service with scope=container and add to it services with scope=prototype and, in the other hand, have a service with scope=prototype and add to it another service with the same scope? I hope I'm clear. If not, please tell me. Thanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: ACL Groups
You shouldn't run into performance problems unless one user is on many blacklists in which case you probably want to disable that user anyway. Kind regards, Johannes On Tue, Mar 15, 2011 at 10:17 AM, maxpowel maxpo...@gmail.com wrote: Then I can use the format ROLE_$groupName_$userId. The other option is how FOS user bundle does, wich is merge group roles and user roles. On 13 mar, 23:46, Johannes Schmitt schmitt...@gmail.com wrote: You're right, this is a bit more complex, yet possible. You can use one role for each blacklist (ROLE_BLACKLISTED_$userId) which you add to user accounts if that user account is put on a blacklist. If the user is removed from the blacklist, you simply remove the specific blacklist role from that user's account. Kind regards, Johannes On Sun, Mar 13, 2011 at 9:36 PM, maxpowel maxpo...@gmail.com wrote: For a blog your example is great, but I think that I have other requirements. In my app the users upload photos and this users decide who can view their photos. With ACL it's easy to do. The problem become when the user wants to grant (or deny) the access to several users. For example, an user creates a group called Black list. Then the user denied the access to a photo to this group. Any user who belongs to that group can't access the photo. Also, in the future the user can add (or remove) users from this group. My requirements are similar to those of an operating system for the management of users and permissions. On 13 mar, 20:55, Johannes Schmitt schmitt...@gmail.com wrote: If you mean something like $securityContext-isGranted('ROLE_EDITOR', $post), that wouldn't invoke the ACL system. Kind regards, Johannes On Sun, Mar 13, 2011 at 7:30 PM, stof s...@notk.org wrote: On Sun, 13 Mar 2011 18:50:44 +0100, Johannes Schmitt schmitt...@gmail.com wrote: First, are you sure you need groups? Most of the time, roles will be fine. For example, let's assume that you have a BlogPost, and a typical role would be editor. $post = /* get the blog post */; // setting up an acl entry $aclProvider = $this-container-get('security.acl.provider'); $sid = new RoleSecurityIdentity('ROLE_EDITOR'); $acl = $aclProvider-findAcl(ObjectIdentity::fromDomainObject($post)); $acl-insertObjectAce($sid, MaskBuilder::MASK_OWNER); $aclProvider-updateAcl($acl); // checking for permissions $user === $securityContext-getToken()-getUser() // true $user-getRoles() === array('ROLE_EDITOR'); // true Wouldn't it be better to chek if the role is granted instead ? the user could have some other roles which would make your statement fail. $securityContext-isGranted('EDIT', $post); // true Kind regards, Johannes -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: ACL Groups
First, are you sure you need groups? Most of the time, roles will be fine. For example, let's assume that you have a BlogPost, and a typical role would be editor. $post = /* get the blog post */; // setting up an acl entry $aclProvider = $this-container-get('security.acl.provider'); $sid = new RoleSecurityIdentity('ROLE_EDITOR'); $acl = $aclProvider-findAcl(ObjectIdentity::fromDomainObject($post)); $acl-insertObjectAce($sid, MaskBuilder::MASK_OWNER); $aclProvider-updateAcl($acl); // checking for permissions $user === $securityContext-getToken()-getUser() // true $user-getRoles() === array('ROLE_EDITOR'); // true $securityContext-isGranted('EDIT', $post); // true Kind regards, Johannes On Sun, Mar 13, 2011 at 5:26 PM, maxpowel maxpo...@gmail.com wrote: Your idea seems to be what I'm looking for but I have some doubts. When you say that a group assign a set of roles, what roles are available? One role for each group? Perhaps I'm not understanding very well how the roles works... Would you kindly tell me an example? Thank you On 12 mar, 09:02, Johannes Schmitt schmitt...@gmail.com wrote: What I meant with using roles is that you can add ACL rules based on a role that the user has. Groups would basically only be used to assign a set of roles to the user and would have no meaning beyond that. Kind regards, Johannes On Fri, Mar 11, 2011 at 6:59 PM, maxpowel maxpo...@gmail.com wrote: And the use of roles would not cause performance problems when the number of roles is high? Symfony needs to load the list of roles (array of strings). With 200 or 300 roles and many requests (if the page shows 15 pictures, it would need to check the permissions 15 times) could go a little slower. Perhaps I am Mistaken symfony manager about how the roles. What do you think? My idea is to make this work with mysql so that would be quick. Thank you On 10 mar, 11:18, Johannes Schmitt schmitt...@gmail.com wrote: Technically, you can use the UserSecurityIdentity for that, but I think a better approach would be to use roles. Kind regards, Johannes On Thu, Mar 10, 2011 at 10:28 AM, Alvaro Garcia maxpo...@gmail.com wrote: Hi! ACL in Symfony 2 is wonderful but I can't find how to manage groups. In my app I haver users and user groups. Every user can create their own groups and this groups contains the user friends. A user can be contained into several groups. Now I want to protect some objects (photos and profiles). Permissions for users is done but now I want do the same with groups. My group class should implement Symfony\Component\Security\Core\User\AccountInterface but I think that this is not pretty. I was looking for a way to implement other class instead of AccountInterface but found nothing. Someone have an idea? Thank you! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: ACL Groups
If you mean something like $securityContext-isGranted('ROLE_EDITOR', $post), that wouldn't invoke the ACL system. Kind regards, Johannes On Sun, Mar 13, 2011 at 7:30 PM, stof s...@notk.org wrote: On Sun, 13 Mar 2011 18:50:44 +0100, Johannes Schmitt schmitt...@gmail.com wrote: First, are you sure you need groups? Most of the time, roles will be fine. For example, let's assume that you have a BlogPost, and a typical role would be editor. $post = /* get the blog post */; // setting up an acl entry $aclProvider = $this-container-get('security.acl.provider'); $sid = new RoleSecurityIdentity('ROLE_EDITOR'); $acl = $aclProvider-findAcl(ObjectIdentity::fromDomainObject($post)); $acl-insertObjectAce($sid, MaskBuilder::MASK_OWNER); $aclProvider-updateAcl($acl); // checking for permissions $user === $securityContext-getToken()-getUser() // true $user-getRoles() === array('ROLE_EDITOR'); // true Wouldn't it be better to chek if the role is granted instead ? the user could have some other roles which would make your statement fail. $securityContext-isGranted('EDIT', $post); // true Kind regards, Johannes -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: ACL Groups
You're right, this is a bit more complex, yet possible. You can use one role for each blacklist (ROLE_BLACKLISTED_$userId) which you add to user accounts if that user account is put on a blacklist. If the user is removed from the blacklist, you simply remove the specific blacklist role from that user's account. Kind regards, Johannes On Sun, Mar 13, 2011 at 9:36 PM, maxpowel maxpo...@gmail.com wrote: For a blog your example is great, but I think that I have other requirements. In my app the users upload photos and this users decide who can view their photos. With ACL it's easy to do. The problem become when the user wants to grant (or deny) the access to several users. For example, an user creates a group called Black list. Then the user denied the access to a photo to this group. Any user who belongs to that group can't access the photo. Also, in the future the user can add (or remove) users from this group. My requirements are similar to those of an operating system for the management of users and permissions. On 13 mar, 20:55, Johannes Schmitt schmitt...@gmail.com wrote: If you mean something like $securityContext-isGranted('ROLE_EDITOR', $post), that wouldn't invoke the ACL system. Kind regards, Johannes On Sun, Mar 13, 2011 at 7:30 PM, stof s...@notk.org wrote: On Sun, 13 Mar 2011 18:50:44 +0100, Johannes Schmitt schmitt...@gmail.com wrote: First, are you sure you need groups? Most of the time, roles will be fine. For example, let's assume that you have a BlogPost, and a typical role would be editor. $post = /* get the blog post */; // setting up an acl entry $aclProvider = $this-container-get('security.acl.provider'); $sid = new RoleSecurityIdentity('ROLE_EDITOR'); $acl = $aclProvider-findAcl(ObjectIdentity::fromDomainObject($post)); $acl-insertObjectAce($sid, MaskBuilder::MASK_OWNER); $aclProvider-updateAcl($acl); // checking for permissions $user === $securityContext-getToken()-getUser() // true $user-getRoles() === array('ROLE_EDITOR'); // true Wouldn't it be better to chek if the role is granted instead ? the user could have some other roles which would make your statement fail. $securityContext-isGranted('EDIT', $post); // true Kind regards, Johannes -- Christophe | Stof -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: ACL Groups
What I meant with using roles is that you can add ACL rules based on a role that the user has. Groups would basically only be used to assign a set of roles to the user and would have no meaning beyond that. Kind regards, Johannes On Fri, Mar 11, 2011 at 6:59 PM, maxpowel maxpo...@gmail.com wrote: And the use of roles would not cause performance problems when the number of roles is high? Symfony needs to load the list of roles (array of strings). With 200 or 300 roles and many requests (if the page shows 15 pictures, it would need to check the permissions 15 times) could go a little slower. Perhaps I am Mistaken symfony manager about how the roles. What do you think? My idea is to make this work with mysql so that would be quick. Thank you On 10 mar, 11:18, Johannes Schmitt schmitt...@gmail.com wrote: Technically, you can use the UserSecurityIdentity for that, but I think a better approach would be to use roles. Kind regards, Johannes On Thu, Mar 10, 2011 at 10:28 AM, Alvaro Garcia maxpo...@gmail.com wrote: Hi! ACL in Symfony 2 is wonderful but I can't find how to manage groups. In my app I haver users and user groups. Every user can create their own groups and this groups contains the user friends. A user can be contained into several groups. Now I want to protect some objects (photos and profiles). Permissions for users is done but now I want do the same with groups. My group class should implement Symfony\Component\Security\Core\User\AccountInterface but I think that this is not pretty. I was looking for a way to implement other class instead of AccountInterface but found nothing. Someone have an idea? Thank you! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2]: http-basic with sha1 password encoder doesn't work anymore
We have made a change in the way how passwords are hashed. Therefore, your sha1 hash will be different for the same password; you simply need to rehash your real password and put the new hash in the configuration. Kind regards, Johannes On Sat, Mar 12, 2011 at 8:11 PM, olimination oliminat...@gmail.com wrote: Hello, I have configured following security config in app/config/config.yml: security: encoders: Symfony\Component\Security\Core\User\User: sha1 providers: main: users: admin: { password: sha1pw, roles: ROLE_ADMIN } firewalls: main: pattern: /cms.* http-basic: true logout: true access_control: - { path: /cms.*, role: ROLE_ADMIN } sha1pw is of course a sha1 hash. But somehow in the new Standard Edition PR7 of Symfony this doesn't work anymore. Do you have any idea/hints? I have tried to configure it with plaintext and this works fine, but with sha1 there is somehow a problem. thanks for help! greets, Oli -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] ACL Groups
Technically, you can use the UserSecurityIdentity for that, but I think a better approach would be to use roles. Kind regards, Johannes On Thu, Mar 10, 2011 at 10:28 AM, Alvaro Garcia maxpo...@gmail.com wrote: Hi! ACL in Symfony 2 is wonderful but I can't find how to manage groups. In my app I haver users and user groups. Every user can create their own groups and this groups contains the user friends. A user can be contained into several groups. Now I want to protect some objects (photos and profiles). Permissions for users is done but now I want do the same with groups. My group class should implement Symfony\Component\Security\Core\User\AccountInterface but I think that this is not pretty. I was looking for a way to implement other class instead of AccountInterface but found nothing. Someone have an idea? Thank you! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Security with Cookies
Don't you like the built-in security for some reason? :) Kind regards, Johannes On Fri, Mar 11, 2011 at 1:15 AM, Michael excelwebz...@gmail.com wrote: I have created my own login form, once submitting it call an Ajax (controller) action that execute a login function from a service I wrote. The service gets an instance of SecurityContext ($this- security).. here is the login function: public function login($userId, $rememberMe = false) { ... $token = $rememberMe ? new RememberMeToken($this-user, $this-providerKey, base64_encode(serialize(array($this-user-getUsername(), $this-user- getPassword() : new UsernamePasswordToken($this-user-getUsername(), $this-user-getPassword(), $this-providerKey, $this-user- getRoles()); $this-security-setToken($token); return true; } How can I make it so if $rememberMe is true it will also set a cookie (right now RememberMeToken only set a session object) Any thoughts? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Security with Cookies
Whatever you're trying to do, this is certainly the wrong way. If you need remember-me, turn on the remember-me setting in the configuration. If you still need to do something upon a successful login, use a custom authentication success handler. Kind regards, Johannes On Fri, Mar 11, 2011 at 4:00 AM, Michael excelwebz...@gmail.com wrote: Two more question: 1. with the build-in security, is there a way to trigger login action? 2. after the login success, is there away to forward to an action without redirecting (will allow sending extra params with login form)? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] SecurityBundle - FailureHandler service
There is an open PR for that, see https://github.com/symfony/symfony/pull/98 I'm not sure if ornicar has time, but if you like to take this on, that would be appreciated. Kind regards, Johannes On Fri, Mar 4, 2011 at 10:55 PM, Francis Besset francis.bes...@gmail.comwrote: Hi all, I created my failure_handler service for the form-login. But I would like to have access to the form-login configuration (login_path by example) in the instance of my failure_handler service. What should I do? Thanks, Francis. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Symfony2 Security - Role Combinations
Yes, but it's not easy. You'd have to write your own security voter. Kind regards, Johannes On 3/1/11, Roger Webb webb.ro...@gmail.com wrote: I couldn't find anything in the Authorization section of the documentation covering this. Is there a way to restrict access to a pattern by forcing a user to have (role_a AND role_b) or (role_a OR role_b)? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Logging security events (syslog)
What is a security event for you? Kind regards, Johannes On Fri, Feb 11, 2011 at 8:14 AM, Manfred Dohmen manfred.doh...@gmail.comwrote: Thanks Leon, but the question relates more to how to hook into Symfony2 in order to observe security events (and then having them logged). -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: Use compenents from symfony 2.0 in symfony 1.4
Note that there is no such concept like Object, or ObjectCollection routes in Symfony2. So, the routing systems are not functionally equivalent. Kind regards, Johannes On Wed, Feb 9, 2011 at 12:56 PM, Yelena Bunina yelena...@gmail.com wrote: Oh I forgot to tell that we use APC :) On Wed, Feb 9, 2011 at 2:51 PM, Gareth McCumskey gmccums...@gmail.comwrote: My point is not there aren't performance improvements if you were able to switch to symfony 2 routing. My point is that the risk vs rewards is not worth it as long as other options exist with a better risk vs reward. Hacking symfony 1 to use symfony 2 routing might never work well after hours of attempts for an unknown potential performance improvement whereas installing an APC cache (and this is just ONE example of other things you could try) would take about 15 - 30 minutes with no risk of anything not working and can provide measured and proven performance improvements. I'd rather go for low risk, proven improvements if I can than something that might be cool but can waste an enormous amount of time for an improvement that us unknown ... thats all. On Wed, Feb 9, 2011 at 1:43 PM, Yelena Bunina yelena...@gmail.comwrote: Whats new in routing: - Moved to components - Increased performance. Don't create rout object at any routing rule - When compare rout and url using strpos() except pre_match - To generate url and routes uses different objetcs (ProjectUrlGenerator, ProjectUrlMatcher) I think it is great to improve my project in such a way :) On Wed, Feb 9, 2011 at 2:25 PM, Gareth McCumskey gmccums...@gmail.comwrote: I'm not trying to argue :) Only trying to help as the first thing that comes to my mind is that trying to shoehorn symfony2 stuff into symfony1, especially when you do not really know for sure if the symfony2 stuff will actually improve performance, seems to be a little rushed. Other things to consider that can help is using an opcode cache like APC if you do not already as that can make a major difference to performance and is far easier and better supported. On Wed, Feb 9, 2011 at 1:19 PM, Yelena Bunina yelena...@gmail.comwrote: We have performance issues, so we take xhprof to find the problem. Another big part in execution take Doctrine stuff calls. And in some places we have to refuse from Doctrine using plain sql (e.g. tasks). So I need an answer at my distinct question: how to built in symfiny's 2 route into symfony 1.4 properly :) I don't want to argue about what should we optimize. Another way is to give up using framework at all. But I like symfony and don't want to rewrite common stuff. On Wed, Feb 9, 2011 at 1:47 PM, Gareth McCumskey gmccums...@gmail.com wrote: Do you currently have performance related issues with your application? If you do not actually have performance issues then I would say not to worry about. If the application is performing efficiently, 30% of an efficient app is still efficient. If your application is struggling performance-wise then sure go ahead and find something to optimise, but don't leap to trying to optimise stuff when you do not actually have an issue related to it. In addition, what is the other 70%? If the other 70% is related to your own app code then I would say thats where you should be focussing. Making your own code more efficient is a bigger win than trying to hack the framework library for potentially small to zero returns. I can understand that you see 30% of script execution happens and jump to fix routing as it looks like low hanging fruit but you could cause bigger problems chasing that. Especially if you are not actually having any performance related issues. Optimising of performance should be a focus of an application once it goes live and you see there are performance issues, not before. On Wed, Feb 9, 2011 at 12:42 PM, soulfly yelena...@gmail.com wrote: We tested our project with xhprof and realized that routes take 30% of script executing. And we expect that routes in symfony 2.0 have better performance (even take in consideration that it in beta version now). So we have to optimize code or use better solution. On Feb 9, 1:35 pm, Gareth McCumskey gmccums...@gmail.com wrote: But ... symfony 1.4 has routing capabilities already built in. On Wed, Feb 9, 2011 at 11:01 AM, soulfly yelena...@gmail.com wrote: I just try to know if it possible to take one component - Routing and use it in project on sf 1.4. May be it's enough to take folder with routes and pu it in folder in symfony 1.4. But may be I should write smth in factories or elsewhere. On Feb 9, 11:51 am, Gareth McCumskey gmccums...@gmail.com wrote: I never said 1.4 couldn't work on php 5.3. To help with your problem, it would probably be easier to port the symfony 1.4 ode to a symfony 2 application than symfony 2 to 1.4. On Wed, Feb 9, 2011 at 10:27 AM
Re: [symfony-users] Symfony2 ACL and roles
You can write your own security voter to do this. There is no documentation on this yet as it is quite advanced, but you can use the built-in security voters as a starting point; overriding SecurityContext-vote() is a bad idea... Kind regards, Johannes On Mon, Feb 7, 2011 at 7:05 PM, phil0 fis...@gmail.com wrote: Hmm that sounds weird. So there is no way of adding a super admin? Perhaps overriding the security context vote method would do the trick? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Symfony2 ACL and roles
As I said, this is a bad idea nonetheless... It might be working now, but it will only cause you problems further down the road. It's better to go with the proper solution I mentioned before. Kind regards, Johannes On Mon, Feb 7, 2011 at 10:05 PM, phil0 fis...@gmail.com wrote: Ok, what I've done now is: I created a new DI service into which the SecurityContext is injected. This service has a method called vote() that takes the same parameters as SecurityContext::vote(), but this method calls SecurityContext::vote() with the admin role. If the role doesn't have access, SecurityContext::vote() is called again, this time with the objects for the ACL check. A bit of a workaround but it seems to be working. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Login directly from code
In this case, you can implement your own AuthenticationSuccessHandler, and AuthenticationFailureHandler. You find the interfaces in Component/ Security/Http/Authentication/. When you have wired these handlers with the DIC, you can set them in the configuration as follows: security.config: firewalls: somename: form_login: success_handler: my.service.id failure_handler: my.service.id Kind regards, Johannes On Jan 29, 9:13 pm, Michael excelwebz...@gmail.com wrote: Is there a way to directly use the security feature to login in the PHP code? In my project (Latest Symfony2.0), I submit the login/registration using ajax when processing the data. On failure I return a string with the error and on success I login the user and return true which call a redirect function (in javascript). In addition to the username/ password I have extra parameters which I need for the process. Does anyone have an idea how to do something like that? -- 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: User authentication and session persistence problem
This behavior has been changed in the HEAD revision. Kind regards, Johannes On Jan 28, 4:51 pm, DisTurBinG cook...@gmail.com wrote: I agree, I just ran into this problem as well and noticed the same thing. Thanks to your post! I don't understand why it was designed to authenticate with __toString() isntead of getUsername() I believe that getUsername should be the standard for the authentication as an obvious. To String was something I thought was used for debugging and displaying to the front end with ease, such as function __toString() { return $this-firstName . ' ' . $this-lastName; } Anyways, something that is vague in the documentation or a mistake in code? We will see :). Hopefully it changes! ~DisTurBinG On Jan 22, 12:31 pm, taidehuone taidehu...@gmail.com wrote: I have now completely resolved this issue. Your user entity - the one that implements either AccountInterface or AdvancedAccountInterface - must have a __toString() method which returns the login identifier and absolutely nothing else. This is not obvious behavior in my opinion. -- 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: Grails to Symfony2 Benchmark
My guess is that he didn't enable APC cache for doctrine metadata, and that can make quite a difference. On Jan 19, 6:15 pm, Gareth McCumskey gmccums...@gmail.com wrote: Lies, damned lies and benchmarks (To mangle a popular phrase) On Wed, Jan 19, 2011 at 4:27 PM, Tom Boutell t...@punkave.com wrote: Mmm. His throughput was 3x higher with APC, and it does look like he enabled it correctly, but he was still pegging CPU and memory the whole time. I would have to study his specific code more to figure out if he's doing anything wrong for Symfony that he's doing right for Grails. On Jan 17, 4:58 am, Nikolai K. Bochev n.boc...@grandstarco.com wrote: Well it seems he has redone the test with APC enabled. http://cutiecode.maniacmansion.it/post/2777523715/grails-vs-symfony-2... Interesting is all i can say. Thanks for the info and the effort to email the author. I am very interested in what they have to say. Please let us know as soon as you do. Thanks. -- Nikolai K. Bochev System Administrator -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- Gareth McCumskeyhttp://garethmccumskey.blogspot.com twitter: @garethmcc identi.ca: @garethmcc -- 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: Security Component: how to authenticate a user manually?
You need to retrieve the security.context service from the DI container, and call -setToken() with an implementation of TokenInterface. Regards, Johannes On Nov 22, 9:03 am, gordonslondon jules.boussek...@gmail.com wrote: Make a request to the login page (with credientials in POST parameters) works for me. I didn't find any other way. I'm also searching a good way to authenticate a user without any request just a method ( -authenticate() ); Other things where there's a problem is to authenticate when unit- testing:http://groups.google.com/group/symfony-users/browse_frm/thread/b156be... -- 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: Doctrine + 2 different distinct queries affecting each others' results (bug?)
These problems usually occur when you are loading partial relations from the database, and later on assume that the relation was loaded completely (Doctrine has no way to tell whether an object's relation was loaded partially or completely). Try refreshRelated() to re-load the specific relation from the database, or load the entire relation in the first place. Kind regards, Johannes On 2 Sep., 07:14, Guill Lo guill.b...@gmail.com wrote: Hi there! Still haven't found the solution, I'm skipping this and will find another way to do it. But I think it's a Doctrine bug, mixing the collection of datas behind the scenes. Hope this post might help feel not so lonely if you encounter this kind of issue. On Aug 13, 9:21 pm, Guill Lo guill.b...@gmail.com wrote: Hi there, I've got something really strange that never happened to me before. I have 2 different queries querying on the same tables. One table is called 'Module' and the other one 'Section'. A module can have several sections and a section can belongs to several modules. Therefore, in my templates, I call module-getSections(). This is where the problem is. ** In my actions.class.php I have: ** $this-modules_in = Doctrine_Query::create() -from('Module m') -innerJoin('m.Sections s') -innerJoin('s.SectionUser su') -innerJoin('m.Program p') -where('p.id = ? AND su.user_id = ?', array($request-getParameter('program_id'), $user-getId())) -execute(); $this-modules_not_in = Doctrine_Query::create() -from('Module m') -innerJoin('m.Sections s') -innerJoin('m.Program p') -where('p.id = ?', array($request-getParameter('program_id'))) -execute(); (I know that the 2nd query is not correct but I made it simpler just to try to find where the bug is) ** in my template I have: ** div id=ad_sections_in h3List of sections you are enrolled in:/h3 ?php if (!count($modules_in)):? p class=noticeYou are not yet enrolled in any section that is currently running or upcoming for this program./p ?php else:? p class=noteHere is the list of your sections that are currently running or upcoming. You can request to drop some of them. Be aware that some are mandatory./p table class= tbody ?php foreach($modules_in as $module_in) : ? tr class=ui-widget-content td h4 class=ac?php echo sprintf('%s - %s', $module_in['code'], $module_in['name']) ?/h4 table class=list tbody ?php foreach($module_in-getSections() as $section) : ? tr td ?php echo sprintf('%s - %s - %s', $section['code'], $section['name'], $section['section']) ? a href=?php echo url_for('@section_info? code='.$section['code'])? id=?php echo $section['code']? class=view-in-box note altview details raquo;/a /td td ?php echo link_to('drop span class=ui-icon ui- icon-trashnbsp;/span', sprintf('@adddrop_student_action? do=dropsection_id=%s', $section['id']),'class=fg-button-mini fg- button ui-state-default fg-button-icon-left comment') ? /td /tr ?php endforeach ? /tbody /table /td /tr ?php endforeach ? /tbody /table ?php endif;? /div The problem is that my $module_in-getSections() doesn't return me the results according to the 1st query, but according to the 2nd, and I have no idea why. If I comment the 2nd query in my actions.class.php, the results are correct, according to the 1st query. If I change the order of the queries in the actions.class.php the opposite happens: in my template the $modules_not_in-getSections() will return the results according to the other query. Actually I've found that the results are always according to the last query of my actions.class.php instead of being related to the correct query. Do I miss an option somewhere or there is something that I misunderstood?? Thanks for the help. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Symfony 1.4-compatible minifier for Symfony now included in Apostrophe, can be used in any Symfony project
I'm wondering what is going to happen in the following use case: You got two pages A and B. - Page A uses script C (10kb), and script D (20kb) - Page B uses script D (20 kb), and script E (1kb) Do you generate two different files for each page, or do you have any heuristics to decide when to combine, and when it's not worth it? In this case, only gzipping these scripts (thus leaving one file per script) should result in usually higher performance than generating two different, but combined files. Kind regards, Johannes On Aug 15, 2:04 pm, Tom Boutell t...@punkave.com wrote: The cached versions are removed by 'symfony cc' and subsequently regenerated by the next request. They are files in the web/uploads/ asset-cache folder, so they are not cached by the browser any more or less aggressively than the original files in web/css, web/ apostrophePlugin/css, etc. would be. So the minifier doesn't change the caching situation any one way or the other. It might be worthwhile to take things a step further by versioning them in the URL so that they can be given an infinite cache expiration date, although this requires a database hit or perhaps a glob call when outputting the pages that contain them. The code is a big step forward as-is if you are using unminimized, uncombined CSS and JS and has no negative impact on your existing caching issues, but we'll think about next steps. (I wonder what the performance cost of using a glob call would be relative to a database hit? This article says 1,000 glob calls on a directory with 400 files take about 2.2 seconds for the globs themselves. In a directory that will only contain a handful of files, that gives us an upper bound of less than 2.2 milliseconds, probably a lot less. This was on an older Macbook Pro, not wildly unlike a server in its single-CPU performance:http://www.phparch.com/2010/04/28/putting-glob-to-the-test/ ) As for where to get the code, it's in apostrophePlugin which is readily available via the Symfony plugins site: http://www.symfony-project.org/plugins/apostrophePlugin The code lives in aHelper.php. Make sure you check out the svn trunk of the plugin rather than the stable branch of a tarball as this is new work not yet in a tarball release. On Aug 14, 12:00 pm, pghoratiu pghora...@gmail.com wrote: Hi! How do you solve the cache invalidation for these resources (in case they are cached on the client side)? Please post also a link to the sources. Thanks, gabriel On Aug 14, 5:08 pm, Tom Boutell t...@punkave.com wrote: We've committed a new CSS and JS minifier to the trunk of apostrophePlugin. It's possible to take advantage of this even if you don't need the rest of Apostrophe for your project. Apostrophe now has a built-in CSS and JS minifier, similar to sfCombinePlugin but up to date and easier to work with. All you have to do is call a_include_javascripts and a_include_stylesheets in your layout.php rather than the usual include_javascripts and include_stylesheets. Although we didn't start from sfCombinePlugin, which has not been updated for about a year, we are not reinventing the wheel here. Apostrophe now bundles the latest stable release of the excellent Minify package by Ryan Grove and Steve Clay. We're not using Minify's built-in server. Instead we are using the Minify library classes to do the actual minification and integrating these into our helpers for a native Symfony feel. That means that: * When minification is turned on with app_a_minify, all CSS files needed on a page are rolled into a single file * Ditto for JavaScript * The cache files are automatically reused if they already exist * The cache files are automatically erased when you 'symfony cc' on a particular server, as you ought to do when you deploy anyway * Files that need to be loaded separately (for instance, they have IE conditional comments) are still loaded the traditional way * Files that need to load together as a group because they have the same script tag options (for instance, print stylesheets) are merged to a separate cache file from the rest * When app_a_minify_gzip is turned on, minimized CSS and JS files are automatically gzip-compressed in advance when they are generated (the necessary .htaccess directives to allow your server to support this are in the trunk sandbox .htaccess file, take a look - all web browsers support this so it's a big win) Dead simple and very effective. With app_a_minify and app_a_minify_gzip both turned on, the logged-out view of the Apostrophe sandbox now receives a B grade from the YSlow plugin. Those who are familiar with YSlow know that a B is extremely hard to get. YSlow dings you for every little infraction, including the use of images that are not CSS sprites and so on. Our former score was an D on an A to F scale (a C if the server
[symfony-users] Re: Install plugins programmatically?
No explicit method as far as I know, but this works: sfConfig::set('sf_enabled_modules', array_unique(array_merge(sfConfig::get('sf_enabled_modules'), array('my_first_module_name_to_enable', 'my_second_module', 'etc'; Kind regards, Johannes On 13 Aug., 14:57, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi James. I was thinking and something like that too. What I don't know is how to enable the modules of the plugin programmatically. Is there available a method for this purpose? Thanks! On Fri, Aug 13, 2010 at 3:37 AM, James Cauwelier james.cauwel...@gmail.comwrote: It is possible to enable a plugin from the projectConfiguration methods, but nobody dictates that the plugin names should be hardcoded there, you could use a configuration XML for instance... The code below does not work, but illustrates the principle. There is also more than one way to do this. You don 't have to use XML and could use a database or any other kind of storage. Doctrine is also packaged as a plugin, so it probably is not possible to use doctrine for this. public function setup() { if (file_exists('enablePlugins.xml')) { $xml = simplexml_load_file('enablePlugins.xml'); $enabledPluginsXml = $xml-xpath(...); $this-enablePlugins($enabledPluginsXml); } } On 12 aug, 22:12, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi, first of all, thank you both guys for your answers. @Damon: I couldn't try that yet but, as you said, the only problem I see is that I have no way (that I know) of enable the plugin on ProjectConfiguration class. And this class is used on the very first part of the framework initialization. I need this because I need a way to install (a kind of) plugins from my backend to extend a CMS I'm developing and, if I could use the plugin functionality that Symfony already has, it would be great. If I can't, then I'd need to create my own plugin system (which, as you would guess, it can take a long time). @Stéphane: Could you point me to a place where Symfony use this to look for examples of code? In which way would you use this class for my need? Thank you both again! On Thu, Aug 12, 2010 at 4:33 AM, Stéphane stephane.er...@gmail.com wrote: There is a class which helps you wrapping methods. Search for sfClassManipulator. Cheers, Before Printing, Think about Your Environmental Responsibility! Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale! On Thu, Aug 12, 2010 at 8:07 AM, Damon Jones damonljo...@gmail.com wrote: You can certainly run these tasks from within a task, as described here: http://www.symfony-project.org/more-with-symfony/1_4/en/13-Leveraging. .. So, maybe you can create instance of these tasks and run them from elsewhere in your code. I think the issue would be how you enable them in your ProjectConfiguration. On Aug 11, 8:49 pm, Gustavo Adrian comfortablynum...@gmail.com wrote: Hi! Quick question: Is there a way to install and enable a plugin from PHP? Thanks! -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com 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 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com 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 -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue
[symfony-users] Re: issues after moving form code to a plugin
What's the underlying inheritance structure? Is the BrandForm model represented by a Doctrine behavior plugin? The schema would be useful. Kind regards, Johannes On 5 Aug., 09:38, Daniel Kucharski dan...@inspiran.be wrote: Hi, Thanks for taking time to look into the issue. I tried what you did and moved the plugin out of the project, rebuild the doctrine classes with a dummy model and moved the plugin back in. However I am still facing the same issue. Any other clues? I am using Symfony 1.4.6 by the way. Sorry, you're right the Plugin* class should be generated inside the plugin's lib/ folder, not in the project's lib/ folder. Hmm, did you try moving everything concerning your plugin out of the project, rebuild, then move it back and rebuild again. I've never had this happening and I've written a lot of Doctrine plugins. :) Sent from my iPhone On Aug 4, 2010, at 11:45 PM, Daniel Kucharski dan...@inspiran.be wrote: In, In the progress of moving some of my doctrine / symphony 1.4 based project to a plugin I am facing problems generating form classess located in the new plugin. Beneath an excerpt of generated classes in this folder: /lib/forms/base/PluginBrandForm.class.php /lib/forms/doctrine/base/BasePluginBrandForm.class.php /lib/forms/sfXeriasPlugin/BrandForm.class.php /lib/forms/sfXeriasPlugin/BaseBrandForm.class.php I don t understand why /lib/forms/base/PluginBrandForm.class.php was generated and why /lib/forms/sfXeriasPlugin/BaseBrandForm.class.php extends class PluginBrandForm I already have rebuild the whole project and of course cleared the cache. Anyone thoughts how to resolve this issue? Additional info: the project itself has no forms anymore, everything has been moved to the plugin. Kind regards, Daniel -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: change symfony installation type: PEAR to individual folder (lib/vendor)
Fortunatly it worked without any huge problems. I just had to configure the link in the ProjectConfiguration.class.php. Best regards -- 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: problem with $form-getObject()
I'd update the object directly instead of the values: $this-object-setPublication('test'); $this-object-Authors-get(null); kind regards, Johannes On 26 Jul., 02:18, Devang Modi dpm...@gmail.com wrote: I found doUpdateObject to update publication and it worked. But same thing I tried with many to many relationship it didn't work. I change my YML; Dauthor: tableName: dauthor columns: id: { type: integer(4), unsigned: true, primary: true, autoincrement: true } name: { type: string(30), unique: true } publication: { type: string(30), unique: true } relations: Dbook: class: Dbook refClass: DauthorBook local: dauthor_id foreign: dbook_id In protected function doUpdateObject($values) { values[publication] = test; // This works values[dauthor_list] = array(1); //this doesn't work parent::doUpdateObject($values); } Even I do unset(values[dauthor_list]) doesn't help. any suggests? Thanks, Devang. On Sun, Jul 25, 2010 at 10:12 PM, Devang Modi dpm...@gmail.com wrote: Hi, I am new to symfony and need help populate field after form submission. I unset form field so that user won't able to see. Once form has been submitted I want to populate that field with default value. In YML file Dbook: tableName: dbook columns: id: { type: integer(4), unsigned: true, primary: true, autoincrement: true } name: { type: string(30), unique: true } publication: { type: string(30), unique: true } In DbookForm: unset($this[publicatoin]) In Action file; if ($form-isValid()) { $book = $form-getObject(); if ($book-isNew()) { $book-setPublication(test); } $book = $form-save(); $this-redirect('book/index'); } But this doesn't work. I can do workaround by showing field and hiding with javascript but I don't like that. Is that better way to solve this issue? Thanks, Devang. -- 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] change symfony installation type: PEAR to individual folder (lib/vendor)
Hello, I need to change the installation type of one project. Right now its running on a PEAR-based Symfony. I want to change it to a folder-based installation (lib/vendor/...). I've already installed symfony accordingly, but it wont work. Is there anything in my project configuration I need to adapt? Regards Johannes -- 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 1.4: Get current route name
Hello, How can I get the current route name in the module's action? This is my route: powerplantsTypes: url: /type/:slug.html param: { module: powerplants, action: list } In the action i want the retrieve the route name 'powerplantsTypes'. Thanks in advance! -- 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: ahDoctrineEasyEmbeddedRelationsPlugin many to many
When I deal with collections in forms, I always use an instance of a base collection form: http://github.com/schmittjoh/jmsFormsPlugin/blob/master/lib/form/jmsBaseCollectionForm.class.php I have only looked at your plugin superficially, but you might be able to solve some of your problems with nested embedded relations/multiple relations by using some of this code. Kind regards, Johannes On 21 Jul., 13:19, Daniel Lohse annismcken...@googlemail.com wrote: Sorry for getting back to you so late. Unfortunately many-to-many relations in embedded forms are *not* working and probably won't be for a while (or never). Two reasons for this: 1. The plugin is not ready for this as this means dealing with nested embedded relations which is not implemented right now (I have done some work on this but it's unfinished, wonky, and probably not going to work anyway :() 2. symfony has a critical bug that will (hopefully) be fixed according to Kris Wallsmith (the release manager of 1.3 and 1.4). Here's the ticket:http://trac.symfony-project.org/ticket/5867and here's his tweet about it:http://twitter.com/kriswallsmith/status/17993956854 So, in light of this it's highly unlikely that you'll fix this on your own (sorry about that, please prove me wrong, I'd like that! :)). If you have more ideas on how to deal with this, I'm open to suggestions. I'm also sorry to the bringer of bad news. :( Cheers, Daniel On 16.07.2010, at 12:10, François SEDE wrote: Thanks you. 2010/7/16 Daniel Lohse annismcken...@googlemail.com Sorry for not answering in a more timely manner — I'm the plugin developer. :) But as it's a bit late I'll answer your question tomorrow; I hope that alright. ;-) Cheers, Daniel Sent from my iPad On Jul 15, 2010, at 12:29 PM, François SEDE francois.s...@gmail.com wrote: Hi, I'm using the ahDoctrineEasyEmbeddedRelationsPlugin with a many to many relation and I have an error : 500 | Internal Server Error | Doctrine_Record_Exception Couldn't call Doctrine_Core::set(), second argument should be an instance of Doctrine_Collection when setting many-to-many references. Yaml : Event: actAs: { Timestampable: ~ } columns: ... relations: ... Participant: class: Profile local: event_id foreign: profile_id refClass: EventProfile Profile: actAs: { Timestampable: ~ } columns: ... relations: ... Event: class: Event local: profile_id foreign: event_id refClass: EventProfile EventProfile: columns: profile_id: type: integer event_id: type: integer relations: Profiles: class: Profile local: profile_id foreign: id onDelete: CASCADE Event: class: Event local: event_id foreign: id onDelete: CASCADE Here is my code : class EventForm extends BaseEventForm { public function configure() { ... $this-embedRelations(array( 'Participant' = array( 'considerNewFormEmptyFields' = array(), 'noNewForm' = false, 'newFormLabel' = 'New Adresse :', 'newFormClassArgs' = array(array('sf_user' = $this-getOption('sf_user'))), 'displayEmptyRelations' = false, 'formClassArgs' = array(array('ah_add_delete_checkbox' = false)), 'newFormAfterExistingRelations' = true, 'formFormatter' = null, 'multipleNewForms' = true, 'newFormsInitialCount' = 2, 'newFormsContainerForm' = null, 'newRelationButtonLabel' = '+', 'newRelationAddByCloning' = true, 'newRelationUseJSFramework' = 'jQuery', ) ) ); Can you help me please? Thanks for your Help -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email
[symfony-users] sfDoctrinePager: Retrieve all pages
Hi, I am using the sfDoctrinePager-Plugin and everything works fine. Now I need to create some kind of TOC (table of contents) which prints all pages items. It should look like this: Page 1: Headline A Headline B Page 2: Headline C Headline D Headline E Page 3: Headline F Headline G Headline H Do you have an idea how I can realize that task? Regards Johannes -- 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: EmbedForms/MainForm dependent field
In your embedded forms, you only have access to the values of the specific, embedded form. If you need the values of the TaskForm (the parent form), then you need to move your validation up to that form. E.g., you can add a post-validator to the TaskForm which validates your logic for each ReminderForm, and then throws errors for the fields in question (either a sfValidatorErrorSchema, or a sfValidatorError). kind regards, Johannes On 19 Jul., 13:19, cloui...@gmail.com cloui...@gmail.com wrote: Hi, I have a main form and some embedforms : one Task and many reminders form. My Task has a duedate, Reminders timeout is calculating from this duedate. I want to : - access to the duedate in the ReminderValidator doClean - to send an error if a reminder is set (on ReminderForm/embedform), and no duedate is set (on TaskForm/main form) How can I do all this ? Thanks ! -- 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: How to use template.filter_parameters event to change CSRF error message?
Hm, this looks like quite a bit of overhead. Have you tried sfValidatorBase::setDefaultMessage()? Kind regards, Johannes On Jul 15, 1:56 am, Sid Bachtiar sid.bacht...@gmail.com wrote: http://bluehorn.co.nz/2010/07/15/how-to-change-csrf-attack-message-in... On Thu, Jul 15, 2010 at 11:25 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Never mind, I found the answer in http://www.symfony-project.org/more-with-symfony/1_4/en/14-Playing-wi... On Thu, Jul 15, 2010 at 10:40 AM, Sid Bachtiar sid.bacht...@gmail.com wrote: Hi, I would like to change the CSRF error message and someone (Kris W) pointed out that I should use template.filter_parameters event. Could Kris or someone please give me more clues? Thanks, Sid -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Blue Horn Ltd - System Development http://bluehorn.co.nz -- Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz -- 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] sfEasyGMapPlugin: Mulitple maps on one page
Hi folks, Is there any possibility to include more then one map into a template? Regards Johannes -- 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] backend: date format in form
Hi symfonians! I need to create a backend form with a field for the created_at-date. I render it like this: ?php echo $form['created_at']-renderRow() ? I want just to output the day, month and year. How can I format the row? I need to format it in the form itself, not in the yaml-files. Greetings Johannes -- 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: Sending mail from a Form class.
doSave() is probably not the right place since it never gets called if you embed the PostForm somewhere. Johannes On Jul 2, 3:12 pm, cosmy c.zec...@gmail.com wrote: On 2 Lug, 05:58, pghoratiu pghora...@gmail.com wrote: From the first one the actual send is missing: // send the email $this-getMailer()-send($mail); gabriel It still doesn't work.. -- 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] Doctrine schema: two realtionships between two tables
Hi, I need a little help creating my schema. I am creating a gallery- module containing the two tables Gallery and GalleryPicture. First one stores the galleries with additional information, the second one stores the pictures. The tables are related over the gallery.id-field and the gallerypictures.gallery_id-field. Here you see the schema: Gallery: columns: name: { type: string(255), notnull: true } preview_image: { type: integer, default: NULL } GalleryPicture: columns: gallery_id: { type: integer } filename: { type: string(255), notnull: true } relations: Gallery: alias: Gallery foreignAlias: Pictures foreign: id local: gallery_id onDelete: CASCADE I want to define a preview image for every gallery. This image would be an image out of the GalleryPictures table. How can I declare this additional relationship? Thanks in advance! =) -- 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: SfValidatorAnd: does the order of the validators (arguments) care??
The order matters. Just have a look at the doClean() method of the sfValidatorAnd class. Johannes On 21 Mai, 19:48, Javier Garcia tirengar...@gmail.com wrote: Sorry, in that order it doesn't work. In the reverse order it works. On May 21, 7:12 pm, Javier Garcia tirengar...@gmail.com wrote: Hi, I have this code: $this-validatorSchema-setPostValidator(new sfValidatorAnd(array( new ValidatorPasswordActual(array(), array('invalid' = 'Contraseña actual incorrecta.')), new sfValidatorSchemaCompare('password_nuevo', sfValidatorSchemaCompare::EQUAL, 'password_confirmacion', array(), array('invalid' = 'Los dos passwords no coinciden')) In that order the validation works ok, but if i change the order it doesn't work ok. -- Javi Ubuntu 8.04 - Symfony 1.3 -- 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 athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: How to retrieve the value of a field in configure() function
You need to exchange the validator schema of the form with your own validator schema class, and overwrite the preClean() method there. This is the only way to ensure that your form behaves the same whether it is used standalone or embedded elsewhere. Johannes On 21 Mai, 15:04, kadia kadial...@gmail.com wrote: I want to set a validor for a field on configure (), but the field can be required or not, it depends on the value of another field. Now I need set the condition following the value of that filed but I can find the good function, for having that value. I have to use it one configure() function. class FormuleForm extends BaseFormuleForm { public function configure() { /// I have tried this, but it's not ok if ($this-getValue('idsitecompactage')==2) {$this-validatorSchema['commentaire']=new sfValidatorString(array('required' = true)); } *** } } -- 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 athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Templates in a single directory
I've struggled with this problem myself, and as far as my research went there are two possible solutions: 1. Overwrite getTemplateDirectory, getDecoratorDirectory of sfApplicationConfiguration in your appConfiguration class (i.e. frontendConfiguration). Pros: - looks like the cleaner approach, not all too much hacking necessary Cons: - context is not necessarily available, and must not be relied upon - limited information available to determine the path to a template 2. Create an own view class, and overwrite getDirectory, and getDecoratorDirectory Pros: - context always available - not necessary to alter any classes, and thus can be provided by a plugin Cons: - more hacking involved Johannes On 17 Mai, 09:29, Georg Gell geor...@have2.com wrote: It might be worth looking into using your own view class: something along class myView extends sfPHPView { public function setDirectory($directory){ $this-directory = $directory . '/theme'; //whatever, must be full path } } and in filters.yml rendering: class: myView But then caching will probably not differentiate between the themes, but that would be the next step ;-) Am 16.05.2010 19:53, schrieb Davide Borsatto: Hi everybody, for the project I've been working on I need to be able to define multiple themes. With theme I mean the full thing, including php code for the templates, images, stylesheets and javascripts too. But symfony templates structure is not quite friendly for this kind of operation, since we have files on - apps/frontend/templates/ - apps/frontend/modules/*/templates/ - web/images - web/css - web/js Which is not a good solution to mantain. My idea was to package themes in the data directory, creating something like - data -- themes --- default css js images templates modules - module1 - module2 Basically I need to be able to put every file needed in a single directory (like most CMS do). Since the data dir is not world wide accessible, I thought about creating a task that creates symlinks in the web directory, so this problem is easily solved. Now about the PHP files: what's the best solution to handle this? I think I have two choices: 1 make symfony look into the right directories, creating custom view and partial classes 2 making the apps/frontend/templates and apps/frontend/modules/*/ templates symlink to the directory theme I like more the first solution, but after a while looking in the symfony core I still can't figure out how to redirect all paths to the theme dir. Setting the global layout is as easy as doing sfConfig::set('sf_app_template_dir', $themeDir . '/templates') But module templates are a bit harder to configure. Actually, I still don't know how to do that :) So this is my question: which one is the best approach? I'd rather not have symlinks all over my project, but that seems to be the easiest solution (one console task to handle everything, no symfony classes to override, no risks to forget about this or that...). -- 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 athttp://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Transforming images after upload and before saving
Thanks! But there are still some ambiguities. All I want to to is to generate i resized image and a thumbnail from the uploaded image. The generation of the filename, etc. should remain with the symfony function. Do you have an advice, how that can be done? Am 11.04.2010 um 01:05 schrieb Alan Bem: Make it simpler - do it directly inside of forms you embed. /** * Read my comments. */ class ImageForm extends BaseImageForm { // configure() your form /** * This is hook used by Doctrine (and think Propel as well) form to modify * cleaned up (validated) values. * * This is simple example - make research on your own to understand it more. * * Create method name after update%column_name%Column() where %column_name% * is camelized column name where you store image filepath. */ protected function updateImageFilepathColumn(sfValidatedFile $file) { $image = new sfImage($file-getTempName(), $file-getType()); // Transform your $image here, but don't save it... unset($image); // instead // default symfony file saving logic return $this-processUploadedFile('image_filepath'); // 'image_filepath' should be column name where you store image filepath } /* * Create method name after generate%column_name%Filename() where %column_name% * is camelized column name where you store image filepath. */ protected function generateImageFilepathFilename(sfValidatedFile $file) { //optionaly you can... return $new_filename_for_image_file; // ...here } } Personally, I recommend sfImageTransformExtraPlugin. It is very unobstrusive, which means it requires less work for developer (You). Cheers, Alan -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en To unsubscribe, reply using remove me as the subject.
[symfony-users] Transforming images after upload and before saving
Hello, I've got a problem to solve, that I couldn't figure by myself. I've got a form with embedded forms. These embedded forms are there for uploading pictures. This works fine so far. What I need to be done is resizing AND thumbnailing the pictures with the sfImageTransformPlugin before they are saved. My corresponding function looks like this: (see also http://trac.symfony-project.org/browser/doc/branches/1.4/more-with-symfony/en/06-Advanced-Forms.markdown?rev=27587) public function saveEmbeddedForms($con = null, $forms = null) { if (null === $forms) { $pictures = $this-getValue('newPictures'); $forms = $this-embeddedForms; foreach ($this-embeddedForms['newPictures'] as $name = $form) { if (!isset($pictures[$name])) { unset($forms['newPictures'][$name]); } } } return parent::saveEmbeddedForms($con, $forms); } Can anyone tell my, how I can modify the pictures? Thanks! -- 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 To unsubscribe, reply using remove me as the subject.
[symfony-users] Admin generator, Doctrine, one-to-many relation
Hello, I'm having a problem that and I was not able to figure it by myself. I want to create a backend for a gallery with the admin generator. When I open a Gallery I want display all pictures in it. Galleries and Pictures are stored in two seperate tables. How can I display all pictures of a gallery, when editing this gallery? See the screenshot. This is the gallery-edit. Below it I want to list all the pictures from that gallery. Here is my schema: Galleries: actAs: Timestampable: ~ Sluggable: unique: true fields: [name] canUpdate: false columns: name: { type: string(255), notnull: true } description: { type: string(99) } created_at: { type: timestamp, notnull: true } updated_at: { type: timestamp, notnull: true } relations: Pictures: { local: id, foreign: gallery_id } Pictures: actAs: { Timestampable: ~ } columns: gallery_id: { type: integer, notnull: true } file: { type: string(255), notnull: true, unique: true } caption: { type: string(255) } source: { type: string(255) } created_at: { type: timestamp, notnull: true } updated_at: { type: timestamp, notnull: true } Regards, Johannes Trommer inline: Bild 1.png-- 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] Admin generator, Doctrine, one-to-many relation
Hello, I'm having a problem that and I was not able to figure it by myself. I want to create a backend for a gallery with the admin generator. When I open a Gallery I want display all pictures in it. Galleries and Pictures are stored in two seperate tables. How can I display all pictures of a gallery, when editing this gallery? See the screenshot. This is the gallery-edit. Below it I want to list all the pictures from that gallery. Here is my schema: Galleries: actAs: Timestampable: ~ Sluggable: unique: true fields: [name] canUpdate: false columns: name: { type: string(255), notnull: true } description: { type: string(99) } created_at: { type: timestamp, notnull: true } updated_at: { type: timestamp, notnull: true } relations: Pictures: { local: id, foreign: gallery_id } Pictures: actAs: { Timestampable: ~ } columns: gallery_id: { type: integer, notnull: true } file: { type: string(255), notnull: true, unique: true } caption: { type: string(255) } source: { type: string(255) } created_at: { type: timestamp, notnull: true } updated_at: { type: timestamp, notnull: true } Regards, Johannes Trommer -- 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. inline: Bild 1.png
[symfony-users] Symfony builts old tables that are not declared in schema.yml
Hello, While developing an application with symfony one table became dispensable. I removed it from schema.yml, cleared the cache and ran symfony doctrine:build --all --and-load --no-confirmation. After that the removed table still appears in my database. How can I fix this? Thanks in advance! -- 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 for Multiple Upload
Wrote this a few weeks ago: http://www.symfony-project.org/plugins/sfWidgetFormInputSWFUploadPlugin I'd be kind and helpful if you'd give it a try and help improve the javascripts/stylesheets for cross browser compatibility (think it works in major browsers = IE6. If you browse the plugin page you'll find many more widgets and/or media related plugins, many of them provide multiple file upload capabilities in various ways. Have fun :) On 2 Sep., 10:25, Avani avani.v.puj...@gmail.com wrote: Hi all, Anyone know any plugin available in symfony for multiple upload? I want to do that for multiple upload of pics for creating photo album like orkut and facebook.. Any Idea? Pls help me. Thanks in advance. --~--~-~--~~~---~--~~ 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: mysqli + doctrine
Thanks Masaki, thats what i already did: php5-mysql .deb-package is shipped with everything needed to build a mysql based php app. This was merly a question about if it is possible to explicit use mysqli with a php pdo-style driver/adapter (due to the fact that the built in doctrine-adapter Doctrine_Adapter_Mysqli seems to be outdated, broken or not fully implemented: it simply does not work). As you said: The Documentation seems partly outdated and/or different, too... But it seems that mysqli has already been superseded by PDO at the day of its creation, isn't it? Is there really an advantage by using mysql(improved) extension? Performance, newer mySQL Feature Support or what? §!%! php :D On 31 Aug., 14:19, Masaki masakielas...@gmail.com wrote: check this:http://www.symfony-project.org/doctrine/1_2/en/02-Connections Hmm, the description of supported drivers of symfony-project.org is different from the one of doctrine-project.org. As you say, There is no PDO_MYSQLi(http://php.net/manual/ pdo.drivers.php) and mysqli is not supported (see grep -r --exclude-dir=.svn mysqli *), so you need to install php5-mysql in Ubuntu.http://packages.ubuntu.com/jaunty/php5-mysql On Aug 30, 7:01 pm, Johannes Heinen johannes.hei...@googlemail.com wrote: Aye sorry, i use the latest sf 1.2.x with doctrine 1.1 On Aug 30, 11:46 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Hello anybody i wonder if and how it is possible to use a mysqli driver within symfony + doctrine. I am working on a standard ubuntu distri using php package (namely 5.2.6.x; configure says with mysqli and raw mysqli support is enabled by default, so says $ php -i(nfo()). The problem is, that when i specify mysqli as a PDO driver name (following the doctrine documentation that can be found here:http://www.doctrine-project.org/documentation/manual/1_1/en/introduct... an exception is thrown (unknown database driver mysqli). After a while searching for a extension named pdo_mysqli.so i must say that this extension does not exist, neither in the official ubuntu .deb- package source nor in pecl. Then i had the idea to try Doctrine_Adapter_Mysqli, but i don't know how to pass a custom connection as a replacement for databases.yml within symfony context. Additionally this trac entry seems to say that using Doctrine_Adapter_Mysqli is not a real solution:http://trac.doctrine-project.org/ticket/204 Has anybody an idea how to enable PDO-Support for mysqli, or if it is already built in the standard pdo_mysql-Driver? I have not enough knowledge about these php specific Database-internals Thanks in advance, joshi --~--~-~--~~~---~--~~ 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] mysqli + doctrine
Hello anybody i wonder if and how it is possible to use a mysqli driver within symfony + doctrine. I am working on a standard ubuntu distri using php package (namely 5.2.6.x; configure says with mysqli and raw mysqli support is enabled by default, so says $ php -i(nfo()). The problem is, that when i specify mysqli as a PDO driver name (following the doctrine documentation that can be found here: http://www.doctrine-project.org/documentation/manual/1_1/en/introduction-to-connections#dsn,-the-data-source-name:examples an exception is thrown (unknown database driver mysqli). After a while searching for a extension named pdo_mysqli.so i must say that this extension does not exist, neither in the official ubuntu .deb- package source nor in pecl. Then i had the idea to try Doctrine_Adapter_Mysqli, but i don't know how to pass a custom connection as a replacement for databases.yml within symfony context. Additionally this trac entry seems to say that using Doctrine_Adapter_Mysqli is not a real solution: http://trac.doctrine-project.org/ticket/204 Has anybody an idea how to enable PDO-Support for mysqli, or if it is already built in the standard pdo_mysql-Driver? I have not enough knowledge about these php specific Database-internals Thanks in advance, joshi --~--~-~--~~~---~--~~ 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: mysqli + doctrine
Aye sorry, i use the latest sf 1.2.x with doctrine 1.1 On Aug 30, 11:46 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Hello anybody i wonder if and how it is possible to use a mysqli driver within symfony + doctrine. I am working on a standard ubuntu distri using php package (namely 5.2.6.x; configure says with mysqli and raw mysqli support is enabled by default, so says $ php -i(nfo()). The problem is, that when i specify mysqli as a PDO driver name (following the doctrine documentation that can be found here:http://www.doctrine-project.org/documentation/manual/1_1/en/introduct... an exception is thrown (unknown database driver mysqli). After a while searching for a extension named pdo_mysqli.so i must say that this extension does not exist, neither in the official ubuntu .deb- package source nor in pecl. Then i had the idea to try Doctrine_Adapter_Mysqli, but i don't know how to pass a custom connection as a replacement for databases.yml within symfony context. Additionally this trac entry seems to say that using Doctrine_Adapter_Mysqli is not a real solution:http://trac.doctrine-project.org/ticket/204 Has anybody an idea how to enable PDO-Support for mysqli, or if it is already built in the standard pdo_mysql-Driver? I have not enough knowledge about these php specific Database-internals Thanks in advance, joshi --~--~-~--~~~---~--~~ 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: Media Library Plugin
Perhaps you could also take a look at sfFilebasePlugin, its a media library with frontend GUI, drag/drop stuff of files and also a fundamentally new way to deal with your files programmatically by providing a file management layer based on SPL classes. sfFilebasePlugin ships with an swfUpload form widget, sf 1.2 plus doctrine 1.1 support. On 6 Aug., 13:01, Kevin Bond kevinb...@gmail.com wrote: Hi Guys, Wondering if there is a media library plugin that is in development that is friendly with symfony 1.2 and doctrine (similar to sfMediaLibraryPlugin / sfAssetLibraryPlugin). -- Kevin --~--~-~--~~~---~--~~ 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: table_method problem
I had the same problem, and I traced it back to Connection::getTable. The root cause is that your table class is not loaded, and autoload is turned off. I'm not if there is any valid for this behavior since it affects all routing objects. The solution is to setAttribute (Doctrine::ATTR_AUTOLOAD_TABLES_CLASSES, true) for your connection, or to load the table class manually before it is needed. On 3 Aug., 20:30, Nei Rauni Santos nra...@gmail.com wrote: I'm trying to use the table_method option of my generator.yml file ( symfony version 1.2.7 (/usr/share/php/symfony) and Doctrine 1.2 ) Unknown method Doctrine_Table::retrieveBackendHotelDescriptionList I trace the error e put the var_dump on execption is called. 2606 } catch (Doctrine_Record_UnknownPropertyException $e) {} 2607 2608 var_dump( get_class($this), $method ); 2609 throw new Doctrine_Table_Exception(sprintf('Unknown method %s::%s', get_class($this), $method)); 2610 } lib/vendor/doctrine/Doctrine/Table.php 2611L, 88104C gravado(s) the result is string 'Doctrine_Table' *(length=14)* string 'retrieveBackendHotelDescriptionList' *(length=35)* It mean that the doctrine is finding my method on Doctrine_Table class and not in HotelDescription class.. my generator file is: generator: class: sfDoctrineGenerator param: model_class: HotelDescription theme: admin non_verbose_templates: true with_show: false singular: ~ plural: ~ route_prefix: hotel_description_hotelDescription with_doctrine_route: 1 config: actions: ~ fields: DescriptionType: {label: Tipo de Descrição} _description: {label: Descrição} description_type_id: {label: Tipo de Descrição} list: title: Lista de Descrição de Hoteis actions: {} max_per_page: 10 batch_actions: {} object_actions: _edit: ~ display: [Hotel, DescriptionType, description] table_method: retrieveBackendHotelDescriptionList filter: Any idea about it??? +55 41 85020985 --~--~-~--~~~---~--~~ 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: plugins ....
Hi, to comment only one aspect: anyway, now i wonder... if there would be any sf 1.3 compatible plugins within in a month from 1.3 official release. (to say so: raise your hand those of you who had work / or who is working to upgrade a plugin from 1.1/ 1.2 to 1.3 version )... I think this is merly a problem resulting in the support (and probably maintain- horror) of two ORM. Many plugins are redundant because one was written for propel, while its pentant is doctrine based. Since symfony in most aspects is backwards compatible and well designed, man could say that the codebase is a good platform for developing plugins with an easy to do long-term support - if man is motivated enough to put work into such a thing at weekend that he won't be paid for (not mentioning glory and honor, though). Nobody could imagine that propel would go to sleep so fast (i heard rumors that there is an almighty php5.3 based RC to be released in september, but that may not be true at all) - so i can only imagine that it was a hard decision to support both orms - because that is a lot of work for the core devel team. Note that these built in orm plugins are not only copy'n'pasted but enriched with a lot of sf specific code. So i would guess that it would be best to drop one orm (beginning with the letter p) and to build up a completely symony specific orm based on that beginning with d. That would make half of all plugins beeing obsolete - or force their developers to put some work into it to make it compatible with sf1.3 ;) But i appreciate that this would be reallly mean :'( just 2 euro-cents! On 30 Jun., 18:50, Alexandru-Emil Lupu gang.al...@gmail.com wrote: HI! I see that most of us think alike about the plugins... I have thought recently (based on that ecommerce solution ), that the time invested by developers to reinvent the wheel, could be more kindly redirected somewhere else. For example, i would like to ask you: how many of you are using phpBB or SMF or YaBB forum engine on their current projects? It would not have been easier to have a good and stable plugin as forum engine, that you could integrate in your current application without too many time spent on theme customization on the Yabb implementation (for example). I know there are 2 forum plugins available (sfSimpleForum - for sf 1.0 and another one for 1.2). I never used 1.2 plugin version... anyway, now i wonder... if there would be any sf 1.3 compatible plugins within in a month from 1.3 official release. (to say so: raise your hand those of you who had work / or who is working to upgrade a plugin from 1.1/ 1.2 to 1.3 version )... When i have launched this thread, i was thinking more to a organization of the plugins developers. For instance, i am planning to start coding a helpDesk plugin. I have asked 2 people if they wanna join in this project, but only one answered positive. I would like to ask you as well. if you want, i could brief you in a new thread about that i have in mind I haven't opened this thread because of my plugin or so... but i was thinking more a opening to make multiple application plugins. (like: blog, forum, wiki, helpdesk, shop, photo album, an erp solution etc). I guess that some of you might faced the need to implement let's say a CMS, a forum, the specific project requirements. Now i would ask you: how much time have you ever lost with things like forum implementation or some other 3rd party open source software ? I just wonder for example if someone thought to write down: - a amazon s3 plugin, for maniputalion of the static files. - if there is a plugin that if could handle and work with SMPP protocol ( smpp is for website sms service ) - video / sound streaming + i could think and write many more.. but this is not the main ideea of this thread Alecs On Tue, Jun 30, 2009 at 6:35 PM, Richtermeister nex...@gmail.com wrote: Hey Lee, I assume what you mean is the similarity in argument between having a single ecommerce application for ecommerce purposes, and having a single plugin for, say, feed purposes. I don't think the two are the same discussions - they differ on scale. I can very well argue that an all in one ecommerce solution would be undesirable, while a single feed plugin would be a good thing, because the two differ wildly on the number of decisions they made for the developer. When something has a narrow focus, like feeds, all our needs are very much alike, so it is possible to have a uniform solution for everybody. With something as complex as ecommerce... that shoe would never fit everybody. Of course sometimes it might take 3 mediocre plugins of the same type to inspire the creator of the 4th plugin that makes the other 3 obsolete, so it's good to have some code diversity. What I am arguing though is that we seem to be missing a step where we say, ok, something new just came out, and let's see if we can't retire or update
[symfony-users] Re: mime type detection
Hi Jon, sure i had already taken a look at the file validator and borrowed some inspiration from there *cough* ;) - to not to use the word theft. And indeed, most interesting for me was this little system call for guessing the mime type from its binary, this was the only approach i did not know so far. Though this also would not solve the very specific problem mentioned above - only a programmatic solution as proposed by Juan would help, and man must decide if the effort would be worth it. To be honest, this all is for a plugin which aims to centralize all the files related stuff in one collection of php classes instead of having a validator there, and a file class there, and a upload utility there and so on. I don't actually know if its the right way looking at such details, and mime detection is only a small part of it. But i think, with all these very intelligend guessing approaches, i should be on a good way without reinventing the wheel twice or more. So thank you for your help (and your great work on doctrine and symfony, especially :), as i say thank you to the other guys, sure.) best regards joshi On 24 Jun., 15:18, Jonathan Wage jonw...@gmail.com wrote: Forgive me if someone already suggested this but you should look at the code built in to symfony. lib/validator/sfValidatorFile.class.php It has some nice code for guessing mime types several different ways. Including fileinfo, guessing from binary info, extension, etc. - Jon On Wed, Jun 24, 2009 at 8:14 AM, Juampy72 juamp...@gmail.com wrote: Hi Joshi, I have not installed fileinfo on Ubuntu but these instalation instructions should help you through: http://pecl.php.net/package/Fileinfo Cheers, Juan On Jun 23, 2:31 pm, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi Juan, I think i'll follow your advice, i actually discovered no other case where such a conflict as the above discribed occured. I now have a simple array list that holds the special case, and if another one occures, i can put it in there. Hm, i must confess, i do not even know how to find the magic database on my ubuntu jaunty :D), but i do not want to bother you. (will read the docs more intensive one day) But: It would be interesting if it is possible to build a snapshot of this database file to include it in your projects for distribution. Ok, than i probably will not get any updates from the os. Hmm hmm... I probably think to complicated. Many thanks for your patience :), i'll try mark this thread as solved with this post. greetings joshi On 23 Jun., 15:05, Juampy72 juamp...@gmail.com wrote: Joshi, The system I was working on for 2 years received lot's of different filetypes (image, audio, video and documents) and very very rarelly (whenever there was a radically new video codec, for example) I had to update the magic database. I am pretty sure file info can do the job although you will have to use a switch or nested ifs instead of an xml structure for special cases. Cheers, Juan On Jun 22, 8:42 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi Juan, this is exactly what i actually trust in, namely that such cases won't occure really often. But i heard about similar problems with microsoft office document formats and so it did not set my mind on rest about it. The thing with if/else is problably a robust solution. But i am merely looking for a generalizing and extensible thing. I'd seen many approaches out there, and relying on that i aim to implement a rock solid library which guesses mime types as accurate as possible by letting it programmatically chose the correct mime guessing approach in the correct order, depending on a so so say file type cascade. Ok, i see it is a very special thing, perhaps it is too easy to asc if there is somewhere a list of file types that rely or cover a subset of other types. But it was worth trying, i think ;) Thanks all and have a nice day joshi On 21 Jun., 16:40, Juampy72 juamp...@gmail.com wrote: Johannes, I have been using fileinfo for two years with many different file types and very rarely I had an unexpected mimetype. You can even modify the magic database to add your own mimetypes. Have you actually tested file info with an odt file? Does it return application/zip? If so, I guess you can just add an if statement to check if you are against an odt file. I am pretty sure there wont be many other cases like this one. Cheers, Juan Pablo On Jun 20, 11:25 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Sorry, but i thing you did not get the point. My english is not the best, thus it is not my native language, and so i have
[symfony-users] Re: Image Upload safety help
Hi, fancyupload and swfupload (google shows the urls) are the 2 flash upload scripts i know that can be easily integrated into a form (or can be used without one, though). There are symfony plugins for swfupload, i don't know if one for fancyupload also exists. On of them, the 1.2 plugin, was written by me, but it is more intendent to be used within a sfForm together with javascript-serialization, so this should be less interesting for you. I you only want to have a push button, than you'll be probably lucky with fancyupload, though it requires mootools to run its frontend. swfupload is more flexible and highly customizable. Note that you'll face a general problem: At the time the user puts the files onto the server, still no unique identifier exists for the dataset that would have been saved if the user had had submitted the form. cheers de joshi On 23 Jun., 20:09, Eno symb...@gmail.com wrote: On Tue, 23 Jun 2009, kevinkevin wrote: What I want is a flash piece that mimics the file tag [__] [browse] and then when you click browse it is able to browse the PC file structure and limit files to certain extensions and also file size (say 2M) . Then it could either upload the image in real time and save a key/id to a hidden tag in the form? or dynamically generate and populate a file tag in the form with the file path. Does this make sense? and is anyone familiar with any small flash type scripts that do this or similar to solve my problem? We successfully used the imagemanager component with TinyMCE to manage images uploads. Its integrated into the WYSIWYG editor so the user can edit descriptions and insert text right there. Note: Image manager is a plugin for TinyMCE and is not free (but quite cheap). Seehttp://tinymce.moxiecode.com/plugins_imagemanager.php -- --~--~-~--~~~---~--~~ 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] [solved] mime type detection
Hi Juan, I think i'll follow your advice, i actually discovered no other case where such a conflict as the above discribed occured. I now have a simple array list that holds the special case, and if another one occures, i can put it in there. Hm, i must confess, i do not even know how to find the magic database on my ubuntu jaunty :D), but i do not want to bother you. (will read the docs more intensive one day) But: It would be interesting if it is possible to build a snapshot of this database file to include it in your projects for distribution. Ok, than i probably will not get any updates from the os. Hmm hmm... I probably think to complicated. Many thanks for your patience :), i'll try mark this thread as solved with this post. greetings joshi On 23 Jun., 15:05, Juampy72 juamp...@gmail.com wrote: Joshi, The system I was working on for 2 years received lot's of different filetypes (image, audio, video and documents) and very very rarelly (whenever there was a radically new video codec, for example) I had to update the magic database. I am pretty sure file info can do the job although you will have to use a switch or nested ifs instead of an xml structure for special cases. Cheers, Juan On Jun 22, 8:42 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi Juan, this is exactly what i actually trust in, namely that such cases won't occure really often. But i heard about similar problems with microsoft office document formats and so it did not set my mind on rest about it. The thing with if/else is problably a robust solution. But i am merely looking for a generalizing and extensible thing. I'd seen many approaches out there, and relying on that i aim to implement a rock solid library which guesses mime types as accurate as possible by letting it programmatically chose the correct mime guessing approach in the correct order, depending on a so so say file type cascade. Ok, i see it is a very special thing, perhaps it is too easy to asc if there is somewhere a list of file types that rely or cover a subset of other types. But it was worth trying, i think ;) Thanks all and have a nice day joshi On 21 Jun., 16:40, Juampy72 juamp...@gmail.com wrote: Johannes, I have been using fileinfo for two years with many different file types and very rarely I had an unexpected mimetype. You can even modify the magic database to add your own mimetypes. Have you actually tested file info with an odt file? Does it return application/zip? If so, I guess you can just add an if statement to check if you are against an odt file. I am pretty sure there wont be many other cases like this one. Cheers, Juan Pablo On Jun 20, 11:25 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Sorry, but i thing you did not get the point. My english is not the best, thus it is not my native language, and so i have to apologize if i did not point the problem clearly. I am actually using more than one approach to detect (guess) the mime type of a file, the mime magic extension in one of it. But the problem is the following: Consider a file named document.odt. This file is actually a zip compressed folder (OpenOffice uses this to minimize document file size), containing the meta data and text of an open office document. If you let mime magic determine the file type, than you'll probably get application/zip. But if you now that this mime type can have different percularities (namely an open office document or a zip compressed file/folder), you could also put this information into a file to guess the real mime type more accurately. So the way would the following: check mime type = application/zip = can contain either a zip file or be an open office document, so additionally check the file extension, if it is .odf, than deliver the *really* correct IANA mime type application/vnd.oasis.opendocument.text. Concider that mime magic methods check the first few raw bytes of a file, and not regarding if you deal with a .odf or a .zip, you'll get the tokens that identify a zip compressed file. thank you in advance for every hint, where i could eventually find a structured (xml?) file where these relations between a (raw-guessed) mime type and its finer guessed mime types, depending on a file's extensions are deposited? greetings de joshi On Jun 20, 4:08 pm, Eno symb...@gmail.com wrote: On Sat, 20 Jun 2009, Johannes Heinen wrote: i am looking for a kind of advanced mime type detection for a yet another symfony assets library plugin. For example, an open office document is simply a zip compressed folder, so it's mime type is detected as application/zip. So man would have to check if a mime type application/zip occurs, and after that to check other criteria (namely
[symfony-users] Re: Image Upload safety help
Ärm *working* depends on what you mean with that ;). Ok, to be honest: It is a week old and has been tested on a fox3, linux flash 10 plugin and symfony 1.2. I cannot guarantee cross browser compliance yet, because i am still writing on it - i plan a 1.0 release for all related plugin with symfony 1.3. There are no critical issues at all, but it probably will come to display issues in IE6 and so on, the usual problems. The good news: it is not abandoned, so if you'll give it a try i can look after some issues in relatively short time periods. But as i said before: First take a look at the raw swfupload script with its demo-queue implementation or the old swfupload symfony plugin for symfony 1.0 version, it will probably work with 1.2 also. To answer your questions: These widgets provide javascript callbacks to process server responses, so that you are able to inform the client browser with additional information after a file has been uploaded. The more special your requirements are, the more time you'll probably have to spent writing javascript. greetings joshi On 23 Jun., 20:44, kevinkevin kschae...@gmail.com wrote: Is your plugin working? it appears to say not documented or cross browser checked thanks Kevin On Jun 23, 11:20 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi, fancyupload and swfupload (google shows the urls) are the 2 flash upload scripts i know that can be easily integrated into a form (or can be used without one, though). There are symfony plugins for swfupload, i don't know if one for fancyupload also exists. On of them, the 1.2 plugin, was written by me, but it is more intendent to be used within a sfForm together with javascript-serialization, so this should be less interesting for you. I you only want to have a push button, than you'll be probably lucky with fancyupload, though it requires mootools to run its frontend. swfupload is more flexible and highly customizable. Note that you'll face a general problem: At the time the user puts the files onto the server, still no unique identifier exists for the dataset that would have been saved if the user had had submitted the form. cheers de joshi On 23 Jun., 20:09, Eno symb...@gmail.com wrote: On Tue, 23 Jun 2009, kevinkevin wrote: What I want is a flash piece that mimics the file tag [__] [browse] and then when you click browse it is able to browse the PC file structure and limit files to certain extensions and also file size (say 2M) . Then it could either upload the image in real time and save a key/id to a hidden tag in the form? or dynamically generate and populate a file tag in the form with the file path. Does this make sense? and is anyone familiar with any small flash type scripts that do this or similar to solve my problem? We successfully used the imagemanager component with TinyMCE to manage images uploads. Its integrated into the WYSIWYG editor so the user can edit descriptions and insert text right there. Note: Image manager is a plugin for TinyMCE and is not free (but quite cheap). Seehttp://tinymce.moxiecode.com/plugins_imagemanager.php --- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: mime type detection
Hi Juan, this is exactly what i actually trust in, namely that such cases won't occure really often. But i heard about similar problems with microsoft office document formats and so it did not set my mind on rest about it. The thing with if/else is problably a robust solution. But i am merely looking for a generalizing and extensible thing. I'd seen many approaches out there, and relying on that i aim to implement a rock solid library which guesses mime types as accurate as possible by letting it programmatically chose the correct mime guessing approach in the correct order, depending on a so so say file type cascade. Ok, i see it is a very special thing, perhaps it is too easy to asc if there is somewhere a list of file types that rely or cover a subset of other types. But it was worth trying, i think ;) Thanks all and have a nice day joshi On 21 Jun., 16:40, Juampy72 juamp...@gmail.com wrote: Johannes, I have been using fileinfo for two years with many different file types and very rarely I had an unexpected mimetype. You can even modify the magic database to add your own mimetypes. Have you actually tested file info with an odt file? Does it return application/zip? If so, I guess you can just add an if statement to check if you are against an odt file. I am pretty sure there wont be many other cases like this one. Cheers, Juan Pablo On Jun 20, 11:25 am, Johannes Heinen johannes.hei...@googlemail.com wrote: Sorry, but i thing you did not get the point. My english is not the best, thus it is not my native language, and so i have to apologize if i did not point the problem clearly. I am actually using more than one approach to detect (guess) the mime type of a file, the mime magic extension in one of it. But the problem is the following: Consider a file named document.odt. This file is actually a zip compressed folder (OpenOffice uses this to minimize document file size), containing the meta data and text of an open office document. If you let mime magic determine the file type, than you'll probably get application/zip. But if you now that this mime type can have different percularities (namely an open office document or a zip compressed file/folder), you could also put this information into a file to guess the real mime type more accurately. So the way would the following: check mime type = application/zip = can contain either a zip file or be an open office document, so additionally check the file extension, if it is .odf, than deliver the *really* correct IANA mime type application/vnd.oasis.opendocument.text. Concider that mime magic methods check the first few raw bytes of a file, and not regarding if you deal with a .odf or a .zip, you'll get the tokens that identify a zip compressed file. thank you in advance for every hint, where i could eventually find a structured (xml?) file where these relations between a (raw-guessed) mime type and its finer guessed mime types, depending on a file's extensions are deposited? greetings de joshi On Jun 20, 4:08 pm, Eno symb...@gmail.com wrote: On Sat, 20 Jun 2009, Johannes Heinen wrote: i am looking for a kind of advanced mime type detection for a yet another symfony assets library plugin. For example, an open office document is simply a zip compressed folder, so it's mime type is detected as application/zip. So man would have to check if a mime type application/zip occurs, and after that to check other criteria (namely the file extension, .odt). In Java, there exists a few packages to detect (guess) mime types depending of file headers (MimeMagic), extension and so on. Additionally you can maintain an xml file that describes the recursive dependancies between mime-types and extensions, so that you can build up a conditional tree: guess mime type of writing.odt = app/zip = does it end with .odt? then its an open office document, else it is a zip compressed folder Ok, my question is: Are any structured lists like that out there for free use, that man could use to implement an advanced mime type guesser in PHP? No need to reinvent:http://us2.php.net/manual/en/intro.fileinfo.php -- --~--~-~--~~~---~--~~ 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: doctrine errors
Hey Rajat, could you *please* leave my Thread (its mine, my pecious ;)) and re-open a thread for your issue? Or is this a google database problem - because i had a mime type related question, and you actually want to discuss a doctrine specific issue in the same thread Thanks and a nice weekend de joshi On 20 Jun., 18:11, Rajat Pandit rpan...@gmail.com wrote: I am actually stranded because of this as the admin generator doesnt work either. i am running: symfony version 1.2.7 and doctrine: const VERSION = '1.0.7'; cheers - Rajat Rajat Pandit wrote: Hello All, I keeping getting these errors when i do the std doctrine:build-all-load doctrine Could not create database for c...logrollplease'; database exists doctrine generating model classes doctrine generating sql for models Warning: stripos() expects parameter 1 to be string, array given in /home/rp/websites/blog-admin/trunk/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php on line 994 Notice: Array to string conversion in /home/rp/websites/blog-admin/trunk/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php on line 1011 Notice: Array to string conversion in /home/rp/websites/blog-admin/trunk/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php on line 1015 has anyone come across these errors and/or knows of any suggested fixes for this. cheers - Rajat --~--~-~--~~~---~--~~ 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] mime type detection
Hi all, i am looking for a kind of advanced mime type detection for a yet another symfony assets library plugin. For example, an open office document is simply a zip compressed folder, so it's mime type is detected as application/zip. So man would have to check if a mime type application/zip occurs, and after that to check other criteria (namely the file extension, .odt). In Java, there exists a few packages to detect (guess) mime types depending of file headers (MimeMagic), extension and so on. Additionally you can maintain an xml file that describes the recursive dependancies between mime-types and extensions, so that you can build up a conditional tree: guess mime type of writing.odt = app/zip = does it end with .odt? then its an open office document, else it is a zip compressed folder Ok, my question is: Are any structured lists like that out there for free use, that man could use to implement an advanced mime type guesser in PHP? Thanks in advance and a nice weekend de joshi --~--~-~--~~~---~--~~ 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: mime type detection
Sorry, but i thing you did not get the point. My english is not the best, thus it is not my native language, and so i have to apologize if i did not point the problem clearly. I am actually using more than one approach to detect (guess) the mime type of a file, the mime magic extension in one of it. But the problem is the following: Consider a file named document.odt. This file is actually a zip compressed folder (OpenOffice uses this to minimize document file size), containing the meta data and text of an open office document. If you let mime magic determine the file type, than you'll probably get application/zip. But if you now that this mime type can have different percularities (namely an open office document or a zip compressed file/folder), you could also put this information into a file to guess the real mime type more accurately. So the way would the following: check mime type = application/zip = can contain either a zip file or be an open office document, so additionally check the file extension, if it is .odf, than deliver the *really* correct IANA mime type application/vnd.oasis.opendocument.text. Concider that mime magic methods check the first few raw bytes of a file, and not regarding if you deal with a .odf or a .zip, you'll get the tokens that identify a zip compressed file. thank you in advance for every hint, where i could eventually find a structured (xml?) file where these relations between a (raw-guessed) mime type and its finer guessed mime types, depending on a file's extensions are deposited? greetings de joshi On Jun 20, 4:08 pm, Eno symb...@gmail.com wrote: On Sat, 20 Jun 2009, Johannes Heinen wrote: i am looking for a kind of advanced mime type detection for a yet another symfony assets library plugin. For example, an open office document is simply a zip compressed folder, so it's mime type is detected as application/zip. So man would have to check if a mime type application/zip occurs, and after that to check other criteria (namely the file extension, .odt). In Java, there exists a few packages to detect (guess) mime types depending of file headers (MimeMagic), extension and so on. Additionally you can maintain an xml file that describes the recursive dependancies between mime-types and extensions, so that you can build up a conditional tree: guess mime type of writing.odt = app/zip = does it end with .odt? then its an open office document, else it is a zip compressed folder Ok, my question is: Are any structured lists like that out there for free use, that man could use to implement an advanced mime type guesser in PHP? No need to reinvent:http://us2.php.net/manual/en/intro.fileinfo.php -- --~--~-~--~~~---~--~~ 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: Doctrine File upload trouble
It is probably not the best solution for your problem, but if you'd use sfFilebasePlugin which supports a few doctrine based asset management capabilities added to various file handling stuff based on SPL, you could help me to improve the plugin and provide a stable assets manager for sf 1.2 + doctrine not depending on compat1.0 stuff. Please don't feel annoyed by this commercial for my plugin, it is only that i spent a lot of time into this stuff in my free time, but because of the beta state and user counter (the one user of the plugin out there is me :D) i'd love to get some feedback from other users or perhaps even improvements. If you decide to take alook on it, use the pre packaged pear stuff, the svn trunk is in devel state and not yet ready to use (i actually work on a multi file upload widget). Greetings Joshi On 8 Jun., 09:48, mlmarius mlmar...@gmail.com wrote: If you are refering to the mime types , as i've said above , i did set the mime types. If not please be more specific ... to which type are you referring ? On 8 Iun, 10:43, Thomas Rabaix thomas.rab...@gmail.com wrote: The error comes from Doctrine Validation feature. You have to set the 'type' field, or disable the feature On Sun, Jun 7, 2009 at 7:44 PM, mlmarius mlmar...@gmail.com wrote: I first provided an array of mime types and after that i tried with the mime category but still nothing, same error . -- Thomas Rabaixhttp://rabaix.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~--~~~~--~~--~--~---
[symfony-users] Re: sfDoctrinePlugin/sf1.2
Still no problem at all using the latest doctrine 1.1 branch + the latest symfony 1.2 branch. But because of the trouble man have if he wants to install a plugin which only runs under doctrine 1.1, i wanted to revert the orm layer version to 1.0. There i encountered another issue that has obviously been fixed in the latest doctrine 1.1 branch. My schema: sfAbstractFile: tableName: sf_abstract_files columns: filename: { type: string(255), notnull: true } hash: { type: string(255), notnull: true } comment:{ type: string, notnull: false } title: { type: string(255), notnull: false } environment:{ type: string(255), notnull: false } application:{ type: string(255), notnull: false } tags: { type: string(255), notnull: false } actAs: NestedSet: hasManyRoots: true, rootColumnName: root_id relations: rootNode: class:sfFilebaseDirectory local:root_id foreign: id onDelete: cascade onUpdate: cascade foreignAlias: descendants sfFilebaseFile: ... a few instances that inherit from sfAbstractFile With doctrine 1.1 everything works nice, but in doctrine 1.0 the explicit definition of the first foreign key relationship to the same table/relation (through sfAbstractFile.root_id and sfAbstractFile.id (the PK) you are not able to generate your sql. Models, forms etc. work fine, but sql generation raises an error. I would be really happy and thankful if one could tell me WHY it is not recommended to use the 1.1 branch with symfony 1.2 and which migritation problems are there. Perhaps man could help and do some slavery work? ;) Thank you in advance, de joshi On May 19, 1:53 pm, Johannes Heinen johannes.hei...@googlemail.com wrote: :D ok, i have an idea: it *may* be that it works because i store doctrine 1.1 in ./lib/ventor/doctrine, but there is also the origin sfFilebasePlugin under ./lib/vendor/symfony/plugins/ sfDoctrinePlugin/... So it is probable that the generator uses the old doctrine 1.0 tasks and the runtime the doctrine 1.1 libraries. I prefer to say never change a running system On May 19, 1:49 pm, Johannes Heinen johannes.hei...@googlemail.com wrote: In this (my) special case it seems to work - but i did not even touch the most complex doctrine possibilities. In my test environment i installed doctrine 1.1 - by following the guide - from svn. But it seems also possible to define it as an dependency in package.xml to ship it with a plugin - regarding the advice to change the ProjectConfiguration.php I use 3 Tables with relationships and column aggregation inheritance. I do not use any behaviours at this time, so i cannot say anything about that. I use the preSave() trigger to save a directory- or filename and synchronizing existing files in my architectures file system according to the model changes - using getModified(true), this seems to work nicely. I discovered no autoloading issues yet as it is proclaimed in one of the blog's comments. Let's see... i'll play around with it a while. On May 19, 10:59 am, David Ashwood da...@inspiredthinking.co.uk wrote: There was some chatter about a month ago about some issues running Doctrine 1.1 with sf 1.2 (I can't find the topic at the mo and I can remember what the issues were). In the url you posted there should be a link to a trac ticket - which you'll need to checkout for some additional changes you'll need to implement. jw probably has a better idea of the issues than anybody - so he might chip in with some tips if he has the time. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 10:40 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 Hey again, i've found this link: 2 lines to migrate the new doctrine 1.1 version into the sf 1.2 release. Perhaps somebody considers it helpful. http://www.symfony-project.org/blog/2009/01/12/call-the-expert-using-... m-version-of-doctrine So my previous comment seems to be obsolete (as most times^^ ;)). I'll try it out and write a line on how it worked. Thanks :) On May 19, 10:31 am, Johannes Heinen johannes.hei...@googlemail.com wrote: hey:) Sorry for the confusion: I've found out that the doctrine plugin shipped with symfony 1.2 is based on the 1.0 release of doctrine - as you already said it - i had read this small, but important notice recently in the doctrine 1.1 release notes:http://www.doctrine-project.org/blog/doctrine-1-1-released. And you are right: This release does not log the changes made on a Doctrine_Record instance yet :( So my provided solution
[symfony-users] Re: sfDoctrinePlugin/sf1.2
hey:) Sorry for the confusion: I've found out that the doctrine plugin shipped with symfony 1.2 is based on the 1.0 release of doctrine - as you already said it - i had read this small, but important notice recently in the doctrine 1.1 release notes: http://www.doctrine-project.org/blog/doctrine-1-1-released. And you are right: This release does not log the changes made on a Doctrine_Record instance yet :( So my provided solution *will not work* for the current symfony release. Hopefully the new doctrine release will be patched into the sf 1.2 plugin, but as you can read in the doctrine's release notes: it seems even not to be clear if the new version will be shipped with the sf 1.3 final. :( Damn, but I need this stuff ^^ Thanks, Joshi On May 19, 9:53 am, David Ashwood da...@inspiredthinking.co.uk wrote: It exists also in the 1.0 version Doctrine that comes with Symfony 1.2 :) Watch out though - It'll only work with the current record - with Doctrine 1.1 you can also optionally check child records. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 00:17 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 whoho, got it. For the ones who want to know: http://www.doctrine-project.org/documentation/manual/1_1/en/component... ew getModified(true) is the keyword. thanks. On 18 Mai, 18:17, Johannes Heinen johannes.hei...@googlemail.com wrote: HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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: sfDoctrinePlugin/sf1.2
Hey again, i've found this link: 2 lines to migrate the new doctrine 1.1 version into the sf 1.2 release. Perhaps somebody considers it helpful. http://www.symfony-project.org/blog/2009/01/12/call-the-expert-using-a-custom-version-of-doctrine So my previous comment seems to be obsolete (as most times^^ ;)). I'll try it out and write a line on how it worked. Thanks :) On May 19, 10:31 am, Johannes Heinen johannes.hei...@googlemail.com wrote: hey:) Sorry for the confusion: I've found out that the doctrine plugin shipped with symfony 1.2 is based on the 1.0 release of doctrine - as you already said it - i had read this small, but important notice recently in the doctrine 1.1 release notes:http://www.doctrine-project.org/blog/doctrine-1-1-released. And you are right: This release does not log the changes made on a Doctrine_Record instance yet :( So my provided solution *will not work* for the current symfony release. Hopefully the new doctrine release will be patched into the sf 1.2 plugin, but as you can read in the doctrine's release notes: it seems even not to be clear if the new version will be shipped with the sf 1.3 final. :( Damn, but I need this stuff ^^ Thanks, Joshi On May 19, 9:53 am, David Ashwood da...@inspiredthinking.co.uk wrote: It exists also in the 1.0 version Doctrine that comes with Symfony 1.2 :) Watch out though - It'll only work with the current record - with Doctrine 1.1 you can also optionally check child records. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 00:17 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 whoho, got it. For the ones who want to know: http://www.doctrine-project.org/documentation/manual/1_1/en/component... ew getModified(true) is the keyword. thanks. On 18 Mai, 18:17, Johannes Heinen johannes.hei...@googlemail.com wrote: HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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: sfDoctrinePlugin/sf1.2
In this (my) special case it seems to work - but i did not even touch the most complex doctrine possibilities. In my test environment i installed doctrine 1.1 - by following the guide - from svn. But it seems also possible to define it as an dependency in package.xml to ship it with a plugin - regarding the advice to change the ProjectConfiguration.php I use 3 Tables with relationships and column aggregation inheritance. I do not use any behaviours at this time, so i cannot say anything about that. I use the preSave() trigger to save a directory- or filename and synchronizing existing files in my architectures file system according to the model changes - using getModified(true), this seems to work nicely. I discovered no autoloading issues yet as it is proclaimed in one of the blog's comments. Let's see... i'll play around with it a while. On May 19, 10:59 am, David Ashwood da...@inspiredthinking.co.uk wrote: There was some chatter about a month ago about some issues running Doctrine 1.1 with sf 1.2 (I can't find the topic at the mo and I can remember what the issues were). In the url you posted there should be a link to a trac ticket - which you'll need to checkout for some additional changes you'll need to implement. jw probably has a better idea of the issues than anybody - so he might chip in with some tips if he has the time. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 10:40 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 Hey again, i've found this link: 2 lines to migrate the new doctrine 1.1 version into the sf 1.2 release. Perhaps somebody considers it helpful. http://www.symfony-project.org/blog/2009/01/12/call-the-expert-using-... m-version-of-doctrine So my previous comment seems to be obsolete (as most times^^ ;)). I'll try it out and write a line on how it worked. Thanks :) On May 19, 10:31 am, Johannes Heinen johannes.hei...@googlemail.com wrote: hey:) Sorry for the confusion: I've found out that the doctrine plugin shipped with symfony 1.2 is based on the 1.0 release of doctrine - as you already said it - i had read this small, but important notice recently in the doctrine 1.1 release notes:http://www.doctrine-project.org/blog/doctrine-1-1-released. And you are right: This release does not log the changes made on a Doctrine_Record instance yet :( So my provided solution *will not work* for the current symfony release. Hopefully the new doctrine release will be patched into the sf 1.2 plugin, but as you can read in the doctrine's release notes: it seems even not to be clear if the new version will be shipped with the sf 1.3 final. :( Damn, but I need this stuff ^^ Thanks, Joshi On May 19, 9:53 am, David Ashwood da...@inspiredthinking.co.uk wrote: It exists also in the 1.0 version Doctrine that comes with Symfony 1.2 :) Watch out though - It'll only work with the current record - with Doctrine 1.1 you can also optionally check child records. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 00:17 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 whoho, got it. For the ones who want to know: http://www.doctrine-project.org/documentation/manual/1_1/en/component... ew getModified(true) is the keyword. thanks. On 18 Mai, 18:17, Johannes Heinen johannes.hei...@googlemail.com wrote: HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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: sfDoctrinePlugin/sf1.2
:D ok, i have an idea: it *may* be that it works because i store doctrine 1.1 in ./lib/ventor/doctrine, but there is also the origin sfFilebasePlugin under ./lib/vendor/symfony/plugins/ sfDoctrinePlugin/... So it is probable that the generator uses the old doctrine 1.0 tasks and the runtime the doctrine 1.1 libraries. I prefer to say never change a running system On May 19, 1:49 pm, Johannes Heinen johannes.hei...@googlemail.com wrote: In this (my) special case it seems to work - but i did not even touch the most complex doctrine possibilities. In my test environment i installed doctrine 1.1 - by following the guide - from svn. But it seems also possible to define it as an dependency in package.xml to ship it with a plugin - regarding the advice to change the ProjectConfiguration.php I use 3 Tables with relationships and column aggregation inheritance. I do not use any behaviours at this time, so i cannot say anything about that. I use the preSave() trigger to save a directory- or filename and synchronizing existing files in my architectures file system according to the model changes - using getModified(true), this seems to work nicely. I discovered no autoloading issues yet as it is proclaimed in one of the blog's comments. Let's see... i'll play around with it a while. On May 19, 10:59 am, David Ashwood da...@inspiredthinking.co.uk wrote: There was some chatter about a month ago about some issues running Doctrine 1.1 with sf 1.2 (I can't find the topic at the mo and I can remember what the issues were). In the url you posted there should be a link to a trac ticket - which you'll need to checkout for some additional changes you'll need to implement. jw probably has a better idea of the issues than anybody - so he might chip in with some tips if he has the time. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 10:40 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 Hey again, i've found this link: 2 lines to migrate the new doctrine 1.1 version into the sf 1.2 release. Perhaps somebody considers it helpful. http://www.symfony-project.org/blog/2009/01/12/call-the-expert-using-... m-version-of-doctrine So my previous comment seems to be obsolete (as most times^^ ;)). I'll try it out and write a line on how it worked. Thanks :) On May 19, 10:31 am, Johannes Heinen johannes.hei...@googlemail.com wrote: hey:) Sorry for the confusion: I've found out that the doctrine plugin shipped with symfony 1.2 is based on the 1.0 release of doctrine - as you already said it - i had read this small, but important notice recently in the doctrine 1.1 release notes:http://www.doctrine-project.org/blog/doctrine-1-1-released. And you are right: This release does not log the changes made on a Doctrine_Record instance yet :( So my provided solution *will not work* for the current symfony release. Hopefully the new doctrine release will be patched into the sf 1.2 plugin, but as you can read in the doctrine's release notes: it seems even not to be clear if the new version will be shipped with the sf 1.3 final. :( Damn, but I need this stuff ^^ Thanks, Joshi On May 19, 9:53 am, David Ashwood da...@inspiredthinking.co.uk wrote: It exists also in the 1.0 version Doctrine that comes with Symfony 1.2 :) Watch out though - It'll only work with the current record - with Doctrine 1.1 you can also optionally check child records. -Original Message- From: symfony-users@googlegroups.com [mailto:symfony-us...@googlegroups.com] On Behalf Of Johannes Heinen Sent: 19 May 2009 00:17 To: symfony users Subject: [symfony-users] Re: sfDoctrinePlugin/sf1.2 whoho, got it. For the ones who want to know: http://www.doctrine-project.org/documentation/manual/1_1/en/component... ew getModified(true) is the keyword. thanks. On 18 Mai, 18:17, Johannes Heinen johannes.hei...@googlemail.com wrote: HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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] sfDoctrinePlugin/sf1.2
HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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: sfDoctrinePlugin/sf1.2
whoho, got it. For the ones who want to know: http://www.doctrine-project.org/documentation/manual/1_1/en/component-overview getModified(true) is the keyword. thanks. On 18 Mai, 18:17, Johannes Heinen johannes.hei...@googlemail.com wrote: HI all, is there a way to revert changes made to an doctrine object during a transaction? I user the preSave() Hook to do some stuff and set attributes depending on their original values. I don't see any way to retrieve these original values, i'd only found methods to retrieve information about which columns have changed. Is there a method like (getOriginalValueForField('myField')) ? Thanks, Johannes --~--~-~--~~~---~--~~ 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] sfValidatorXXXUnique
Hi all, actually i'm working on extending the symfony file upload capabilities, both for custom forms and the admin-generator. Scenario is: Upload a file, store pathname and hash in database. That works fine with my validator, should be going with sfValidatorFile also by extending the sfXXXForm::processFiles/saveFile -methods. Ok, but i encountered an issue with the unique validators. These data are passed when you use this validator with a file upload field (in both cases, so when i use sfValidatorFiles it is the same as if i use sfMyValidatorFile) Array ( [id] = 10 [sf_filebase_directories_id] = [pathname] = sfValidatedFile Object ( [originalName:protected] = Firefox_wallpaper.png [tempName:protected] = /tmp/phpmSFZje [savedName:protected] = [type:protected] = image/png [size:protected] = 705084 [path:protected] = /home/joshi/www/test/ web/uploads ) ) You can see, that the field savedName is empty. This seems to result of the fact that the post validators are executed BEFORE sfPropelForm says save the files. Could anybody confirm this behavior, prove it right or wrong (than it's a bug) or give me a hint in how to do it the right way? Note: Ok, i could do it directly in the file validator, checking if the file already exists. But this is not capable, imagine the case you'd a tuple with a filename stored i your database, and man wants to UPDATE this tuple by uploading a new versioned file which though has the same filename as the file before. Thanks in advance and a nice weekend, johannes --~--~-~--~~~---~--~~ 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: Extending sfController
Thanks for your reply. I apologize for answering so late, i am very gratefull of your replies. Unfortunatly i have only litte time at the moment to deal with this ideas due to other committments :( I promise that i'll leave a comment when i had had the time. Thank you for your patience - in advance. With best regards Johannes Heinen On Apr 16, 1:18 pm, Lee Bolding l...@leesbian.net wrote: Cool. OK, let's address some of your points, and through a few ideas around :) 1) OK, that's pretty much what I expected. The way I'd handle these anchor points is with Symfony events. Create a set of events within your application, and allow plugins to listen to these events. Maybe a plugin controller would listen to these events... I'm thinking something along the lines of how Symfony's filterChain works - but this is just my first thought without much investigation. Events are cool though - I've even started firing events when specific KPI criteria for my apps are met, so that we can easily measure if the app is meeting all of its business goals :) 2) You can remove a lot of headaches by judicious use of the final keyword and appropriate private and public methods in your controllers. Expose an interface that all 3rd party modules must implement. If you do that, PHP can take care of a lot of those headaches for you. This combined with the events I mentioned before should be quite a powerful combination. I mentioned my sfErrorHandlerPlugin earlier today - one of the great features of it is that it wraps all other filters (including sfExecutionFilter), so any uncaught exceptions are caught by the plugin - if you use that (or at least that portion of code) to wrap your plugin handler, it will insulate you from 3rd party plugins causing catastrophic errors :) As for the rest of it - I think this can all be achieved with listeners, and restricting 3rd parties to a specific interface(s). I'd always take the approach of forcing 3rd parties to follow a convention - it means that when you make changes to the application as a whole, you've got a defined contract between plugins and applications that you need to maintain, you don't need to worry about people having code dependent upon YOUR code - just your interfaces (hell, that's the whole point of interfaces!). Hopefully, that's give you some ideas - I'd be interested to hear other peoples ideas, because as I said before, I need to think about implementing this on a few projects soon :) On 16 Apr 2009, at 11:10,JohannesHeinen wrote: Thats it^^, for sure. Thanks for your patience :) Ok, infos... lets see. 1.) When i speak of modules i mean a 3rd-party code snippet which integrate into the 1st class app and can fulfill additional tasks (much as a plugin which plugs into a predefined anchor-point). My modules have nothing to do with symfony modules as instances of an action controller (Ok, but i would be pleased if my modules would encapsulate similar funcionality as an symfony action controller, as explained before) 2.) Third party authors are responsible for non breaking the main application, so i am of the opinion that wie can neglect questions of security. Because the 3rd party vendor is responsible for that by himself - if a module is vulnerable, so the main app will be - no sandboxing in any way, that is no prerequisite for me. Merly a bonus in a very, very last step, but i would break it down to basic error-handling, so an exception in 3rd party code won't break the output - a fatal error will do so anyway - compile-at-runtime- disadvantage. I would simply pass a reference to the sfContext-Instance to provide full app-access, as this is anyway accessible by its factorymethod at any point in my symfony-app i see no way to encapsulate 3rd party modules in a very special mannor - if you want to break the app, you are able to do so. So lets imagine a 3rd party vendor module blog, which implements a few models (news, user-comments), both depend on other models (users,...) and must be notified on change. These dependancies may rely in the core, or in other 3rd party modules. I would simply write a 3rd party vendor module api for myself and pass a sfContext-Instance into it, as written before. Or, that is what i fell in love with^^ i use predefined symfony-code to enrich my modules so that they have the same look and feel like a symfony action controller. That would have the advantage that a symfony dev-superhero feels familiar with it and could easyliy devolpe modules without lerning a new api. Thanks again for your interrest, greetings Johannes On Apr 14, 8:33 pm, Lee Bolding l...@leesbian.net wrote: I think I get what you want to do - create a sandbox for 3rd party modules, where they can't interfere with the 1st party application. Does that sound about right
[symfony-users] Re: Extending sfController
Thats it^^, for sure. Thanks for your patience :) Ok, infos... lets see. 1.) When i speak of modules i mean a 3rd-party code snippet which integrate into the 1st class app and can fulfill additional tasks (much as a plugin which plugs into a predefined anchor-point). My modules have nothing to do with symfony modules as instances of an action controller (Ok, but i would be pleased if my modules would encapsulate similar funcionality as an symfony action controller, as explained before) 2.) Third party authors are responsible for non breaking the main application, so i am of the opinion that wie can neglect questions of security. Because the 3rd party vendor is responsible for that by himself - if a module is vulnerable, so the main app will be - no sandboxing in any way, that is no prerequisite for me. Merly a bonus in a very, very last step, but i would break it down to basic error-handling, so an exception in 3rd party code won't break the output - a fatal error will do so anyway - compile-at-runtime- disadvantage. I would simply pass a reference to the sfContext-Instance to provide full app-access, as this is anyway accessible by its factorymethod at any point in my symfony-app i see no way to encapsulate 3rd party modules in a very special mannor - if you want to break the app, you are able to do so. So lets imagine a 3rd party vendor module blog, which implements a few models (news, user-comments), both depend on other models (users,...) and must be notified on change. These dependancies may rely in the core, or in other 3rd party modules. I would simply write a 3rd party vendor module api for myself and pass a sfContext-Instance into it, as written before. Or, that is what i fell in love with^^ i use predefined symfony-code to enrich my modules so that they have the same look and feel like a symfony action controller. That would have the advantage that a symfony dev-superhero feels familiar with it and could easyliy devolpe modules without lerning a new api. Thanks again for your interrest, greetings Johannes On Apr 14, 8:33 pm, Lee Bolding l...@leesbian.net wrote: I think I get what you want to do - create a sandbox for 3rd party modules, where they can't interfere with the 1st party application. Does that sound about right? I've got several projects in various states, that at some point are going to need that functionality - I just haven't reached that stage in the development yet, so haven't really thought about it much. Assuming that's what we're talking about, I've got a few ideas about how it could be implemented - but implementation details depend largely upon exactly what you want to allow 3rd party plugins to do (or maybe that should be, what you DON'T want to allow them to do) If I understand correctly, let me know and I'll throw some ideas your way :) On 14 Apr 2009, at 18:29, Johannes Heinen wrote: I see... unfortunately it seems to be hard to decouple the mvc-classes from these convention over configuration principles, though the code itself is fairly simple and small (but contains many hard coded pathnames to e.g. to views etc... perhaps i have to follow your advice. To be more specific to that what i really want to archive (;)): I only want to use the symfony advantages in my modules: view helpers, passed request/response stream representations, Environment/ Context Objects and so on. I imagine a sfAction-class style entry point for each module, that is enhanced with custom events to handle relationships between modules. These module-classes i want to be loaded and controlled by a module-manager, which i simply want to build as an implementation of sfController. Perhaps one has another advice for me, if not - thanks anyway, this is a very special question and i surely will have to put some work into it ;). Best regards Johannes On Apr 14, 7:39 am, Gareth McCumskey gmccums...@gmail.com wrote: Perhaps consider creating your collection of CMS modules as apparent modules instead of being defined as symfony modules, that way you can use symfony to manage the interactions of these CMS modules without having to worry about overwriting the sfController class or any other symfony classes. Of course if you feel this is a bad idea instead of looking for the documentation you mentioned, of which I am sure there are none, try looking into the symfony code yourself to see how it is implemented. On Mon, Apr 13, 2009 at 11:45 PM, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi all, i am searching for a kind of best practice in extending sfController. The masterplan is to develop a module system in which an end user can implement a mvc-driven module class inside of a symfony app. In this app (e.g. a content managemen system), you are able to manage modules (enable, disable, install, uninstall). A module is mainly a wrapper around the mvc
[symfony-users] Re: Extending sfController
I see... unfortunately it seems to be hard to decouple the mvc-classes from these convention over configuration principles, though the code itself is fairly simple and small (but contains many hard coded pathnames to e.g. to views etc... perhaps i have to follow your advice. To be more specific to that what i really want to archive (;)): I only want to use the symfony advantages in my modules: view helpers, passed request/response stream representations, Environment/ Context Objects and so on. I imagine a sfAction-class style entry point for each module, that is enhanced with custom events to handle relationships between modules. These module-classes i want to be loaded and controlled by a module-manager, which i simply want to build as an implementation of sfController. Perhaps one has another advice for me, if not - thanks anyway, this is a very special question and i surely will have to put some work into it ;). Best regards Johannes On Apr 14, 7:39 am, Gareth McCumskey gmccums...@gmail.com wrote: Perhaps consider creating your collection of CMS modules as apparent modules instead of being defined as symfony modules, that way you can use symfony to manage the interactions of these CMS modules without having to worry about overwriting the sfController class or any other symfony classes. Of course if you feel this is a bad idea instead of looking for the documentation you mentioned, of which I am sure there are none, try looking into the symfony code yourself to see how it is implemented. On Mon, Apr 13, 2009 at 11:45 PM, Johannes Heinen johannes.hei...@googlemail.com wrote: Hi all, i am searching for a kind of best practice in extending sfController. The masterplan is to develop a module system in which an end user can implement a mvc-driven module class inside of a symfony app. In this app (e.g. a content managemen system), you are able to manage modules (enable, disable, install, uninstall). A module is mainly a wrapper around the mvc-class which manages dependancies per subject/observer pattern following kiss. Concrete: The developer creates a folder, there is a config.yml stored. In this .yml-file will be defined: module name, dependancies and events to which the module is listening, the main module file and main- classname (the controller-class). The module manager is in charge to find the required files, to check dependancies and to instanciate the main-controller. Now - i dont want to write a mvc-interface by myself, because symfony provides one by default. So the question is, how to implement a sfController childclass which is so to say not a web- controller, but merely a module-controller with own templates, components, slots and so on... Perhaps my problem is superficial, but i didnt find any deeper docs about using these symfony core components in a more loose coupled way, thus the mvc-structure is more indendet to be used in a strict request/response-based way/manner). Got the point? ^^ If not: sorry for my bad english, and even more annoying that i can't speak any word in french ;( Greetings and many, many easter eggs Johannes Heinen -- 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] Extending sfController
Hi all, i am searching for a kind of best practice in extending sfController. The masterplan is to develop a module system in which an end user can implement a mvc-driven module class inside of a symfony app. In this app (e.g. a content managemen system), you are able to manage modules (enable, disable, install, uninstall). A module is mainly a wrapper around the mvc-class which manages dependancies per subject/observer pattern following kiss. Concrete: The developer creates a folder, there is a config.yml stored. In this .yml-file will be defined: module name, dependancies and events to which the module is listening, the main module file and main- classname (the controller-class). The module manager is in charge to find the required files, to check dependancies and to instanciate the main-controller. Now - i dont want to write a mvc-interface by myself, because symfony provides one by default. So the question is, how to implement a sfController childclass which is so to say not a web- controller, but merely a module-controller with own templates, components, slots and so on... Perhaps my problem is superficial, but i didnt find any deeper docs about using these symfony core components in a more loose coupled way, thus the mvc-structure is more indendet to be used in a strict request/response-based way/manner). Got the point? ^^ If not: sorry for my bad english, and even more annoying that i can't speak any word in french ;( Greetings and many, many easter eggs Johannes Heinen --~--~-~--~~~---~--~~ 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] [sfValdatorDoctrineUnique]
Hi all, im relatively new to symfony, so i say sorry in advance if my question is not appropriate. I wonder if the related UniqueValidator should be refactored partly to allow explicit mapping of form fields to database-attributes. It drove me crazy to determine which column names to pass - curiously the attribute-name magic of doctrine clashed somhow with the names i used in my sfForm childclass. Aware of the design principle convention over configuration - some conventions seems to be annoying during the process of developing custom code - for example: I love the symfony CRUD generator for prototyping, but i am also into the developement of custom forms (uh... in love is perhaps a strong wording ;)), enriched with ajax- driven widgets generated by javascript-frameworks, e.g. dojo etc... Such form classes implement much more app-logic than originally intendet; so they have to rememer states (perhaps a root_id of a tree), generate messages, engage event-triggers for client etc... Regardless of the compexity of my forms - and aware of arguments that my way seems probably not the correct mvc way (i promise, it is!! (*cough*)) - i want to use as much features out of the form framework - so also the unique validator. But under that aspect it would be nice to customize the way the unique validator works as much as possible - e.g. to chose the names of my form fields thas has to be checked against the unique constrait by myself - simply because i want to use my own form-name-namespace regardless of the database attribute names. I know my question is somewhat irrelevant for you as symfony-users but merly for developers - but perhaps you got a good idea if and where am wrong in my criticism of the original sf-code and what is the correct way to use the database-unique-validators without screaming about naming conventions: So, what do you think? Thanks and greetings :) --~--~-~--~~~---~--~~ 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: Recommended distibution for Symfony
I have ben using Gentoo for 2 years now super stable and always up to date with its php versions. Granted it may be a bit difficult as a distribution if you are use to ubuntu, but I guess thats the price of being able to customize. If you need a easy start with gentoo try out Sabayon which is based on gentoo. Don't have experience with Sabayon as a server but I would suspect it's comparable to gentoo. On 12/02/2009, at 19.17, krassswr krawr wrote: Yes slow between releases, but stable for servers. That is the point stable software for servers. You can use testing and unstable for Desktop, but for servers I prefer stable version. On Thu, Feb 12, 2009 at 8:01 PM, Paolo Mainardi paolomaina...@gmail.com wrote: On Thu, Feb 12, 2009 at 6:51 PM, Eno symb...@gmail.com wrote: On Thu, 12 Feb 2009, krassswr krawr wrote: Yuo can use Debian GNU/Linux system stable version for production. Sonn is expected to be released new stable Debian version. http://www.debian.org Debian is equally slow between releases! Are incomparable CentOs and Debian, 2 different planet :) I hate the Redhat policies for packages and their repository don't have anything. Debian is slow, but you can progress with testing revision, until the next stable. -- Paolo Mainardi Vice Presidente Assoc.ILDN (http://www.ildn.net) Blog: http://www.paolomainardi.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] Doctrine admin generator edit resets fields that are not displayed
I have this generator config: generator: class: sfDoctrineGenerator param: model_class: Products theme: admin non_verbose_templates: true with_show: false singular: ~ plural:~ route_prefix: products with_doctrine_route: 1 config: actions: ~ fields: ~ list: title: Produkt oversigt display:[ean, name, ordered, delivered, state_as_text, position_as_text, location, newpic ] sort: [ean, name] max_per_page: 10 actions:{} batch_actions: {} object_actions: _edit: ~ filter: display: [ean, name, state, position] form: display:[ state, position, location, newpic ] #WHEN I ADD THIS LINE THE FIELDS THAT ARE NOT DISPLAYED ARE SAVED EMPTY edit:~ new: ~ Everything works fine except when I want to limit the fields to update. Anybody seen this problem before or know what to do about it? Joe --~--~-~--~~~---~--~~ 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: [SOLVED] Doctrine admin generator edit resets fields that are not displayed
Hi Bernhard I could hug you... everything works perfect now. Joe On 11/02/2009, at 10.46, Bernhard Schussek wrote: Hi Joe, Did you unset the other columns in the ProductsForm? Your ProductsForm::configure() method should look something like: public function configure() { unset($this['ordered']); unset($this['delivered']); unset($this['location']); unset($this['newpic']); } Bernhard --~--~-~--~~~---~--~~ 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] Problem with doctrine admin generator in 1.2.4
I have recently upgraded to 1.2.4 and so far everything has worked quite well. When I tried generate a admin module I ran in to a strange problem though. Having this doctrine schema: Products: columns: id: primary: true autoincrement: true type: integer ean: type: string name: type: string state: type: integer default : 1 notnull: true position: type: integer default : 1 notnull: true location: type: string default : ordered: type: date delivered: type: date contact: type: string email: type: string email: true newpic: type: boolean default : true relations: State: class: States local: state foreign: id Position: class: Positions local: position foreign: id States: columns: id: primary: true type: integer unique: true state: type: string Positions: columns: id: primary: true type: integer unique: true position: type: string and this fixture: Positions: 1: id: 1 position: Mangler 2: id: 2 position: Hos fotograf 3: id: 3 position: På lager States: state1: id: 1 state: Mangler state2: id: 2 state: Bestilt state3: id: 3 state: På lager state4: id: 4 state: Rekvirer Products: product1: id: 1 ean: 123456789012 name: test product 1 state: 1 position: 1 location: ordered: '2008-12-08' delivered: '2008-12-09' contact: somebody email: sob...@somewhere.dk newpic: false I tried to generate the admin with this command: symfony doctrine:generate-admin frontend Products but when I try to view the index of the module I get this error: 500 | Internal Server Error | Doctrine_Connection_Sqlite_Exception SQLSTATE[HY000]: General error: 1 near p: syntax error stack trace * at () in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/ doctrine/Doctrine/Connection.php line 1076 ... 1073. 1074. $name = 'Doctrine_Connection_' . $this- driverName . '_Exception'; 1075. 1076. $exc = new $name($e-getMessage(), (int) $e-getCode()); 1077. if ( ! isset($e-errorInfo) || ! is_array($e-errorInfo)) { 1078. $e-errorInfo = array(null, null, null, null); 1079. } * at Doctrine_Connection- rethrowException(object('PDOException'), object('Doctrine_Connection_Sqlite')) in SF_SYMFONY_LIB_DIR/plugins/sfDoctrinePlugin/lib/vendor/ doctrine/Doctrine/Connection.php line 1024 ... If I generate without the fixture it works until I try to add a entry. if I run: symfony doctrine:generate-admin frontend States the admin works fine. I have added these modification to the product model: class ProductsFormFilter extends BaseProductsFormFilter { public function configure() { $this-widgetSchema['ean'] = new sfWidgetFormFilterInput(array('with_empty' = false)); $this-widgetSchema['name'] = new sfWidgetFormFilterInput(array('with_empty' = false)); $this-widgetSchema['location'] = new sfWidgetFormFilterInput(array('with_empty' = false)); } } class ProductsForm extends BaseProductsForm { public function configure() { $this-widgetSchema['location'] = new sfWidgetFormInput(); unset($this['ordered']); unset($this['delivered']); unset($this['contact']); unset($this['email']); unset($this['name']); unset($this['ean']); } } class Products extends BaseProducts { public function getStateAsText(){ return $this-getState(); } public function getPositionAsText(){ return $this-getPosition(); } public function postUpdate($event) { if($this-getState() == På lager $this-getNewpic() == true){ $this-setDelivered(date('Y-m-d',time())); $this-save(); } } } Hope somebody has a clue... Joe --~--~-~--~~~---~--~~ 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 on shared host
I have already done that still no dice. any other suggestions? Joe On 04/01/2009, at 23.58, Lee Bolding wrote: cache and log need to be 777 *recursively* chmod -R 777 cache chmod -R 777 log That should fix it :) On 4 Jan 2009, at 19:02, Johannes Frandsen wrote: I get this error when I try to run my symfony project on a shared host: Fatal error: Uncaught exception 'sfCacheException' with message 'Failed to make cache directory /var/www/html/greenoak.dk/cache/ frontend/dev/config while generating cache for configuration file config/config_handlers.yml.' in /var/www/html/greenoak.dk/lib/ symfony/config/sfConfigCache.class.php:337 Stack trace: #0 /var/www/ html/greenoak.dk/lib/symfony/config/sfConfigCache.class.php(107): sfConfigCache-writeCacheFile('config/config_h...', '/var/www/html/ g...', '?php?// auto-g...') #1 /var/www/html/greenoak.dk/lib/ symfony/ config/sfConfigCache.class.php(194): sfConfigCache- callHandler('config/config_h...', Array, '/var/www/html/g...') #2 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(276): sfConfigCache-checkConfig('config/ config_h...') #3 /var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(54): sfConfigCache-loadConfigHandlers() #4 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(194): sfConfigCache-callHandler('config/ settings...', Array, '/var/www/html/g. in /var/www/html/greenoak.dk/ lib/symfony/config/sfConfigCache.class.php on line 337 Safemode is on but I have copied all the files from the pear installation (so my installation resemble what a symfony freeze would do ), so to the best of my knowledge this should not be the problem. Both cache and log have 777 file permission When I look i the cache folder I can see that some of the folder structure is created but no files Any help appreciated... Im running php 5.2.6 on the shared host Joe --~--~-~--~~~---~--~~ 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 on shared host
Im running 1.1.6 in my dev environment and my build script just copies the files from my pear installation in to the data, lib and web folder and changes the projectconfiguration file to point to the lib folder before uploading to the production server via ftp. I do not have access to the shell on the production server , so I can only flush the cache by manually deleting the content of the cache folder. As far as I have understood the autoload is generated if the cache is empty, but my problem is the no files are generated only the folder structure under cache. Any other ideas? Joe On 05/01/2009, at 04.14, José Leonardo Diaz Ordoñez wrote: I have an error like that in my local server, it was an autoload problem in my case I had two version of the symfony framework in my lib/vendor folder (1.2 and 1.2.2Dev) If you have access to the console try to execute symfony cc or symfony YOUR_ORM:build-all It gave me some real strange errors, if any error appear again publish so I can tell if is the same it gave me. 2009/1/4 Lee Bolding l...@leesbian.net cache and log need to be 777 *recursively* chmod -R 777 cache chmod -R 777 log That should fix it :) On 4 Jan 2009, at 19:02, Johannes Frandsen wrote: I get this error when I try to run my symfony project on a shared host: Fatal error: Uncaught exception 'sfCacheException' with message 'Failed to make cache directory /var/www/html/greenoak.dk/cache/ frontend/dev/config while generating cache for configuration file config/config_handlers.yml.' in /var/www/html/greenoak.dk/lib/ symfony/config/sfConfigCache.class.php:337 Stack trace: #0 /var/www/ html/greenoak.dk/lib/symfony/config/sfConfigCache.class.php(107): sfConfigCache-writeCacheFile('config/config_h...', '/var/www/html/ g...', '?php?// auto-g...') #1 /var/www/html/greenoak.dk/lib/ symfony/ config/sfConfigCache.class.php(194): sfConfigCache- callHandler('config/config_h...', Array, '/var/www/html/g...') #2 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(276): sfConfigCache-checkConfig('config/ config_h...') #3 /var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(54): sfConfigCache-loadConfigHandlers() #4 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(194): sfConfigCache-callHandler('config/ settings...', Array, '/var/www/html/g. in /var/www/html/greenoak.dk/ lib/symfony/config/sfConfigCache.class.php on line 337 Safemode is on but I have copied all the files from the pear installation (so my installation resemble what a symfony freeze would do ), so to the best of my knowledge this should not be the problem. Both cache and log have 777 file permission When I look i the cache folder I can see that some of the folder structure is created but no files Any help appreciated... Im running php 5.2.6 on the shared host Joe -- José Leonardo Diaz Ordoñez Ingeniero en Electrónica y Telecomunicaciones Énfasis en Ingeniería Telemática. Universidad del Cauca, Popayán -Colombia 2007 --~--~-~--~~~---~--~~ 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 on shared host
The funny thing is. that if the following lines is added to the vhost file: php_admin_flag safe_mode off php_admin_value open_basedir / php_admin_flag allow_url_fopen On The page works. But, somewhat understandingly, I will not be allowed to have these settings enabled. On 05/01/2009, at 13.30, Fabian Lange wrote: Hi, Although you'll be able to deploy, you won't be able to build your database from the command line, or clear your cache. You can clear the cache, just delete the cache directory using an FTP tool However you should have all the DB setup deployed from your dev machine as you can't run propel commands. Having said that, I hope more people switch to (managed) VPS where CLI is available. Fabian --~--~-~--~~~---~--~~ 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 on shared host
I have tried to freeze my project several times with different versions of symfony but I have never gotten it to work. It always ends of with the script crashing... if i run it with my current version (1.1.6) it crashes with this error: symfony project:freeze /usr/share/php ... ... ... Warning: rename(/var/www/www.site.dev/htdocs/src/data/symfony/web/sf,/var/www/www.site.dev/htdocs/src/demo/sf) : No such file or directory in /usr/share/php/symfony/task/ sfFilesystem.class.php on line 189 Call Stack: 0.0003 61944 1. {main}() /usr/bin/symfony:0 0.0005 72860 2. include('/usr/share/php/symfony/command/ cli.php') /usr/bin/symfony:37 0.05553022360 3. sfSymfonyCommandApplication-run() /usr/ share/php/symfony/command/cli.php:20 0.06013203696 4. sfTask-runFromCLI() /usr/share/php/ symfony/command/sfSymfonyCommandApplication.class.php:72 0.06023203696 5. sfBaseTask-doRun() /usr/share/php/symfony/ task/sfTask.class.php:75 0.06103225748 6. sfProjectFreezeTask-execute() /usr/share/ php/symfony/task/sfBaseTask.class.php:77 21.65093319448 7. sfFilesystem-rename() /usr/share/php/ symfony/task/project/sfProjectFreezeTask.class.php:89 21.65143319448 8. rename() /usr/share/php/symfony/task/ sfFilesystem.class.php:189 Dump $_SERVER Dump $_GET Dump $_POST Dump $_COOKIE Dump $_FILES Dump $_ENV Dump $_SESSION Dump $_REQUEST somewhat expectable unfreeze crashes as well symfony project:unfreeze ... ... ... Warning: unlink(/var/www/www.site.dev/htdocs/src/demo/sf): No such file or directory in /usr/share/php/symfony/task/ sfFilesystem.class.php on line 143 Call Stack: 0.0003 61808 1. {main}() /usr/bin/symfony:0 0.0005 72724 2. include('/usr/share/php/symfony/command/ cli.php') /usr/bin/symfony:37 0.05443022072 3. sfSymfonyCommandApplication-run() /usr/ share/php/symfony/command/cli.php:20 0.05923202928 4. sfTask-runFromCLI() /usr/share/php/ symfony/command/sfSymfonyCommandApplication.class.php:72 0.05923202928 5. sfBaseTask-doRun() /usr/share/php/symfony/ task/sfTask.class.php:75 0.06003225116 6. sfProjectUnfreezeTask-execute() /usr/ share/php/symfony/task/sfBaseTask.class.php:77 4.06843318816 7. sfFilesystem-remove() /usr/share/php/ symfony/task/project/sfProjectUnfreezeTask.class.php:71 4.06873319020 8. unlink() /usr/share/php/symfony/task/ sfFilesystem.class.php:143 Dump $_SERVER Dump $_GET Dump $_POST Dump $_COOKIE Dump $_FILES Dump $_ENV Dump $_SESSION Dump $_REQUEST So I wrote ant ant script to do what freeze dos when I publich my site. which leads us back yo my initial problem. Why can't I get my symfony site to run on a shared host with safemode enable when I use local files and not pear files. On 05/01/2009, at 21.17, Lee Bolding wrote: You can freeze your project then upload it. The problem is that you can't build your database from your models, or insert your fixtures without the cli. On 5 Jan 2009, at 20:15, Brandon Olivares wrote: Hi, How could you have dev on shared hosting without shell? It's not possible. I don't even know how you could set up symfony on your domain without shell. Usually you either have to create a symbolic link to web from the document root, or else modify the vhost to change the document root. You can't do either of those on a shared host without shell. Brandon -Original Message- From: symfony-users@googlegroups.com [mailto:symfony- us...@googlegroups.com] On Behalf Of Ward Loockx Sent: Monday, January 05, 2009 3:02 PM To: symfony-users@googlegroups.com Subject: [symfony-users] Re: Symfony on shared host Isn't there any way to build-propel when having prod/dev env. on same shared hosting ? Eno schreef: On Jan 5, 1:24 pm, Ward Loockx w...@loockx.be mailto:w...@loockx.be wrote: I think it must be possible to build:propel on shared hosting the cmd line tool just calls a script I think? And isn't it possible to execute something over ftp ?? Just guessing but in theory I think it's possible... Actually, you can build-propel and freeze on your dev machine before uploading to your servers - works fine for 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] Symfony on shared host
I get this error when I try to run my symfony project on a shared host: Fatal error: Uncaught exception 'sfCacheException' with message 'Failed to make cache directory /var/www/html/greenoak.dk/cache/ frontend/dev/config while generating cache for configuration file config/config_handlers.yml.' in /var/www/html/greenoak.dk/lib/ symfony/config/sfConfigCache.class.php:337 Stack trace: #0 /var/www/ html/greenoak.dk/lib/symfony/config/sfConfigCache.class.php(107): sfConfigCache-writeCacheFile('config/config_h...', '/var/www/html/ g...', '?php?// auto-g...') #1 /var/www/html/greenoak.dk/lib/symfony/ config/sfConfigCache.class.php(194): sfConfigCache- callHandler('config/config_h...', Array, '/var/www/html/g...') #2 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(276): sfConfigCache-checkConfig('config/ config_h...') #3 /var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(54): sfConfigCache-loadConfigHandlers() #4 / var/www/html/greenoak.dk/lib/symfony/config/ sfConfigCache.class.php(194): sfConfigCache-callHandler('config/ settings...', Array, '/var/www/html/g. in /var/www/html/greenoak.dk/ lib/symfony/config/sfConfigCache.class.php on line 337 Safemode is on but I have copied all the files from the pear installation (so my installation resemble what a symfony freeze would do ), so to the best of my knowledge this should not be the problem. Both cache and log have 777 file permission When I look i the cache folder I can see that some of the folder structure is created but no files Any help appreciated... Im running php 5.2.6 on the shared host Joe --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---