symfony1

mysql inserting records twice in database

喜欢而已 提交于 2020-01-14 04:52:28
问题 I have the simple code shown below. After it has run once, it inserts the results into MySQL database twice. It is working fine in all browsers (IE, Chrome, and Safari) except Firefox. I am using symfony php framework and propel as the ORM. $con = Propel::getConnection(); $sql = "select * from tmp where user_id =$userid"; $stmt = $con->prepare($sql); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $insert_sql = "INSERT IGNORE into library(xxx,xxx) VALUES('xyz','xys')";

sfErrorNotifierPlugin on symfony task

你。 提交于 2020-01-14 04:03:08
问题 My application runs huge batch processing inside a Symfony task, and I want to be notified about all PHP errors and uncaught exceptions. So I tried sfErrorNotifierPlugin, and it works great in a web context (accessing the application from the browser); the problem is that I can't make it work on my symfony tasks. Is there any way to make it work in tasks? 回答1: sfTask has no exception handling like the web interface does, but you can work around it: ultimately exceptions thrown are passed to

Django-like framework on Ruby?

喜你入骨 提交于 2020-01-13 11:06:52
问题 Django as a framework is a neat little package. There are very few files (compared to Rails) and it's got a clean structure. The fact that you can plug and unplug apps between different projects is an extremely nifty feature. At the same time, Ruby's hacking ability is unparalleled. It's complete object-orientedness makes it more expressive and fun. To cut the story short, is there a Django-like or Django inspired framework on Ruby? If not, would be possible for an implementation of Django on

Symfony as a helper for Wordpress plugin development

依然范特西╮ 提交于 2020-01-12 22:55:06
问题 I have seen several integrations between wordpress and symfony, but they are made with the goal of managins static pages content inside wordpress and symfony acting as the controller. Wordpress plugin development api seems really basic and primitive and you have no way o code with the MVC pattern out of the box. So the big question is, what would be an starting point to create plugins in wordpress, and create admin sections in it, but using Symfony power to manage database access, form

Symfony as a helper for Wordpress plugin development

若如初见. 提交于 2020-01-12 22:54:12
问题 I have seen several integrations between wordpress and symfony, but they are made with the goal of managins static pages content inside wordpress and symfony acting as the controller. Wordpress plugin development api seems really basic and primitive and you have no way o code with the MVC pattern out of the box. So the big question is, what would be an starting point to create plugins in wordpress, and create admin sections in it, but using Symfony power to manage database access, form

500 internal server Symfony on production, possibly due to PHPsuexec

痴心易碎 提交于 2020-01-11 11:57:12
问题 Running into a 500 internal server error on my subdomain installation of Symfony when I attempt to visit any modules. The server does have PHPsuexec installed on it. Does anybody know whats up? Otherwise it states that the symfony project is installed and it runs fine on my server. One glitch could be that on my server the directories have permissions 777 and all files have 666 permissions. However, courtesy of PHPsuexec, most my directories seem to have 775 and the files a 664 permission

How to catch an id from sfUser?

六月ゝ 毕业季﹏ 提交于 2020-01-11 10:48:07
问题 I'm working with symfony 1.4 & i use sfDoctrineGuardPlugin as a tool for authentifications. I want to catch the Id of user in order te store it in my table. After a small research, I guess I have to use that expression : getUser()->getGuardUser()->getId() . What i looking for is how to invest that expression for my target. 回答1: if the user is authenticated, yes, you can use: // inside an action $id = $this->getUser()->getGuardUser()->getId(); // inside a template $id = $sf_user->getGuardUser(

Format date in the indexSuccess.php

点点圈 提交于 2020-01-11 10:04:46
问题 I want to format the created_at field date from the original for something like 03.May.2011 to be shown in the indexSuccess.php and in the showSuccess.php Could you help me? thanks 回答1: You can make in symfony in your indexSuccess.php and showSuccess.php instead of for example: <?php $value->getCreatedAt() ?> next: <?php echo date('d.M.Y', strtotime($value->getCreatedAt())) ?> You can use other formats. 回答2: The format of some data absolutely not belongs into controller context - so please

Symfony 1.4 best practice production & development configuration

六月ゝ 毕业季﹏ 提交于 2020-01-10 11:45:11
问题 I'm just getting started with Symfony. I'm using Git/github as a way of managing my project. I've set up two ignores for log and cache which is fine. I now need to set up a production site. At the moment on this small project I've development and production on the same server but with different file locations and databases. e.g. www.example.com/mysymfonyproject_dev/ < development area & www.example.com/mysymfonyproject/ < Live / Production site On server its /homes/sites/example.com/www

symfony 1.4: creating “Copy” action

夙愿已清 提交于 2020-01-06 05:48:08
问题 I need to create "Copy" action for model listing. It should take all values from some model, fill those to forms, you could edit just few fields and after pressing "save" it would create NEW model. At the moment i thought about merging Edit and New actions as so: public function executeListCopy(sfWebRequest $request) { # EDIT # $this->offer = $this->getRoute()->getObject(); # $this->form = $this->configuration->getForm($this->offer); # NEW # $this->form = $this->configuration->getForm(); #