symfony1

Processing large data sets via AJAX brings no speed benefits

牧云@^-^@ 提交于 2019-12-04 17:49:21
I have several time consuming database queries to run. Each has been built to be triggered from an option chosen on a web page. I thought I was being quite cunning by firing off the work via several AJAX requests . I presumed that multiple requests would be split over multiple processes/threads meaning the work would be completed relatively quickly for the user. However, the requests seem to be processed in serial , meaning that no speed benefit is felt by the user. Worse still, AJAX requests to update the page also wait in line, meaning they fail to respond until the previous requests have

Is it possible to get a value from view.yml in an action

橙三吉。 提交于 2019-12-04 17:10:54
I'm wondering if it's possible to get the name of a stylesheet from view.yml in an action, ideally using something as simple as: sfConfig::get('......'); I'd like to access the existing declaration in view.yml instead of hardcoding it or duplicating it somewhere like app.yml. Thanks. If you want to access the current Module's Config, you can use: sfViewConfigHandler::getConfiguration(array(dirname(__DIR__) . '/config/view.yml')); It should return something like this: Array ( [indexSuccess] => Array ( [javascripts] => Array ( [0] => mission-control.js ) [stylesheets] => Array ( [0] => control

Migrating Existing Users and Passwords to new Symfony/sfDoctrineGuard User System

落花浮王杯 提交于 2019-12-04 16:21:00
I have an existing, non-framework-based PHP/MySQL website. It has a simple security model, with a users table with usernames and hashed (MD5) passwords. I'm currently working on "version 2" of this site, this time using Symfony, with Doctrine. The new version is working fine, and I'm using the sfDoctrineGuard plugin for my user management. I'd like to migrate my existing users into the new app with the minimum of fuss, retaining their existing usernames and passwords. My main problem, though, is that I'd like to change the password hash I'm using. The current site uses unsalted MD5 hashes of

sfErrorNotifierPlugin: The “default” context does not exist

▼魔方 西西 提交于 2019-12-04 16:05:33
I have installed the sfErrorNotifierPlugin . When both options reportErrors/reportPHPErrors reportPHPWarnings/reportWarnings are set to false, everything is ok. But I want to catch PHP exceptions and warnings to receive E-mails, but then all my tasks fail, including clear-cache. After few hours of tests I'm 100% sure that the problem is with set_exception_handler/set_error_handler. There's a similar question: sfErrorNotifierPlugin on symfony task but the author there is having problems with a custom task. In my case, even built-in tasks fail. I haven't used sfErrorNotifierPlugin, but I have

How to debug symfony in Netbeans? I cannot call specific pages

家住魔仙堡 提交于 2019-12-04 15:57:38
I've already read posts like Passing PHP arguments into NetBeans into a page that features symfony url-routing but I cannot make things work. I would like to run the following page: http://localhost/s/web/frontend_dev.php/travel So I tried first the "Local Website Configuration" with Netbeans 6.9.1. As stated in the linked thread there is an issue here since I can point to the project url and to the "web/frontend_dev.php" index file but I am not able to have "/travel" as an argument since Netbeans always prefixes it with ? for parameter passing which I don't want. I the mentioned thread the

Doctrine_Core::getTable()->findAll() how to specify order?

泄露秘密 提交于 2019-12-04 15:37:24
问题 When using a Doctrine_Table object, is it possible to specify the order of the returned collection when using findAll() or findByWhatever() ? In the doc's I see some stuff about getOrderByStatement() and processOrderBy() but it isn't clear on how to use them... 回答1: You can also leave the first array blank $em->getRepository('BackendDestinyBundle:Destiny')->findBy(array(), array('title'=>'asc')); 回答2: You can in fact specify a default order by in your schema: Foo: columns: ... options:

Copy a Doctrine object with all relations

一笑奈何 提交于 2019-12-04 13:32:07
I want to copy a record with all his relations. I'm trying with: $o = Doctrine::getTable('Table')->Find(x); $copy = $object->copy(); $relations = $o->getRelations(); foreach ($relations as $name => $relation) { $copy->$relation = $object->$relation->copy(); } $copy->save(); This code doesn't works, but I think it's on the way. I never could get the deep copy function to operate correctly. I manually coded a deep copy function for one of my models like this public function copyAndSave () { $filters = array('id', 'created'); $survey = $this->copy(); $survey->Survey_Entries = new Doctrine

Rebuild model without loss data in MySQL for Symfony

倖福魔咒の 提交于 2019-12-04 13:10:19
What is the best way to rebuild a model without loss data in MySQL for Symfony? What if I have a big site, and a lot of data in the database and I would like after six months to add few new fields to database? denys281 You can use migration. Doctine manual Symfony task for migrations Slideshare presentation Slideshare presentation So you need write migrations, migrate, and build your models, forms, etc. I suggest you use @denys281 for Symfony1.4 ....in Symfony2 however its VERY simple ... just use the command : php app/console doctrine:schema:update --force It compares what your database

Performing Join with Multiple Criteria in Propel 1.5

主宰稳场 提交于 2019-12-04 12:21:49
This question follows on from the questions here and here . I have recently upgraded to Propel 1.5, and have started using it's Query features over Criteria. I have a query I cannot translate, however - a left join with multiple criteria: SELECT * FROM person LEFT JOIN group_membership ON person.id = group_membership.person_id AND group_id = 1 WHERE group_membership.person_id is null; Its aim is to find all people not in the specified group. Previously I was using the following code to accomplish this: $criteria->addJoin(array( self::ID, GroupMembershipPeer::GROUP_ID, ), array(

Configure symfony project for Multiple Domains

让人想犯罪 __ 提交于 2019-12-04 12:06:30
问题 We have a product developed in PHP Symfony framework. We have couple of clients right now for whom we are maintaining different code base and databases (MySql). They access their respective code base using subdomain like client1.myproduct.com and client2.myproduct.com Now we want to make a single code base for both the clients and only keep files which are different (in terms of logic) for both of them in separate subdomains. So both the subdomains will point to the same code base but will