symfony-1.4

Symfony 1.4 deprecated function in php

不打扰是莪最后的温柔 提交于 2019-12-30 03:30:11
问题 Anyone know what is this error? I need help with this Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\xampp\htdocs\sfprojects\jobeet\lib\vendor\symfony\lib\response\sfWebResponse.class.php on line 409 . I'm using xampp 1.8.3 and symfony 1.4 . I couldn't get to step forward because of this a weeke a go :'(. Any help will be appreciated. Thank you. 回答1: In myproject/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 409 protected

Uploaded docx files turning into zip

最后都变了- 提交于 2019-12-30 03:30:07
问题 I am currently using symfony 1.4 and would like to allow users to upload Microsoft Word docx files. Using the sfWidgetFormInputFile widget and sfValidatorFile below users are able to select and successfully upload their docx files using a simple web form. $this->widgetSchema['file_name'] = new sfWidgetFormInputFile(array('label' => 'File')); $this->validatorSchema['file_name'] = new sfValidatorFile(array( 'required' => true, 'path' => sfConfig::get('sf_upload_dir').DIRECTORY_SEPARATOR

symfony 1.4: How to pass exception message to error.html.php?

坚强是说给别人听的谎言 提交于 2019-12-30 02:33:05
问题 I tried using special variable $message described here http://www.symfony-project.org/cookbook/1_2/en/error_templates but it seems this variable isn't defined in symfony 1.4, at least it doesn't contain message passed to exception this way throw new sfException('some message') Do you know other way to pass this message to error.html.php ? 回答1: You'll need to do some custom error handling. We implemented a forward to a custom symfony action ourselves. Be cautious though, this action itself

change month name to french

烂漫一生 提交于 2019-12-27 15:47:05
问题 I have this code: <?php echo "'".$sgps_newsletter->getEmail()."' demande en ".date('d.M.Y', strtotime($sgps_newsletter->getCreatedAt())) ?> but the month name is appering in english. What can I do to show it in french? I've change the settings.yml default culture to french, but nothing happens. 回答1: From http://php.net/manual/en/function.date.php: To format dates in other languages, you should use the setlocale() and strftime() functions instead of date(). 回答2: Use strftime : http://php.net

change month name to french

断了今生、忘了曾经 提交于 2019-12-27 15:46:47
问题 I have this code: <?php echo "'".$sgps_newsletter->getEmail()."' demande en ".date('d.M.Y', strtotime($sgps_newsletter->getCreatedAt())) ?> but the month name is appering in english. What can I do to show it in french? I've change the settings.yml default culture to french, but nothing happens. 回答1: From http://php.net/manual/en/function.date.php: To format dates in other languages, you should use the setlocale() and strftime() functions instead of date(). 回答2: Use strftime : http://php.net

How to handle related null-objects correctly in symfony 1.4

半腔热情 提交于 2019-12-25 16:25:18
问题 The situation is that I have doctrine entity classes Category and Item with the following YAML definitions: Category: columns: parent_category_id: { type: integer } name: { type: string(255), notnull: true, notblank: true } items_count: { type: integer, notnull: true, default: 0 } relations: ParentCategory: { class: Category, local: parent_category_id, foreign: id } Item: columns: category_id: { type: integer, notnull: true } name: { type: string(255), notnull: true, notblank: true }

How to handle related null-objects correctly in symfony 1.4

半世苍凉 提交于 2019-12-25 16:25:15
问题 The situation is that I have doctrine entity classes Category and Item with the following YAML definitions: Category: columns: parent_category_id: { type: integer } name: { type: string(255), notnull: true, notblank: true } items_count: { type: integer, notnull: true, default: 0 } relations: ParentCategory: { class: Category, local: parent_category_id, foreign: id } Item: columns: category_id: { type: integer, notnull: true } name: { type: string(255), notnull: true, notblank: true }

I need to direct modify the $sf_content what is the best workaround?

ぃ、小莉子 提交于 2019-12-25 08:43:55
问题 Situation: only main page is accessible by default, all other pages needs a logged in user. When a module is loaded without user, a login template should be displayed, and no module. In other words, the $sf_content must be emptied in layout.php which is not 100% ok since there is logic in the layout. Is there elegant way for that? I dont think a helper is OK either.... 回答1: Check out security filters, this is one standard way security is designed in symfony. You even can implement your own

How to restrict user from downloading or saving pdf file? [duplicate]

风格不统一 提交于 2019-12-25 08:16:44
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Prevent PDF file from downloading and printing In my current symfony project (in admin section) I uploaded pdf file and open it by using JavaScript, but I want to restrict user to download or save for that pdf? So is it possible to me to restrict user to download or save pdf? I means user can only view content of that pdf, i want to disable download or save options of all browsers for that pdf. pdf file is open

Script output after timeout command

巧了我就是萌 提交于 2019-12-25 07:37:17
问题 i use symfony (php framework) task class to create cli scripts. Currently i wrote this kind of script: #!/bin/bash timeout 3600 ./symfony pparse:prices But there is no output, I need that script will exit after 3600 sec. and ./symfony pparse:prices output data to console. Timeout is working, but no output. 回答1: I dont know why, but currently it work fine. Maybe this is issue to OS. 来源: https://stackoverflow.com/questions/16582048/script-output-after-timeout-command