Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 8 commits
  • 7 files changed
  • 0 commit comments
  • 4 contributors
Commits on Oct 22, 2012
Jeremy j0k3r This little line always show notice ...
ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush
f5fa69a
Commits on Nov 28, 2012
Jeremy j0k3r Merge remote-tracking branch 'upstream/master' af46d8e
Commits on May 03, 2013
Jérôme Tamarelle GromNaN Fix autoloading when swiftmailer classes are already autoloaded 94c2cfd
Jérôme MACIAS Inject sf_user into sfcontext::getServiceContainer() method d53682c
Jérôme MACIAS [sfDoctrinePlugin] Add missing relations columns of inherited classes…
… in form generator
8f2c396
Jérôme MACIAS Partialy revert 7cbbe6b 967b668
Tristan Bessoussa tristanbes Fix error where form cannot be submitted because of post_max_size=0
Symfony triggers an error on form submission if we set the post_max_size to 0 (to disable the limit)
64232a8
Jeremy j0k3r Add 404 error message to user session, so it can be easily retrieved …
…later

404 message can't be retrieved in prod env.
79417d5
5 lib/action/sfAction.class.php
View
@@ -536,6 +536,11 @@ public function getRoute()
*/
protected function get404Message($message = null)
{
+ if (!sfConfig::get('sf_debug') && null !== $message)
+ {
+ $this->getUser()->setFlash('404_message', $message);
+ }
+
return null === $message ? sprintf('This request has been forwarded to a 404 error page by the action "%s/%s".', $this->getModuleName(), $this->getActionName()) : $message;
}
}
2  lib/command/sfCommandApplication.class.php
View
@@ -557,7 +557,7 @@ protected function strlen($string)
protected function fixCgi()
{
// handle output buffering
- @ob_end_flush();
+ // @ob_end_flush();
ob_implicit_flush(true);
// PHP ini settings
29 lib/config/sfCompileConfigHandler.class.php
View
@@ -48,31 +48,32 @@ public function execute($configFiles)
throw new sfParseException(sprintf('Configuration file "%s" specifies nonexistent or unreadable file "%s".', $configFiles[0], $file));
}
- if (sfConfig::get('sf_debug'))
- {
- $contents = file_get_contents($file);
+ $contents = file_get_contents($file);
- // replace windows and mac format with unix format
- $contents = str_replace("\r", PHP_EOL, $contents);
- }
- else
+ // strip comments (not in debug mode)
+ if (!sfConfig::get('sf_debug'))
{
- // strip whitespaces and comments
- $contents = php_strip_whitespace($file);
+ $contents = sfToolkit::stripComments($contents);
}
// strip php tags
$contents = sfToolkit::pregtr($contents, array('/^\s*<\?(php\s*)?/m' => '', '/^\s*\?>/m' => ''));
+ // replace windows and mac format with unix format
+ $contents = str_replace("\r", "\n", $contents);
+
+ // replace multiple new lines with a single newline
+ $contents = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $contents);
+
// append file data
- $data .= PHP_EOL.$contents;
+ $data .= "\n".$contents;
}
// compile data
- return sprintf('<?php'.PHP_EOL.
- '// auto-generated by sfCompileConfigHandler'.PHP_EOL.
- '// date: %s'.PHP_EOL.
- '%s'.PHP_EOL,
+ return sprintf("<?php\n".
+ "// auto-generated by sfCompileConfigHandler\n".
+ "// date: %s\n".
+ "%s\n",
date('Y/m/d H:i:s'), $data);
}
20 lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php
View
@@ -570,6 +570,26 @@ public function getColumns()
$columns[] = new sfDoctrineColumn($name, $this->table);
}
+ // add relations to columns for inherited classes
+ if ($parentModel)
+ {
+ $parentRelationNames = array_keys(Doctrine_Core::getTable($parentModel)->getRelations());
+ $relations = $this->table->getRelations();
+ $relationColumns = array();
+ foreach (array_diff(array_keys($relations), $parentRelationNames) as $relationName)
+ {
+ if (Doctrine_Relation::ONE == $relations[$relationName]->getType())
+ {
+ $columnName = $relations[$relationName]->getLocal();
+ if (!in_array($columnName, $relationColumns))
+ {
+ $relationColumns[] = $columnName;
+ $columns[] = new sfDoctrineColumn($columnName, $this->table);
+ }
+ }
+ }
+ }
+
return $columns;
}
9 lib/task/sfCommandApplicationTask.class.php
View
@@ -128,9 +128,12 @@ protected function getMailer()
*/
protected function initializeMailer()
{
- $swift_dir = sfConfig::get('sf_symfony_lib_dir').'/vendor/swiftmailer/lib';
- require_once $swift_dir.'/classes/Swift.php';
- Swift::registerAutoload($swift_dir.'/swift_init.php');
+ if (!class_exists('Swift'))
+ {
+ $swift_dir = sfConfig::get('sf_symfony_lib_dir').'/vendor/swiftmailer/lib';
+ require_once $swift_dir.'/classes/Swift.php';
+ Swift::registerAutoload($swift_dir.'/swift_init.php');
+ }
$config = $this->getFactoryConfiguration();
1  lib/util/sfContext.class.php
View
@@ -449,6 +449,7 @@ public function getServiceContainer()
$this->factories['serviceContainer'] = new $this->serviceContainerConfiguration['class']();
$this->factories['serviceContainer']->setService('sf_event_dispatcher', $this->configuration->getEventDispatcher());
$this->factories['serviceContainer']->setService('sf_formatter', new sfFormatter());
+ $this->factories['serviceContainer']->setService('sf_user', $this->getUser());
}
return $this->factories['serviceContainer'];
2  lib/validator/sfValidatorSchema.class.php
View
@@ -110,7 +110,7 @@ protected function doClean($values)
$errorSchema = new sfValidatorErrorSchema($this);
// check that post_max_size has not been reached
- if (isset($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $this->getBytes(ini_get('post_max_size')))
+ if (isset($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $this->getBytes(ini_get('post_max_size')) && ini_get('post_max_size') != 0)
{
$errorSchema->addError(new sfValidatorError($this, 'post_max_size'));

No commit comments for this range

Something went wrong with that request. Please try again.