symfony1

Symfony error 500 with app.php, works fine on app_dev.php

…衆ロ難τιáo~ 提交于 2019-12-07 10:36:08
问题 I am currently trying to use our (basic) Symfony 2 app by accessing app.php. However, whenever I try to access app.php, I get an error 500. I have checked the logs, the production log is empty. I have tried the assetic entry in the config file, but to no avail. Anyone else who has any ideas on how to fix this? This is a very basic application (for now), with just some routing changes and a new controller. The most part is html (as a test), so it can't be the php we've written so far. --edit:

WordPress Symfony Co-habitation

本小妞迷上赌 提交于 2019-12-07 10:08:29
问题 We have a site that runs on Symfony and that was developed by people much more competent that myself. I am however quite competent in WordPress and will be installing a blog on a the site. Currently, the root of the site runs on Symfony but I would like for WordPress to take over without having to touch the Symphony core. Essentially, I would like to install WordPress in a sub directory of the www directory, say www/wordpress/ and have htaccess point to that directory as the root of my domain

Symfony sfGuardPlugin password recovery

倾然丶 夕夏残阳落幕 提交于 2019-12-07 09:56:26
I am supporting a site built on symfony. There were problems regarding some kind of "admin page". While not knowing much about the whole thing by reading the logs and comparing recent backups I think I was able to fix the issue (some developer removed a route, but did not fix a template). I do not have admin password to the site, but have root access to the server and super access to the database (in this case postgres). Can you help me how to create myself an account without knowing the current passwords? Disclaimer: I do not have much knowledge with PHP's OOP interface as I am not a

What's the best way to make small schema updates with Doctrine/Symfony?

ε祈祈猫儿з 提交于 2019-12-06 20:29:27
What's the best way to make small schema updates to your symfony/doctrine application? My issue is, I'm working on a new side-project and occasionally find myself adding a new column here, a new column there as i find the need. However, my DB already has existing data and I dont want to run a complete rebuild and drop my DB with the changes each time. I also dont want to write fixtures. They're annoying, and it's much easier to use my application to insert data and keep it around while developing. I also dont want to write a migration to add one or two columns, especially when I'm doing this a

Symfony 1.4 sessions randomly lost

帅比萌擦擦* 提交于 2019-12-06 19:24:00
问题 This is an issue I've started to experiment a few months ago and I've been trying to fix without success since. Symptoms : At random intervals of time symfony loses the session info and logs out the users. It seems somehow to be connected with the load of the site. When the load is higher it seems that the users are logged out more often, could happen even fast as 30 seconds. Environment : Since this started I've changed a lot of the setup, including the php version, web server, session

Symfony/Doctrine: Unserialize in action vs template

 ̄綄美尐妖づ 提交于 2019-12-06 16:15:04
问题 Can anyone tell me why calling "unserialize" works fine in an action but gives an offset error in a template? It's basically possible to unserialize a database text result into a variable in an action and pass it to template, in which case it displays fine: $this->clean = unserialize($this->raw); <?php echo $clean ?> But not if called directly in a template: <?php echo unserialize($raw) ?> Would be interested in knowing why this is so and whether there's some workaround. Thanks. 回答1: Symfony

Doctrine Entity findBy Many to Many

时间秒杀一切 提交于 2019-12-06 16:02:15
I have a many to many relationship between products and colours. What I am trying to do is find products by their colours. eg) $colours = $em->getRepository('Xxxxx\XxxxxBundle\Entity\Colour')->findBy(array('name'=>'red'); $products = $em->getRepository('Xxxxx\XxxxxBundle\Entity\Product')->findBy(array('colours'=>$colours)); This is my Yaml config: Xxxxx\XxxxxBundle\Entity\Product: type: entity manyToMany: colours: targetEntity: Colour joinTable: name: Product_Colour joinColumns: product_id: referencedColumnName: id inverseJoinColumns: colour_id: referencedColumnName: id . Xxxxx\XxxxxBundle

Symfony: How to change a form field attribute in an action?

天大地大妈咪最大 提交于 2019-12-06 13:17:39
I've got a functioning form with a sfWidgetFormChoice that acts as a list of checkboxes. I'm able to set the checkboxes to "ticked" by default with the following: 'status' => new sfWidgetFormChoice(array('choices' => array(1, 2, 3), 'multiple' => true, 'expanded' => true), array('checked' => 'checked')) ... where the checkboxes are called "status" and the possible values are 1/2/3. However, because of something else, instead of ticking them all by default I'd like to be able to control the "checked" status from an action. How do I do this? I've tried everything logical I can think of but I

Creating a Calendar in Symfony

只愿长相守 提交于 2019-12-06 13:00:25
问题 I'm using symfony 1.4 for my web project. I have the following problem (or opportunity): I need to create a calendar where the "common" user has only the ability to see (or read) the date and time of the events and the "admin" user can edit, add and remove new events. So it's basically a google calendar type of thing where I have to different permissions, read and read, write, delete. Also I need to be able to fully customize a calendar style so that It matches my css. How would your approach

How to simulate an error 500 in Symfony 1.4?

大城市里の小女人 提交于 2019-12-06 12:29:21
I created an error500.php file in web/errors/ and would now like to test it. I tried to put this line in one of my actions: $this->getResponse()->setStatusCode(500); Unfortunately it looks like it's ignored. Do you guys have any idea of what's happening here? I'm using Symfony 1.4. Edit: Firebug is telling me that the error is actually fired but the page is still loading afterwards. And I'm in the prod env. I'm pretty sure throwing any exception should trigger the error page: throw new sfException('Testing the 500 error'); However, the location of the error page is different in symfony 1.2+: