From 02b9af44d8ef1679d4d618b4d7e3d9637649faab Mon Sep 17 00:00:00 2001 From: Kousuke Ebihara Date: Tue, 2 Mar 2010 17:53:05 +0900 Subject: [PATCH] updated to symfony 1.4.3 (fixes #673) --- lib/vendor/symfony/CHANGELOG | 48 +++++++ .../symfony/lib/addon/sfPager.class.php | 59 ++++++--- .../lib/autoload/sfCoreAutoload.class.php | 4 +- .../symfony/lib/config/config/factories.yml | 2 +- .../config/sfProjectConfiguration.class.php | 3 +- .../lib/controller/sfWebController.class.php | 4 +- .../symfony/lib/debug/sfWebDebug.class.php | 8 +- .../lib/debug/sfWebDebugPanel.class.php | 4 +- .../sfOutputEscaperArrayDecorator.class.php | 16 ++- lib/vendor/symfony/lib/form/sfForm.class.php | 8 +- .../lib/generator/sfModelGenerator.class.php | 4 +- .../symfony/lib/helper/PartialHelper.php | 6 +- lib/vendor/symfony/lib/helper/UrlHelper.php | 6 +- .../symfony/lib/i18n/sfNumberFormat.class.php | 9 +- .../symfony/lib/log/sfVarLogger.class.php | 4 +- .../plugin/sfSymfonyPluginManager.class.php | 4 +- .../admin/parts/sortingAction.php | 5 + .../sfDoctrinePlugin/i18n/sf_admin.tr.xml | 49 +++++++- .../debug/sfWebDebugPanelDoctrine.class.php | 6 +- .../lib/form/sfFormDoctrine.class.php | 10 +- .../lib/form/sfFormFilterDoctrine.class.php | 4 +- .../sfDoctrineFormFilterGenerator.class.php | 4 +- .../sfDoctrineFormGenerator.class.php | 25 ++-- .../lib/pager/sfDoctrinePager.class.php | 17 ++- .../task/sfDoctrineInsertSqlTask.class.php | 6 +- .../sfValidatorDoctrineChoice.class.php | 19 +-- .../Doctrine/Parser/sfYaml/sfYamlInline.php | 2 +- .../Doctrine/Parser/sfYaml/sfYamlParser.php | 43 +++++-- .../test/functional/AdminGenBrowser.class.php | 87 +++++++++++++ .../test/functional/FormGeneratorTest.php | 14 ++- .../test/functional/PagerTest.php | 13 +- .../fixtures/config/doctrine/schema.yml | 10 +- .../functional/fixtures/data/sql/schema.sql | 1 + .../doctrine/ResourceTypeFormFilter.class.php | 16 +++ .../form/doctrine/ResourceTypeForm.class.php | 16 +++ .../lib/model/doctrine/ResourceType.class.php | 15 +++ .../doctrine/ResourceTypeTable.class.php | 5 + .../test/unit/form/sfFormDoctrineTest.php | 38 +++++- .../unit/form/sfFormFilterDoctrineTest.php | 12 +- .../sfValidatorDoctrineChoiceTest.php | 18 +++ .../template/sfPropelFormBaseTemplate.php | 1 - .../sfPropelFormGeneratedTemplate.php | 1 - .../default/template/sfPropelFormTemplate.php | 1 - .../sfPropelFormFilterBaseTemplate.php | 1 - .../sfPropelFormFilterGeneratedTemplate.php | 1 - .../template/sfPropelFormFilterTemplate.php | 1 - .../admin/template/actions/actions.class.php | 1 - .../admin/template/lib/helper.php | 1 - .../template/actions/actions.class.php | 1 - .../sfPropelPlugin/i18n/sf_admin.tr.xml | 49 +++++++- .../lib/addon/sfPropelPager.class.php | 4 +- .../lib/debug/sfWebDebugPanelPropel.class.php | 6 +- .../lib/form/sfFormFilterPropel.class.php | 4 +- .../lib/form/sfFormPropel.class.php | 6 +- .../sfValidatorPropelUnique.class.php | 13 +- .../AlternativeCodingStandardsBehavior.php | 13 +- .../engine/behavior/SoftDeleteBehavior.php | 6 +- .../propel/engine/builder/om/OMBuilder.php | 4 +- .../builder/om/php5/PHP5ObjectBuilder.php | 14 ++- .../builder/om/php5/PHP5PeerBuilder.php | 117 +++++++++++------- .../propel/engine/database/model/Column.php | 11 +- .../engine/database/model/ForeignKey.php | 13 +- .../reverse/pgsql/PgsqlSchemaParser.php | 10 +- .../propel-generator/default.properties | 2 +- .../lib/vendor/propel/Propel.php | 10 +- .../lib/vendor/propel/util/DebugPDO.php | 8 +- .../vendor/propel/util/DebugPDOStatement.php | 5 +- .../test/unit/form/sfFormPropelTest.php | 37 ++++++ .../validator/sfValidatorPropelUniqueTest.php | 58 +++++++++ .../symfony/lib/routing/sfRoute.class.php | 35 ++++-- .../generator/sfGenerateProjectTask.class.php | 27 +++- .../generator/sfGenerateTaskTask.class.php | 6 +- .../project/sfProjectOptimizeTask.class.php | 4 +- .../sfDeprecatedClassesValidation.class.php | 8 +- .../sfDeprecatedHelpersValidation.class.php | 6 +- .../sfDeprecatedMethodsValidation.class.php | 14 +-- .../sfDeprecatedPluginsValidation.class.php | 4 +- .../sfDeprecatedSettingsValidation.class.php | 4 +- .../sfParameterHolderValidation.class.php | 8 +- .../symfony/lib/task/sfFilesystem.class.php | 9 +- .../lib/test/sfTestFunctionalBase.class.php | 4 +- .../lib/test/sfTesterRequest.class.php | 4 +- .../lib/test/sfTesterResponse.class.php | 18 ++- .../symfony/lib/util/sfBrowserBase.class.php | 11 +- .../lib/util/sfDomCssSelector.class.php | 4 +- .../lib/validator/sfValidatedFile.class.php | 3 +- .../lib/validator/sfValidatorDate.class.php | 12 +- .../lib/widget/sfWidgetFormSchema.class.php | 6 +- .../sfWidgetFormSelectCheckbox.class.php | 4 +- .../widget/sfWidgetFormSelectRadio.class.php | 4 +- .../symfony/test/functional/escapingTest.php | 51 ++++---- .../escaping/actions/actions.class.php | 6 +- .../modules/escaping/templates/_partial1.php | 6 + .../modules/escaping/templates/_partial2.php | 4 + .../escaping/templates/indexSuccess.php | 2 + .../symfony/test/unit/addon/sfPagerTest.php | 43 +++++++ .../sfOutputEscaperArrayDecoratorTest.php | 8 +- .../symfony/test/unit/form/sfFormTest.php | 16 ++- .../test/unit/helper/NumberHelperTest.php | 6 +- .../unit/routing/sfPatternRoutingTest.php | 26 +++- .../symfony/test/unit/util/sfBrowserTest.php | 4 +- .../test/unit/util/sfDomCssSelectorTest.php | 3 +- .../sfWidgetFormI18nChoiceCountryTest.php | 7 +- .../sfWidgetFormI18nChoiceCurrencyTest.php | 6 +- .../unit/widget/sfWidgetFormSchemaTest.php | 8 +- .../widget/sfWidgetFormSelectCheckboxTest.php | 8 +- .../widget/sfWidgetFormSelectRadioTest.php | 8 +- symfony | 29 ++++- 108 files changed, 1120 insertions(+), 339 deletions(-) create mode 100644 lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/filter/doctrine/ResourceTypeFormFilter.class.php create mode 100644 lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/form/doctrine/ResourceTypeForm.class.php create mode 100644 lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/model/doctrine/ResourceType.class.php create mode 100644 lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/model/doctrine/ResourceTypeTable.class.php create mode 100644 lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/validator/sfValidatorDoctrineChoiceTest.php create mode 100644 lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/form/sfFormPropelTest.php create mode 100644 lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/validator/sfValidatorPropelUniqueTest.php create mode 100644 lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial1.php create mode 100644 lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial2.php create mode 100644 lib/vendor/symfony/test/unit/addon/sfPagerTest.php diff --git a/lib/vendor/symfony/CHANGELOG b/lib/vendor/symfony/CHANGELOG index bc4998b01..80a1cd0d6 100644 --- a/lib/vendor/symfony/CHANGELOG +++ b/lib/vendor/symfony/CHANGELOG @@ -1,3 +1,51 @@ +02/25/10: Version 1.4.3 +----------------------- + + * [28260] fixed sql injection vulnerability in doctrine admin generator + +02/12/10: Version 1.4.2 +----------------------- + + * [27954] fixed enabling of local csrf protection when disabled globally (closes #8228) + * [27942] fixed output of doctrine:insert-sql task (closes #8008) + * [27940] fixed field name used when propel unique validator throws a non-global error (closes #8108) + * [27842] fixed typo, fixed consistent use of field rather than column name in doctrine form generators (closes #8254) + * [27836] fixed submission of disable form fields by browser (closes #8178) + * [27755] fixed double escaping of partial vars (closes #7825, refs #1638) + * [27753] fixed helper signature (closes #8170) + * [27752] fixed initialization of output escaper array iterator (closes #8202) + * [27751] fixed symlink logic on vista+ with php 5.3 (closes #8237) + * [27750] updated generated stub task to guess a default connection name based on ORM (closes #8209) + * [27749] updated doctrine and propel forms to allow setting of defaults on numeric fields from within configure (closes #8238) + * [27748] fixed form filtering by 0 on a number column (closes #8175) + * [27747] fixed doctrine pager iteration (closes #7758, refs #8021) + * [27742] fixed generation of enum pk form widgets (closes #7959) + * [27738] fixed XSS hole in select checkbox and radio widgets (closes #8176) + * [27736] fixed sfValidatorDoctrineChoice in cloned forms (embedForEach) doesn't function correctly (closes #8198) + * [27616] passed the changeStack option in ->get() and ->post() calls of sfBrowserBase to the delegated ->call() (fixes #4271) + * [27612] added basic test for sfPager->rewind() and fixed bug not leading to ->reset() not working correctly. (fixes #8021) + * [27597] fixed minor incompatibility of new link_to() behaviour with 1.0 behaviour (fixes #7933, #8231) + * [27511] fixed typo preventing sfProjectOptimizeTask to work correctly (closes #7885) + * [27479] Removed svn version line from propel generated files showing them as modified even without changes each regeneration (backported r27472) + * [27284] fixed empty class attributes in WDT markup (closes #8196) + * [27211] added check and logging for non executable remote installer files in sfGenerateProjectTask (closes #7921) + * [27183] fixed behavior when using either no separators or non slash separators for sfPatternRouting (fixes #8114) + * [27061] partially fixed sfTester#isValid() on Windows systems (closes #7812) + * [26989] fixed typo in getting Priorities from sfVarLogger (fixes #7938) + * [26957] updated web debug javascript to work when the dom includes an svg element + * [26872] fixed sfDomCssSelector requires quotes for matching attribute values when they should be optional (closes #8120) + * [26871] fixed sfValidateDate for negative timestamps (closes #8134) + * [26870] fixed sfWidgetFormSchema::setPositions() which accepts duplication positions (closes #7992) + * [26867] turned off xdebug_logging by default as it can make the dev env very very slow (closes #8085) + * [26866] fixed sfValidatorDate errors (closes #8118) + * [26865] updated Propel to 1.4.1 (closes #8131) + * [26681] fixed format_currency is rounding bad (closes #6788) + * [25459] added the module name when including a partial in the admin generator + * [25458] updated Turkish translations of the admin generator (closes #7928, patch by metoikos) + * [25411] changed project:validate task to generate less false positive (closes #7852) + * [25406] removed duplicate is_string check in sfWebController (closes #7918) + * [25218] Fixing issue with disablePlugin() static method being called publicly while being defined protected + 12/08/09: Version 1.4.1 ----------------------- diff --git a/lib/vendor/symfony/lib/addon/sfPager.class.php b/lib/vendor/symfony/lib/addon/sfPager.class.php index e0ddeb283..47b231c94 100644 --- a/lib/vendor/symfony/lib/addon/sfPager.class.php +++ b/lib/vendor/symfony/lib/addon/sfPager.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage addon * @author Fabien Potencier - * @version SVN: $Id: sfPager.class.php 24533 2009-11-29 15:58:01Z Kris.Wallsmith $ + * @version SVN: $Id: sfPager.class.php 27747 2010-02-08 18:02:19Z Kris.Wallsmith $ */ abstract class sfPager implements Iterator, Countable { @@ -31,6 +31,8 @@ abstract class sfPager implements Iterator, Countable $currentMaxLink = 1, $parameterHolder = null, $maxRecordLimit = false, + + // used by iterator interface $results = null, $resultsCounter = 0; @@ -493,6 +495,34 @@ public function setParameter($name, $value) $this->parameterHolder->set($name, $value); } + /** + * Returns true if the properties used for iteration have been initialized. + * + * @return boolean + */ + protected function isIteratorInitialized() + { + return null !== $this->results; + } + + /** + * Loads data into properties used for iteration. + */ + protected function initializeIterator() + { + $this->results = $this->getResults(); + $this->resultsCounter = count($this->results); + } + + /** + * Empties properties used for iteration. + */ + protected function resetIterator() + { + $this->results = null; + $this->resultsCounter = 0; + } + /** * Returns the current result. * @@ -500,10 +530,9 @@ public function setParameter($name, $value) */ public function current() { - if (null === $this->results) + if (!$this->isIteratorInitialized()) { - $this->results = $this->getResults(); - $this->resultsCounter = count($this->results); + $this->initializeIterator(); } return current($this->results); @@ -516,10 +545,9 @@ public function current() */ public function key() { - if (null === $this->results) + if (!$this->isIteratorInitialized()) { - $this->results = $this->getResults(); - $this->resultsCounter = count($this->results); + $this->initializeIterator(); } return key($this->results); @@ -532,10 +560,9 @@ public function key() */ public function next() { - if (null === $this->results) + if (!$this->isIteratorInitialized()) { - $this->results = $this->getResults(); - $this->resultsCounter = count($this->results); + $this->initializeIterator(); } --$this->resultsCounter; @@ -550,12 +577,13 @@ public function next() */ public function rewind() { - if (null === $this->results) + if (!$this->isIteratorInitialized()) { - $this->results = $this->getResults(); - $this->resultsCounter = count($this->results); + $this->initializeIterator(); } + $this->resultsCounter = count($this->results); + return reset($this->results); } @@ -566,10 +594,9 @@ public function rewind() */ public function valid() { - if (null === $this->results) + if (!$this->isIteratorInitialized()) { - $this->results = $this->getResults(); - $this->resultsCounter = count($this->results); + $this->initializeIterator(); } return $this->resultsCounter > 0; diff --git a/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php b/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php index baa9d7df1..2418d53dc 100644 --- a/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php +++ b/lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php @@ -11,7 +11,7 @@ /** * The current symfony version. */ -define('SYMFONY_VERSION', '1.4.1'); +define('SYMFONY_VERSION', '1.4.3'); /** * sfCoreAutoload class. @@ -22,7 +22,7 @@ * @package symfony * @subpackage autoload * @author Fabien Potencier - * @version SVN: $Id: sfCoreAutoload.class.php 25078 2009-12-08 14:14:38Z Kris.Wallsmith $ + * @version SVN: $Id: sfCoreAutoload.class.php 28268 2010-02-25 07:01:44Z Kris.Wallsmith $ */ class sfCoreAutoload { diff --git a/lib/vendor/symfony/lib/config/config/factories.yml b/lib/vendor/symfony/lib/config/config/factories.yml index c97fe7692..19a82be91 100644 --- a/lib/vendor/symfony/lib/config/config/factories.yml +++ b/lib/vendor/symfony/lib/config/config/factories.yml @@ -90,7 +90,7 @@ default: param: level: debug condition: %SF_WEB_DEBUG% - xdebug_logging: true + xdebug_logging: false web_debug_class: sfWebDebug sf_file_debug: class: sfFileLogger diff --git a/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php b/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php index 491d3ae70..7a7316c66 100644 --- a/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php +++ b/lib/vendor/symfony/lib/config/sfProjectConfiguration.class.php @@ -14,13 +14,14 @@ * @package symfony * @subpackage config * @author Fabien Potencier - * @version SVN: $Id: sfProjectConfiguration.class.php 24039 2009-11-16 17:52:14Z Kris.Wallsmith $ + * @version SVN: $Id: sfProjectConfiguration.class.php 27191 2010-01-26 13:38:49Z FabianLange $ */ class sfProjectConfiguration { protected $rootDir = null, $symfonyLibDir = null, + $dispatcher = null, $plugins = array(), $pluginPaths = array(), $overriddenPluginPaths = array(), diff --git a/lib/vendor/symfony/lib/controller/sfWebController.class.php b/lib/vendor/symfony/lib/controller/sfWebController.class.php index 8c75db6d0..c4ec5bc96 100644 --- a/lib/vendor/symfony/lib/controller/sfWebController.class.php +++ b/lib/vendor/symfony/lib/controller/sfWebController.class.php @@ -16,7 +16,7 @@ * @subpackage controller * @author Fabien Potencier * @author Sean Kerr - * @version SVN: $Id: sfWebController.class.php 24039 2009-11-16 17:52:14Z Kris.Wallsmith $ + * @version SVN: $Id: sfWebController.class.php 25406 2009-12-15 12:22:30Z FabianLange $ */ abstract class sfWebController extends sfController { @@ -47,7 +47,7 @@ public function genUrl($parameters = array(), $absolute = false) return $parameters; } - if (is_string($parameters) && $parameters == '#') + if ($parameters == '#') { return $parameters; } diff --git a/lib/vendor/symfony/lib/debug/sfWebDebug.class.php b/lib/vendor/symfony/lib/debug/sfWebDebug.class.php index e9c254f6a..5ff8d0e49 100644 --- a/lib/vendor/symfony/lib/debug/sfWebDebug.class.php +++ b/lib/vendor/symfony/lib/debug/sfWebDebug.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage debug * @author Fabien Potencier - * @version SVN: $Id: sfWebDebug.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfWebDebug.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $ */ class sfWebDebug { @@ -185,8 +185,8 @@ public function asHtml() if (($content = $panel->getPanelContent()) || $panel->getTitleUrl()) { $id = sprintf('sfWebDebug%sDetails', $name); - $titles[] = sprintf('
  • %s
  • ', - $panel->getStatus() ? 'sfWebDebug'.ucfirst($this->getPriority($panel->getStatus())) : '', + $titles[] = sprintf('%s', + $panel->getStatus() ? ' class="sfWebDebug'.ucfirst($this->getPriority($panel->getStatus())).'"' : '', $panel->getPanelTitle(), $panel->getTitleUrl() ? $panel->getTitleUrl() : '#', $panel->getTitleUrl() ? '' : ' onclick="sfWebDebugShowDetailsFor(\''.$id.'\'); return false;"', @@ -268,7 +268,7 @@ function sfWebDebugGetElementsByClassName(strClass, strTag, objContElm) var j = objColl.length; for (var i = 0; i < j; i++) { if(objColl[i].className == undefined) continue; - var arrObjClass = objColl[i].className.split(' '); + var arrObjClass = objColl[i].className.split ? objColl[i].className.split(' ') : []; if (delim == ' ' && arrClass.length > arrObjClass.length) continue; var c = 0; comparisonLoop: diff --git a/lib/vendor/symfony/lib/debug/sfWebDebugPanel.class.php b/lib/vendor/symfony/lib/debug/sfWebDebugPanel.class.php index 343db4cb7..0d1f6958a 100644 --- a/lib/vendor/symfony/lib/debug/sfWebDebugPanel.class.php +++ b/lib/vendor/symfony/lib/debug/sfWebDebugPanel.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage debug * @author Fabien Potencier - * @version SVN: $Id: sfWebDebugPanel.class.php 22955 2009-10-12 16:44:07Z Kris.Wallsmith $ + * @version SVN: $Id: sfWebDebugPanel.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $ */ abstract class sfWebDebugPanel { @@ -123,7 +123,7 @@ public function getToggleableDebugStack($debugStack) $isProjectFile = $file && 0 === strpos($file, sfConfig::get('sf_root_dir')) && !preg_match('/(cache|plugins|vendor)/', $file); - $html .= sprintf('#%s » ', $isProjectFile ? 'sfWebDebugHighlight' : '', $keys[$j] + 1); + $html .= sprintf('#%s » ', $isProjectFile ? ' class="sfWebDebugHighlight"' : '', $keys[$j] + 1); if (isset($trace['function'])) { diff --git a/lib/vendor/symfony/lib/escaper/sfOutputEscaperArrayDecorator.class.php b/lib/vendor/symfony/lib/escaper/sfOutputEscaperArrayDecorator.class.php index 52bcb1717..67d410a84 100644 --- a/lib/vendor/symfony/lib/escaper/sfOutputEscaperArrayDecorator.class.php +++ b/lib/vendor/symfony/lib/escaper/sfOutputEscaperArrayDecorator.class.php @@ -15,7 +15,7 @@ * @package symfony * @subpackage view * @author Mike Squire - * @version SVN: $Id: sfOutputEscaperArrayDecorator.class.php 9158 2008-05-21 20:32:00Z FabianLange $ + * @version SVN: $Id: sfOutputEscaperArrayDecorator.class.php 27752 2010-02-08 19:21:22Z Kris.Wallsmith $ */ class sfOutputEscaperArrayDecorator extends sfOutputEscaperGetterDecorator implements Iterator, ArrayAccess, Countable { @@ -26,6 +26,18 @@ class sfOutputEscaperArrayDecorator extends sfOutputEscaperGetterDecorator imple */ private $count; + /** + * Constructor. + * + * @see sfOutputEscaper + */ + public function __construct($escapingMethod, $value) + { + parent::__construct($escapingMethod, $value); + + $this->count = count($this->value); + } + /** * Reset the array to the beginning (as required for the Iterator interface). */ @@ -66,7 +78,7 @@ public function next() { next($this->value); - $this->count --; + $this->count--; } /** diff --git a/lib/vendor/symfony/lib/form/sfForm.class.php b/lib/vendor/symfony/lib/form/sfForm.class.php index 6de3f2368..4381f6465 100644 --- a/lib/vendor/symfony/lib/form/sfForm.class.php +++ b/lib/vendor/symfony/lib/form/sfForm.class.php @@ -23,7 +23,7 @@ * @package symfony * @subpackage form * @author Fabien Potencier - * @version SVN: $Id: sfForm.class.php 24278 2009-11-23 15:21:09Z Kris.Wallsmith $ + * @version SVN: $Id: sfForm.class.php 27954 2010-02-12 16:12:44Z Kris.Wallsmith $ */ class sfForm implements ArrayAccess, Iterator, Countable { @@ -827,7 +827,7 @@ public function setDefaults($defaults) if ($this->isCSRFProtected()) { - $this->setDefault(self::$CSRFFieldName, $this->getCSRFToken(self::$CSRFSecret)); + $this->setDefault(self::$CSRFFieldName, $this->getCSRFToken($this->localCSRFSecret ? $this->localCSRFSecret : self::$CSRFSecret)); } $this->resetFormFields(); @@ -897,7 +897,7 @@ public function getCSRFToken($secret = null) { if (null === $secret) { - $secret = self::$CSRFSecret; + $secret = $this->localCSRFSecret ? $this->localCSRFSecret : self::$CSRFSecret; } return md5($secret.session_id().get_class($this)); @@ -938,7 +938,7 @@ static public function getCSRFFieldName() */ public function enableLocalCSRFProtection($secret = null) { - $this->localCSRFSecret = $secret; + $this->localCSRFSecret = null === $secret ? true : $secret; } /** diff --git a/lib/vendor/symfony/lib/generator/sfModelGenerator.class.php b/lib/vendor/symfony/lib/generator/sfModelGenerator.class.php index 1204d2d18..10d32e139 100644 --- a/lib/vendor/symfony/lib/generator/sfModelGenerator.class.php +++ b/lib/vendor/symfony/lib/generator/sfModelGenerator.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage generator * @author Fabien Potencier - * @version SVN: $Id: sfModelGenerator.class.php 23194 2009-10-19 16:37:13Z fabien $ + * @version SVN: $Id: sfModelGenerator.class.php 25459 2009-12-16 13:08:43Z fabien $ */ abstract class sfModelGenerator extends sfGenerator { @@ -267,7 +267,7 @@ public function renderField($field) } else if ($field->isPartial()) { - return sprintf("get_partial('%s', array('type' => 'list', '%s' => \$%s))", $field->getName(), $this->getSingularName(), $this->getSingularName()); + return sprintf("get_partial('%s/%s', array('type' => 'list', '%s' => \$%s))", $this->getModuleName(), $field->getName(), $this->getSingularName(), $this->getSingularName()); } else if ('Date' == $field->getType()) { diff --git a/lib/vendor/symfony/lib/helper/PartialHelper.php b/lib/vendor/symfony/lib/helper/PartialHelper.php index 848d825a6..e5aac3d3b 100644 --- a/lib/vendor/symfony/lib/helper/PartialHelper.php +++ b/lib/vendor/symfony/lib/helper/PartialHelper.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage helper * @author Fabien Potencier - * @version SVN: $Id: PartialHelper.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: PartialHelper.php 27755 2010-02-08 20:51:02Z Kris.Wallsmith $ */ /** @@ -138,7 +138,7 @@ function get_component($moduleName, $componentName, $vars = array()) $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; $view = new $class($context, $moduleName, $actionName, ''); - $view->setPartialVars($vars); + $view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars); if ($retval = $view->getCache()) { @@ -213,7 +213,7 @@ function get_partial($templateName, $vars = array()) $class = sfConfig::get('mod_'.strtolower($moduleName).'_partial_view_class', 'sf').'PartialView'; $view = new $class($context, $moduleName, $actionName, ''); - $view->setPartialVars($vars); + $view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars); return $view->render(); } diff --git a/lib/vendor/symfony/lib/helper/UrlHelper.php b/lib/vendor/symfony/lib/helper/UrlHelper.php index 4bd08e988..26544154f 100644 --- a/lib/vendor/symfony/lib/helper/UrlHelper.php +++ b/lib/vendor/symfony/lib/helper/UrlHelper.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage helper * @author Fabien Potencier - * @version SVN: $Id: UrlHelper.php 24466 2009-11-27 09:04:48Z fabien $ + * @version SVN: $Id: UrlHelper.php 27753 2010-02-08 19:24:39Z Kris.Wallsmith $ */ function link_to2($name, $routeName, $params, $options = array()) @@ -163,7 +163,7 @@ function link_to() { // for BC with 1.1 $arguments = func_get_args(); - if (empty($arguments[1]) || '@' == substr($arguments[1], 0, 1) || false !== strpos($arguments[1], '/')) + if (empty($arguments[1]) || is_array($arguments[1]) || '@' == substr($arguments[1], 0, 1) || false !== strpos($arguments[1], '/')) { return call_user_func_array('link_to1', $arguments); } @@ -177,7 +177,7 @@ function link_to() } } -function url_for_form(sfForm $form, $routePrefix) +function url_for_form(sfFormObject $form, $routePrefix) { $format = '%s/%s'; if ('@' == $routePrefix[0]) diff --git a/lib/vendor/symfony/lib/i18n/sfNumberFormat.class.php b/lib/vendor/symfony/lib/i18n/sfNumberFormat.class.php index ccc5aadbe..4310ae792 100644 --- a/lib/vendor/symfony/lib/i18n/sfNumberFormat.class.php +++ b/lib/vendor/symfony/lib/i18n/sfNumberFormat.class.php @@ -13,7 +13,7 @@ * {@link http://prado.sourceforge.net/} * * @author Wei Zhuo - * @version $Id: sfNumberFormat.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version $Id: sfNumberFormat.class.php 26681 2010-01-15 15:28:37Z fabien $ * @package symfony * @subpackage i18n */ @@ -171,13 +171,6 @@ protected function formatInteger($string) { $string = (string) $string; - $decimalDigits = $this->formatInfo->DecimalDigits; - // if not decimal digits, assume 0 decimal points. - if (is_int($decimalDigits) && $decimalDigits > 0) - { - $string = (string) intval(round(floatval($string), $decimalDigits)); - } - $dp = strpos($string, '.'); if (is_int($dp)) diff --git a/lib/vendor/symfony/lib/log/sfVarLogger.class.php b/lib/vendor/symfony/lib/log/sfVarLogger.class.php index 4d85a4574..5ea40d90f 100644 --- a/lib/vendor/symfony/lib/log/sfVarLogger.class.php +++ b/lib/vendor/symfony/lib/log/sfVarLogger.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage log * @author Fabien Potencier - * @version SVN: $Id: sfVarLogger.class.php 23922 2009-11-14 14:58:38Z fabien $ + * @version SVN: $Id: sfVarLogger.class.php 26989 2010-01-21 12:43:21Z FabianLange $ */ class sfVarLogger extends sfLogger { @@ -96,7 +96,7 @@ public function getPriorities() $priorities = array(); foreach ($this->logs as $log) { - if (!in_array($log['priority'], $types)) + if (!in_array($log['priority'], $priorities)) { $priorities[] = $log['priority']; } diff --git a/lib/vendor/symfony/lib/plugin/sfSymfonyPluginManager.class.php b/lib/vendor/symfony/lib/plugin/sfSymfonyPluginManager.class.php index 91e0ad0ea..ab89bf199 100644 --- a/lib/vendor/symfony/lib/plugin/sfSymfonyPluginManager.class.php +++ b/lib/vendor/symfony/lib/plugin/sfSymfonyPluginManager.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage plugin * @author Fabien Potencier - * @version SVN: $Id: sfSymfonyPluginManager.class.php 25051 2009-12-07 22:00:55Z Kris.Wallsmith $ + * @version SVN: $Id: sfSymfonyPluginManager.class.php 25218 2009-12-10 20:06:45Z Jonathan.Wage $ */ class sfSymfonyPluginManager extends sfPluginManager { @@ -132,7 +132,7 @@ static public function enablePlugin($plugin, $configDir) * @param string $plugin The name of the plugin * @param string $configDir The config directory */ - static protected function disablePlugin($plugin, $configDir) + static public function disablePlugin($plugin, $configDir) { if (!$configDir) { diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php index 9a7ede886..76dd1855c 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php @@ -5,6 +5,11 @@ protected function addSortQuery($query) return; } + if (!in_array(strtolower($sort[1]), array('asc', 'desc'))) + { + $sort[1] = 'asc'; + } + $query->addOrderBy($sort[0] . ' ' . $sort[1]); } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/i18n/sf_admin.tr.xml b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/i18n/sf_admin.tr.xml index 050c6bd36..4f8cef90f 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/i18n/sf_admin.tr.xml +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/i18n/sf_admin.tr.xml @@ -33,6 +33,18 @@ Cancel Vazgeç + + Choose an action + Bir Eylem Seç + + + go + devam + + + Back to list + Listeye geri dön + @@ -65,6 +77,10 @@ desc azalan + + [0] no result|[1] 1 result|(1,+Inf] %1% results + [0] kayıt yok|[1] 1 sonuç|(1,+Inf] %1% sonuçlar + @@ -115,21 +131,44 @@ You must select an action to execute on the selected items. - Seçilmiş kayıtlar üzerinde çalıştırılmak üzere bir eylem seçmelisiniz. + Seçilen kayıtlar üzerinde çalıştırılmak üzere bir eylem seçmelisiniz. A problem occurs when deleting the selected items as some items do not exist anymore. - Seçilmiş kayıtlar silinirken bir sorun oluştu, bazı kayıtlar artık bulunmuyor. + Seçilen kayıtlar silinirken bir sorun oluştu, bazı kayıtlar artık bulunmuyor. The selected items have been deleted successfully. - Seçilmiş kayıtlar başarıyla silindi. + Seçilen kayıtlar başarıyla silindi. A problem occurs when deleting the selected items. - Seçilmiş kayıtlar silinirken bir sorun oluştu. + Seçilen kayıtlar silinirken bir sorun oluştu. + + + is empty + boş mu? + + + yes or no + evet ya da hayır + + + yes + evet + + + no + hayır + + + + + + + to %to_date%]]> + %to_date% arası]]> - diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php index 5c2b36630..95c9bd3ab 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/debug/sfWebDebugPanelDoctrine.class.php @@ -16,7 +16,7 @@ * @subpackage debug * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfWebDebugPanelDoctrine.class.php 24993 2009-12-06 20:56:49Z Kris.Wallsmith $ + * @version SVN: $Id: sfWebDebugPanelDoctrine.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $ */ class sfWebDebugPanelDoctrine extends sfWebDebugPanel { @@ -142,11 +142,11 @@ protected function getSqlLogs() } $html[] = sprintf(' -
  • +

    %s

    %ss, "%s" connection%s
  • ', - $event->slowQuery ? 'sfWebDebugWarning' : '', + $event->slowQuery ? ' class="sfWebDebugWarning"' : '', $query, number_format($event->getElapsedSecs(), 2), $conn->getName(), diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php index e393393a6..743bc8904 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormDoctrine.class.php @@ -18,7 +18,7 @@ * @subpackage form * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfFormDoctrine.class.php 24971 2009-12-05 15:05:03Z Kris.Wallsmith $ + * @version SVN: $Id: sfFormDoctrine.class.php 27915 2010-02-11 18:12:56Z Kris.Wallsmith $ */ abstract class sfFormDoctrine extends sfFormObject { @@ -227,17 +227,18 @@ public function getI18nFormClass() */ protected function updateDefaultsFromObject() { + $defaults = $this->getDefaults(); + // update defaults for the main object if ($this->isNew()) { - $this->setDefaults(array_merge($this->getObject()->toArray(false), $this->getDefaults())); + $defaults = $defaults + $this->getObject()->toArray(false); } else { - $this->setDefaults(array_merge($this->getDefaults(), $this->getObject()->toArray(false))); + $defaults = $this->getObject()->toArray(false) + $defaults; } - $defaults = $this->getDefaults(); foreach ($this->embeddedForms as $name => $form) { if ($form instanceof sfFormDoctrine) @@ -246,6 +247,7 @@ protected function updateDefaultsFromObject() $defaults[$name] = $form->getDefaults(); } } + $this->setDefaults($defaults); } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php index 13a696293..3c79bace7 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/form/sfFormFilterDoctrine.class.php @@ -21,7 +21,7 @@ * @subpackage form * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfFormFilterDoctrine.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfFormFilterDoctrine.class.php 27748 2010-02-08 18:18:44Z Kris.Wallsmith $ */ abstract class sfFormFilterDoctrine extends sfFormFilter { @@ -243,7 +243,7 @@ protected function addNumberQuery(Doctrine_Query $query, $field, $values) { $query->addWhere(sprintf('%s.%s IS NULL', $query->getRootAlias(), $fieldName)); } - else if (is_array($values) && isset($values['text']) && '' != $values['text']) + else if (is_array($values) && isset($values['text']) && '' !== $values['text']) { $query->addWhere(sprintf('%s.%s = ?', $query->getRootAlias(), $fieldName), $values['text']); } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormFilterGenerator.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormFilterGenerator.class.php index 30a40fd90..2a7cf8a15 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormFilterGenerator.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormFilterGenerator.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage generator * @author Fabien Potencier - * @version SVN: $Id: sfDoctrineFormFilterGenerator.class.php 24294 2009-11-23 21:45:03Z Jonathan.Wage $ + * @version SVN: $Id: sfDoctrineFormFilterGenerator.class.php 27842 2010-02-10 19:42:03Z Kris.Wallsmith $ */ class sfDoctrineFormFilterGenerator extends sfDoctrineFormGenerator { @@ -253,7 +253,7 @@ public function getValidatorOptionsForColumn($column) } else if ($column->isPrimaryKey()) { - $options[] = sprintf('\'model\' => \'%s\', \'column\' => \'%s\'', $this->table->getOption('name'), $this->table->getFieldName($columnName)); + $options[] = sprintf('\'model\' => \'%s\', \'column\' => \'%s\'', $this->table->getOption('name'), $column->getFieldName()); } else { diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php index 4f4ef8f45..866c2efc9 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php @@ -18,7 +18,7 @@ * @subpackage generator * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfDoctrineFormGenerator.class.php 24294 2009-11-23 21:45:03Z Jonathan.Wage $ + * @version SVN: $Id: sfDoctrineFormGenerator.class.php 27842 2010-02-10 19:42:03Z Kris.Wallsmith $ */ class sfDoctrineFormGenerator extends sfGenerator { @@ -331,8 +331,9 @@ public function getWidgetClassForColumn($column) /** * Returns a PHP string representing options to pass to a widget for a given column. * - * @param sfDoctrineColumn $column - * @return string The options to pass to the widget as a PHP string + * @param sfDoctrineColumn $column + * + * @return string The options to pass to the widget as a PHP string */ public function getWidgetOptionsForColumn($column) { @@ -342,16 +343,9 @@ public function getWidgetOptionsForColumn($column) { $options[] = sprintf('\'model\' => $this->getRelatedModelName(\'%s\'), \'add_empty\' => %s', $column->getRelationKey('alias'), $column->isNotNull() ? 'false' : 'true'); } - else + else if ('enum' == $column->getDoctrineType() && is_subclass_of($this->getWidgetClassForColumn($column), 'sfWidgetFormChoiceBase')) { - switch ($column->getDoctrineType()) - { - case 'enum': - $values = $column->getDefinitionKey('values'); - $values = array_combine($values, $values); - $options[] = "'choices' => " . str_replace("\n", '', $this->arrayExport($values)); - break; - } + $options[] = '\'choices\' => '.$this->arrayExport(array_combine($column['values'], $column['values'])); } return count($options) ? sprintf('array(%s)', implode(', ', $options)) : ''; @@ -435,7 +429,7 @@ public function getValidatorOptionsForColumn($column) } else if ($column->isPrimaryKey()) { - $options[] = sprintf('\'model\' => $this->getModelName(), \'column\' => \'%s\'', $column->getName()); + $options[] = sprintf('\'model\' => $this->getModelName(), \'column\' => \'%s\'', $column->getFieldName()); } else { @@ -456,8 +450,7 @@ public function getValidatorOptionsForColumn($column) } break; case 'enum': - $values = array_combine($column['values'], $column['values']); - $options[] = "'choices' => " . str_replace("\n", '', $this->arrayExport($values)); + $options[] = '\'choices\' => '.$this->arrayExport($column['values']); break; } } @@ -573,7 +566,7 @@ public function getUniqueColumnNames() { if ($column->getDefinitionKey('unique')) { - $uniqueColumns[] = array($column->getName()); + $uniqueColumns[] = array($column->getFieldName()); } } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/pager/sfDoctrinePager.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/pager/sfDoctrinePager.class.php index 926055ad8..cfc5c0b54 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/pager/sfDoctrinePager.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/pager/sfDoctrinePager.class.php @@ -15,7 +15,7 @@ * @package sfDoctrinePlugin * @subpackage pager * @author Jonathan H. Wage - * @version SVN: $Id: sfDoctrinePager.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfDoctrinePager.class.php 27747 2010-02-08 18:02:19Z Kris.Wallsmith $ */ class sfDoctrinePager extends sfPager implements Serializable { @@ -93,7 +93,7 @@ public function getCountQuery() */ public function init() { - $this->results = null; + $this->resetIterator(); $countQuery = $this->getCountQuery(); $count = $countQuery->count(); @@ -185,4 +185,17 @@ public function getResults($hydrationMode = null) { return $this->getQuery()->execute(array(), $hydrationMode); } + + /** + * @see sfPager + */ + protected function initializeIterator() + { + parent::initializeIterator(); + + if ($this->results instanceof Doctrine_Collection) + { + $this->results = $this->results->getData(); + } + } } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineInsertSqlTask.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineInsertSqlTask.class.php index 4694cbaa9..da2377185 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineInsertSqlTask.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineInsertSqlTask.class.php @@ -18,7 +18,7 @@ * @subpackage doctrine * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfDoctrineInsertSqlTask.class.php 23922 2009-11-14 14:58:38Z fabien $ + * @version SVN: $Id: sfDoctrineInsertSqlTask.class.php 27942 2010-02-12 14:05:53Z Kris.Wallsmith $ */ class sfDoctrineInsertSqlTask extends sfDoctrineBaseTask { @@ -51,12 +51,14 @@ protected function configure() */ protected function execute($arguments = array(), $options = array()) { - $this->logSection('doctrine', 'created tables successfully'); + $this->logSection('doctrine', 'creating tables'); $databaseManager = new sfDatabaseManager($this->configuration); $config = $this->getCliConfig(); Doctrine_Core::loadModels($config['models_path'], Doctrine_Core::MODEL_LOADING_CONSERVATIVE); Doctrine_Core::createTablesFromArray(Doctrine_Core::getLoadedModels()); + + $this->logSection('doctrine', 'created tables successfully'); } } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/validator/sfValidatorDoctrineChoice.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/validator/sfValidatorDoctrineChoice.class.php index 1b2d7ecba..d9210f6b1 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/validator/sfValidatorDoctrineChoice.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/validator/sfValidatorDoctrineChoice.class.php @@ -16,7 +16,7 @@ * @subpackage doctrine * @author Fabien Potencier * @author Jonathan H. Wage - * @version SVN: $Id: sfValidatorDoctrineChoice.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfValidatorDoctrineChoice.class.php 27736 2010-02-08 14:50:13Z Kris.Wallsmith $ */ class sfValidatorDoctrineChoice extends sfValidatorBase { @@ -53,6 +53,15 @@ protected function configure($options = array(), $messages = array()) */ protected function doClean($value) { + if ($query = $this->getOption('query')) + { + $query = clone $query; + } + else + { + $query = Doctrine_Core::getTable($this->getOption('model'))->createQuery(); + } + if ($this->getOption('multiple')) { if (!is_array($value)) @@ -77,10 +86,6 @@ protected function doClean($value) throw new sfValidatorError($this, 'max', array('count' => $count, 'max' => $this->getOption('max'))); } - if (!$query = $this->getOption('query')) - { - $query = Doctrine_Core::getTable($this->getOption('model'))->createQuery(); - } $query->andWhereIn(sprintf('%s.%s', $query->getRootAlias(), $this->getColumn()), $value); if ($query->count() != count($value)) @@ -90,10 +95,6 @@ protected function doClean($value) } else { - if (!$query = $this->getOption('query')) - { - $query = Doctrine_Core::getTable($this->getOption('model'))->createQuery(); - } $query->andWhere(sprintf('%s.%s = ?', $query->getRootAlias(), $this->getColumn()), $value); if (!$query->count()) diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlInline.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlInline.php index 5572f9ec1..9b1950300 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlInline.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlInline.php @@ -89,7 +89,7 @@ static public function dump($value) return is_infinite($value) ? str_ireplace('INF', '.Inf', strval($value)) : (is_string($value) ? "'$value'" : $value); case false !== strpos($value, "\n") || false !== strpos($value, "\r"): return sprintf('"%s"', str_replace(array('"', "\n", "\r"), array('\\"', '\n', '\r'), $value)); - case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \#] | \A[ - ? | < > = ! % @ ]/x', $value): + case preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ - ? | < > = ! % @ ` ]/x', $value): return sprintf("'%s'", str_replace('\'', '\'\'', $value)); case '' == $value: return "''"; diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlParser.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlParser.php index 914dcb82f..b97db15d2 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlParser.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Parser/sfYaml/sfYamlParser.php @@ -26,7 +26,6 @@ class sfYamlParser { protected - $value = '', $offset = 0, $lines = array(), $currentLineNb = -1, @@ -54,10 +53,9 @@ public function __construct($offset = 0) */ public function parse($value) { - $this->value = $this->cleanup($value); $this->currentLineNb = -1; $this->currentLine = ''; - $this->lines = explode("\n", $this->value); + $this->lines = explode("\n", $this->cleanup($value)); $data = array(); while ($this->moveToNextLine()) @@ -74,7 +72,7 @@ public function parse($value) } $isRef = $isInPlace = $isProcessed = false; - if (preg_match('#^\-(\s+(?P.+?))?\s*$#', $this->currentLine, $values)) + if (preg_match('#^\-((?P\s+)(?P.+?))?\s*$#', $this->currentLine, $values)) { if (isset($values['value']) && preg_match('#^&(?P[^ ]+) *(?P.*)#', $values['value'], $matches)) { @@ -96,13 +94,30 @@ public function parse($value) { $data[] = array($matches[1] => sfYamlInline::load($matches[2])); } + elseif (isset($values['leadspaces']) + && ' ' == $values['leadspaces'] + && preg_match('#^(?P'.sfYamlInline::REGEX_QUOTED_STRING.'|[^ \'"\{].*?) *\:(\s+(?P.+?))?\s*$#', $values['value'], $matches)) + { + // this is a compact notation element, add to next block and parse + $c = $this->getRealCurrentLineNb(); + $parser = new sfYamlParser($c); + $parser->refs =& $this->refs; + + $block = $values['value']; + if (!$this->isNextLineIndented()) + { + $block .= "\n".$this->getNextEmbedBlock(); + } + + $data[] = $parser->parse($block); + } else { $data[] = $this->parseValue($values['value']); } } } - else if (preg_match('#^(?P'.sfYamlInline::REGEX_QUOTED_STRING.'|[^ ].*?) *\:(\s+(?P.+?))?\s*$#', $this->currentLine, $values)) + else if (preg_match('#^(?P'.sfYamlInline::REGEX_QUOTED_STRING.'|[^ \'"].*?) *\:(\s+(?P.+?))?\s*$#', $this->currentLine, $values)) { $key = sfYamlInline::parseScalar($values['key']); @@ -198,8 +213,8 @@ public function parse($value) } else { - // one liner? - if (1 == count(explode("\n", rtrim($this->value, "\n")))) + // 1-liner followed by newline + if (2 == count($this->lines) && empty($this->lines[1])) { $value = sfYamlInline::load($this->lines[0]); if (is_array($value)) @@ -556,10 +571,18 @@ protected function cleanup($value) } // strip YAML header - preg_replace('#^\%YAML[: ][\d\.]+.*\n#s', '', $value); + $count = 0; + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#s', '', $value, -1, $count); + $this->offset += $count; - // remove --- - $value = preg_replace('#^\-\-\-.*?\n#s', '', $value); + // remove leading comments and/or --- + $trimmedValue = preg_replace('#^((\#.*?\n)|(\-\-\-.*?\n))*#s', '', $value, -1, $count); + if ($count == 1) + { + // items have been removed, update the offset + $this->offset += substr_count($value, "\n") - substr_count($trimmedValue, "\n"); + $value = $trimmedValue; + } return $value; } diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/AdminGenBrowser.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/AdminGenBrowser.class.php index 84fc73880..f3a12c0a4 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/AdminGenBrowser.class.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/AdminGenBrowser.class.php @@ -28,6 +28,71 @@ public function runTests() } } + protected function _testValidSort() + { + $this->info('Test valid sort parameter'); + + $this->get('/users?sort=username'); + + $matches = 0; + foreach ($this->_getQueryExecutionEvents() as $event) + { + if (false !== strpos($event->getQuery(), 'ORDER BY u.username asc')) + { + ++$matches; + } + } + + $this->test()->is($matches, 1); + } + + protected function _testInvalidSort() + { + $this->info('Test invalid sort parameter'); + + $this->get('/users?sort=INVALID'); + + // there should be no queries that match "INVALID" + foreach ($this->_getQueryExecutionEvents() as $event) + { + $this->test()->unlike($event->getQuery(), '/INVALID/'); + } + } + + protected function _testValidSortType() + { + $this->info('Test valid sort_type parameter'); + + foreach (array('asc', 'desc', 'ASC', 'DESC') as $sortType) + { + $this->get('/users?sort=username&sort_type='.$sortType); + + $matches = 0; + foreach ($this->_getQueryExecutionEvents() as $event) + { + if (false !== strpos($event->getQuery(), 'ORDER BY u.username '.$sortType)) + { + ++$matches; + } + } + + $this->test()->is($matches, 1); + } + } + + protected function _testInvalidSortType() + { + $this->info('Test invalid sort_type parameter'); + + $this->get('/users?sort=username&sort_type=INVALID'); + + // there should be no queries that match "INVALID" + foreach ($this->_getQueryExecutionEvents() as $event) + { + $this->test()->unlike($event->getQuery(), '/INVALID/'); + } + } + protected function _testSanityCheck() { $this->info('Admin Generator Sanity Checks'); @@ -202,6 +267,28 @@ protected function _cleanupAdminGenModules() $fs->execute('rm -rf ' . sfConfig::get('sf_data_dir') . '/*.sqlite'); } + protected function _getQueryExecutionEvents() + { + $events = array(); + + $databaseManager = $this->browser->getContext()->getDatabaseManager(); + foreach ($databaseManager->getNames() as $name) + { + $database = $databaseManager->getDatabase($name); + if ($database instanceof sfDoctrineDatabase && $profiler = $database->getProfiler()) + { + foreach ($profiler->getQueryExecutionEvents() as $event) + { + $events[$event->getSequence()] = $event; + } + } + } + + ksort($events); + + return array_values($events); + } + public function __destruct() { $this->_cleanupAdminGenModules(); diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/FormGeneratorTest.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/FormGeneratorTest.php index 2e83d72be..aaad73dc2 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/FormGeneratorTest.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/FormGeneratorTest.php @@ -12,7 +12,7 @@ $fixtures = 'fixtures'; require_once(dirname(__FILE__).'/../bootstrap/functional.php'); -$t = new lime_test(40); +$t = new lime_test(41); $t->diag("Test that these models don't generate forms or filters classes"); $noFormsOrFilters = array('UserGroup', 'UserPermission', 'GroupPermission'); @@ -82,3 +82,15 @@ $test = new BlogArticleFormFilter(); $t->is($test->getWidget('author_id')->getOption('model'), 'BlogAuthor'); $t->is($test->getValidator('author_id')->getOption('model'), 'BlogAuthor'); + +$t->diag('Check enum primary keys'); +try +{ + $test = new ResourceTypeForm(); + $t->pass('enum primary key widgets work'); +} +catch (InvalidArgumentException $e) +{ + $t->fail('enum primary key widgets work'); + $t->diag(' '.$e->getMessage()); +} diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/PagerTest.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/PagerTest.php index 643e5bafd..36e5472c0 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/PagerTest.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/PagerTest.php @@ -11,7 +11,7 @@ $app = 'frontend'; require_once(dirname(__FILE__).'/../bootstrap/functional.php'); -$t = new lime_test(13); +$t = new lime_test(23); $total = 50; for ($i = 0; $i < $total; $i++) @@ -62,10 +62,19 @@ $t->is($pager->getQuery()->getSqlQuery(), 'SELECT a.id AS a__id, a.name AS a__name, a.type AS a__type FROM author a WHERE (a.id < 9999999 AND a.id > 0) LIMIT 25'); - $pager = new sfDoctrinePager('Author', $numPerPage); $pager->setQuery(Doctrine_Query::create()->from('Author a')->where('a.id < 9999999')); $pager->setPage(1); $pager->init(); $t->is($pager->getQuery()->getSqlQuery(), 'SELECT a.id AS a__id, a.name AS a__name, a.type AS a__type FROM author a WHERE (a.id < 9999999) LIMIT 25'); + +// pager interface +$t->diag('iterator interface'); + +$pager = new sfDoctrinePager('Author', 10); +$pager->init(); +foreach ($pager as $author) +{ + $t->isa_ok($author, 'Author'); +} diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/config/doctrine/schema.yml b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/config/doctrine/schema.yml index f59cbf627..5204f51fa 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/config/doctrine/schema.yml +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/config/doctrine/schema.yml @@ -209,4 +209,12 @@ ModelWithNumberInColumn: columns: column_1: string(255) column2: string(255) - column__3: string(255) \ No newline at end of file + column__3: string(255) + +ResourceType: + columns: + id: + type: enum + values: [type1, type2, type3] + primary: true + name: string(255) diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/data/sql/schema.sql b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/data/sql/schema.sql index 73e374cd7..4c3023a16 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/data/sql/schema.sql +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/data/sql/schema.sql @@ -13,6 +13,7 @@ CREATE TABLE model_from_linked_schema (id INTEGER PRIMARY KEY AUTOINCREMENT, nam CREATE TABLE model_with_number_in_column (id INTEGER PRIMARY KEY AUTOINCREMENT, column_1 VARCHAR(255), column2 VARCHAR(255), column__3 VARCHAR(255)); CREATE TABLE permission (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(255)); CREATE TABLE profile (id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER, first_name VARCHAR(255), last_name VARCHAR(255)); +CREATE TABLE resource_type (id VARCHAR(255), name VARCHAR(255), PRIMARY KEY(id)); CREATE TABLE unique_test (id INTEGER PRIMARY KEY AUTOINCREMENT, unique_test1 VARCHAR(255) UNIQUE, unique_test2 VARCHAR(255), unique_test3 VARCHAR(255), unique_test4 VARCHAR(255)); CREATE TABLE user (id INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(255) UNIQUE, password VARCHAR(255), test VARCHAR(255)); CREATE TABLE user_group (user_id INTEGER, group_id INTEGER, PRIMARY KEY(user_id, group_id)); diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/filter/doctrine/ResourceTypeFormFilter.class.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/filter/doctrine/ResourceTypeFormFilter.class.php new file mode 100644 index 000000000..7bc61f84f --- /dev/null +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/filter/doctrine/ResourceTypeFormFilter.class.php @@ -0,0 +1,16 @@ +__construct() +$t->diag('->__construct()'); + +class NumericFieldForm extends ArticleForm +{ + public function configure() + { + $this->widgetSchema[1] = new sfWidgetFormInputText(); + $this->validatorSchema[1] = new sfValidatorPass(); + $this->setDefault(1, '==DEFAULT_VALUE=='); + } +} + +$form = new NumericFieldForm(); +$defaults = $form->getDefaults(); +$t->is($defaults[1], '==DEFAULT_VALUE==', '->__construct() allows ->configure() to set defaults on numeric fields'); + +class DefaultValuesForm extends AuthorForm +{ + public function configure() + { + $this->setDefault('name', 'John Doe'); + } +} + +$author = new Author(); +$form = new DefaultValuesForm($author); +$t->is($form->getDefault('name'), 'John Doe', '->__construct() uses form defaults for new objects'); + +$author = new Author(); +$author->name = 'Jacques Doe'; +$author->save(); +$form = new DefaultValuesForm($author); +$t->is($form->getDefault('name'), 'Jacques Doe', '->__construct() uses object value as a default for existing objects'); +$author->delete(); // ->embedRelation() $t->diag('->embedRelation()'); diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/form/sfFormFilterDoctrineTest.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/form/sfFormFilterDoctrineTest.php index d854ce183..2401aec05 100644 --- a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/form/sfFormFilterDoctrineTest.php +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/form/sfFormFilterDoctrineTest.php @@ -3,7 +3,7 @@ $app = 'frontend'; include dirname(__FILE__).'/../../bootstrap/functional.php'; -$t = new lime_test(10); +$t = new lime_test(12); class TestFormFilter extends ArticleFormFilter { @@ -15,12 +15,14 @@ public function configure() 'name' => new sfWidgetFormInputText(), 'nomethod_bc' => new sfWidgetFormInputText(), 'nomethod' => new sfWidgetFormInputText(), + 'author_id' => new sfWidgetFormInputText(), )); $this->setValidators(array( 'name' => new sfValidatorPass(), 'nomethod_bc' => new sfValidatorPass(), 'nomethod' => new sfValidatorPass(), + 'author_id' => new sfValidatorPass(), )); } @@ -34,6 +36,7 @@ public function getFields() return array_merge(parent::getFields(), array( 'body' => 'Invalid', 'nomethod_bc' => 'Text', + 'author_id' => 'Number', )); } } @@ -96,6 +99,13 @@ public function getFields() $filter->getQuery(); $t->is_deeply($filter->processedFields, array('name'), '->getQuery() processes fields not specified in getFields()'); +// pass 0 to number filter +$filter = new TestFormFilter(); +$filter->bind(array('author_id' => array('text' => 0))); +$query = $filter->getQuery(); +$t->is(trim($query->getDql()), 'FROM Article r WHERE r.author_id = ?', '->getQuery() filters by a 0 number'); +$t->is($query->getFlattenedParams(), array(0), '->getQuery() filters by a 0 number'); + $t->diag('->setTableMethod()'); $filter = new ArticleFormFilter(); diff --git a/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/validator/sfValidatorDoctrineChoiceTest.php b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/validator/sfValidatorDoctrineChoiceTest.php new file mode 100644 index 000000000..765719590 --- /dev/null +++ b/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/test/unit/validator/sfValidatorDoctrineChoiceTest.php @@ -0,0 +1,18 @@ +clean() +$t->diag('->clean()'); + +$query = Doctrine_Core::getTable('Author')->createQuery(); +$validator = new sfValidatorDoctrineChoice(array('model' => 'Author', 'query' => $query)); + +$author = Doctrine_Core::getTable('Author')->createQuery()->limit(1)->fetchOne(); +$validator->clean($author->id); + +$t->is(trim($query->getDql()), 'FROM Author', '->clean() does not change the supplied query object'); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php index 7a954a212..594d8503c 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormBaseTemplate.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage form * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormBaseTemplate.php 9304 2008-05-27 03:49:32Z dwhittle $ */ abstract class BaseFormPropel extends sfFormPropel { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php index 89e8a9bb6..d5c347a66 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormGeneratedTemplate.php @@ -8,7 +8,6 @@ * @package ##PROJECT_NAME## * @subpackage form * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $ */ abstract class Basetable->getClassname() ?>Form extends BaseFormPropel { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormTemplate.php index 823fc1b8d..346d19f76 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelForm/default/template/sfPropelFormTemplate.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage form * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $ */ class table->getClassname() ?>Form extends Basetable->getClassname() ?>Form { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterBaseTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterBaseTemplate.php index 670909be2..95c54f812 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterBaseTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterBaseTemplate.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage filter * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormFilterBaseTemplate.php 11675 2008-09-19 15:21:38Z fabien $ */ abstract class BaseFormFilterPropel extends sfFormFilterPropel { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterGeneratedTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterGeneratedTemplate.php index 49701e6b2..1cddbbba5 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterGeneratedTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterGeneratedTemplate.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage filter * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $ */ abstract class Basetable->getClassname() ?>FormFilter extends BaseFormFilterPropel { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterTemplate.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterTemplate.php index 31b904edb..aef7e1cfa 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterTemplate.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelFormFilter/default/template/sfPropelFormFilterTemplate.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage filter * @author ##AUTHOR_NAME## - * @version SVN: $Id: sfPropelFormFilterTemplate.php 11675 2008-09-19 15:21:38Z fabien $ */ class table->getClassname() ?>FormFilter extends Basetable->getClassname() ?>FormFilter { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/actions/actions.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/actions/actions.class.php index 50799b92f..eb636cd4a 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/actions/actions.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/actions/actions.class.php @@ -9,7 +9,6 @@ * @package ##PROJECT_NAME## * @subpackage getModuleName()."\n" ?> * @author ##AUTHOR_NAME## - * @version SVN: $Id: actions.class.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $ */ abstract class getGeneratedModuleName() ?>Actions extends getActionsBaseClass()."\n" ?> { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/lib/helper.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/lib/helper.php index b41f2b5f4..290124bed 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/lib/helper.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/admin/template/lib/helper.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage getModuleName()."\n" ?> * @author ##AUTHOR_NAME## - * @version SVN: $Id: helper.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $ */ abstract class BasegetModuleName()) ?>GeneratorHelper extends sfModelGeneratorHelper { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/default/template/actions/actions.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/default/template/actions/actions.class.php index 849efe54e..e6ac77eaf 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/default/template/actions/actions.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/data/generator/sfPropelModule/default/template/actions/actions.class.php @@ -6,7 +6,6 @@ * @package ##PROJECT_NAME## * @subpackage getModuleName()."\n" ?> * @author ##AUTHOR_NAME## - * @version SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ */ class getGeneratedModuleName() ?>Actions extends getActionsBaseClass() ?> diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/i18n/sf_admin.tr.xml b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/i18n/sf_admin.tr.xml index 050c6bd36..4f8cef90f 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/i18n/sf_admin.tr.xml +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/i18n/sf_admin.tr.xml @@ -33,6 +33,18 @@ Cancel Vazgeç + + Choose an action + Bir Eylem Seç + + + go + devam + + + Back to list + Listeye geri dön + @@ -65,6 +77,10 @@ desc azalan + + [0] no result|[1] 1 result|(1,+Inf] %1% results + [0] kayıt yok|[1] 1 sonuç|(1,+Inf] %1% sonuçlar + @@ -115,21 +131,44 @@ You must select an action to execute on the selected items. - Seçilmiş kayıtlar üzerinde çalıştırılmak üzere bir eylem seçmelisiniz. + Seçilen kayıtlar üzerinde çalıştırılmak üzere bir eylem seçmelisiniz. A problem occurs when deleting the selected items as some items do not exist anymore. - Seçilmiş kayıtlar silinirken bir sorun oluştu, bazı kayıtlar artık bulunmuyor. + Seçilen kayıtlar silinirken bir sorun oluştu, bazı kayıtlar artık bulunmuyor. The selected items have been deleted successfully. - Seçilmiş kayıtlar başarıyla silindi. + Seçilen kayıtlar başarıyla silindi. A problem occurs when deleting the selected items. - Seçilmiş kayıtlar silinirken bir sorun oluştu. + Seçilen kayıtlar silinirken bir sorun oluştu. + + + is empty + boş mu? + + + yes or no + evet ya da hayır + + + yes + evet + + + no + hayır + + + + + + + to %to_date%]]> + %to_date% arası]]> - diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/addon/sfPropelPager.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/addon/sfPropelPager.class.php index d5fdc6cf6..b6110c7c6 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/addon/sfPropelPager.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/addon/sfPropelPager.class.php @@ -15,7 +15,7 @@ * @package sfPropelPlugin * @subpackage addon * @author Fabien Potencier - * @version SVN: $Id: sfPropelPager.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfPropelPager.class.php 27747 2010-02-08 18:02:19Z Kris.Wallsmith $ */ class sfPropelPager extends sfPager { @@ -42,7 +42,7 @@ public function __construct($class, $maxPerPage = 10) */ public function init() { - $this->results = null; + $this->resetIterator(); $hasMaxRecordLimit = ($this->getMaxRecordLimit() !== false); $maxRecordLimit = $this->getMaxRecordLimit(); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/debug/sfWebDebugPanelPropel.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/debug/sfWebDebugPanelPropel.class.php index bb4122106..1065ca2c4 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/debug/sfWebDebugPanelPropel.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/debug/sfWebDebugPanelPropel.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage debug * @author Fabien Potencier - * @version SVN: $Id: sfWebDebugPanelPropel.class.php 24993 2009-12-06 20:56:49Z Kris.Wallsmith $ + * @version SVN: $Id: sfWebDebugPanelPropel.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $ */ class sfWebDebugPanelPropel extends sfWebDebugPanel { @@ -120,11 +120,11 @@ protected function getSqlLogs() $backtrace = isset($log['debug_backtrace']) && count($log['debug_backtrace']) ? ' '.$this->getToggleableDebugStack($log['debug_backtrace']) : ''; $html[] = sprintf(' -
  • +

    %s

    %s%s
  • ', - $slowQuery ? 'sfWebDebugWarning' : '', + $slowQuery ? ' class="sfWebDebugWarning"' : '', $query, implode(', ', $details), $backtrace diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormFilterPropel.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormFilterPropel.class.php index bc31f04e9..4c5189cd8 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormFilterPropel.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormFilterPropel.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage form * @author Fabien Potencier - * @version SVN: $Id: sfFormFilterPropel.class.php 23018 2009-10-13 22:44:18Z Kris.Wallsmith $ + * @version SVN: $Id: sfFormFilterPropel.class.php 27748 2010-02-08 18:18:44Z Kris.Wallsmith $ */ abstract class sfFormFilterPropel extends sfFormFilter { @@ -213,7 +213,7 @@ protected function addNumberCriteria(Criteria $criteria, $field, $values) $criterion->addOr($criteria->getNewCriterion($colname, null, Criteria::ISNULL)); $criteria->add($criterion); } - else if (is_array($values) && isset($values['text']) && '' != $values['text']) + else if (is_array($values) && isset($values['text']) && '' !== $values['text']) { $criteria->add($colname, $values['text']); } diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormPropel.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormPropel.class.php index 4fc7f77bb..125c1ce86 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormPropel.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/form/sfFormPropel.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage form * @author Fabien Potencier - * @version SVN: $Id: sfFormPropel.class.php 24068 2009-11-17 06:39:35Z Kris.Wallsmith $ + * @version SVN: $Id: sfFormPropel.class.php 27915 2010-02-11 18:12:56Z Kris.Wallsmith $ */ abstract class sfFormPropel extends sfFormObject { @@ -191,11 +191,11 @@ protected function updateDefaultsFromObject() // update defaults for the main object if ($this->isNew()) { - $this->setDefaults(array_merge($this->getObject()->toArray(BasePeer::TYPE_FIELDNAME), $this->getDefaults())); + $this->setDefaults($this->getDefaults() + $this->getObject()->toArray(BasePeer::TYPE_FIELDNAME)); } else { - $this->setDefaults(array_merge($this->getDefaults(), $this->getObject()->toArray(BasePeer::TYPE_FIELDNAME))); + $this->setDefaults($this->getObject()->toArray(BasePeer::TYPE_FIELDNAME) + $this->getDefaults()); } } diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/validator/sfValidatorPropelUnique.class.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/validator/sfValidatorPropelUnique.class.php index 8d5294461..b68b8b24b 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/validator/sfValidatorPropelUnique.class.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/validator/sfValidatorPropelUnique.class.php @@ -18,7 +18,7 @@ * @package symfony * @subpackage validator * @author Fabien Potencier - * @version SVN: $Id: sfValidatorPropelUnique.class.php 21908 2009-09-11 12:06:21Z fabien $ + * @version SVN: $Id: sfValidatorPropelUnique.class.php 27940 2010-02-12 13:31:30Z Kris.Wallsmith $ */ class sfValidatorPropelUnique extends sfValidatorSchema { @@ -42,7 +42,7 @@ public function __construct($options = array(), $messages = array()) * * * model: The model class (required) * * column: The unique column name in Propel field name format (required) - * If the uniquess is for several columns, you can pass an array of field names + * If the uniqueness is for several columns, you can pass an array of field names * * field Field name used by the form, other than the column name * * primary_key: The primary key column name in Propel field name format (optional, will be introspected if not provided) * You can also pass an array if the table has several primary keys @@ -77,6 +77,7 @@ protected function doClean($values) { $this->setOption('column', array($this->getOption('column'))); } + $columns = $this->getOption('column'); if (!is_array($field = $this->getOption('field'))) { @@ -85,12 +86,12 @@ protected function doClean($values) $fields = $this->getOption('field'); $criteria = new Criteria(); - foreach ($this->getOption('column') as $i => $column) + foreach ($columns as $i => $column) { $name = isset($fields[$i]) ? $fields[$i] : $column; if (!array_key_exists($name, $values)) { - // one of the column has be removed from the form + // one of the columns has be removed from the form return $values; } @@ -114,9 +115,7 @@ protected function doClean($values) throw $error; } - $columns = $this->getOption('column'); - - throw new sfValidatorErrorSchema($this, array($columns[0] => $error)); + throw new sfValidatorErrorSchema($this, array(isset($fields[0]) ? $fields[0] : $columns[0] => $error)); } /** diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/AlternativeCodingStandardsBehavior.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/AlternativeCodingStandardsBehavior.php index e09c8458d..aaa9863a4 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/AlternativeCodingStandardsBehavior.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/AlternativeCodingStandardsBehavior.php @@ -52,10 +52,10 @@ class AlternativeCodingStandardsBehavior extends Behavior { // default parameters value protected $parameters = array( - 'brackets_newline' => 'true', + 'brackets_newline' => 'true', 'remove_closing_comments' => 'true', - 'use_whitespace' => 'true', - 'tab_size' => 2, + 'use_whitespace' => 'true', + 'tab_size' => 2, 'strip_comments' => 'false' ); @@ -93,8 +93,11 @@ protected function filter(&$script) { $filter = array(); if($this->getParameter('brackets_newline') == 'true') { - $filter['#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m'] = "$1}\n$1$2$3\n$1{"; - $filter['#^(\t*)(\w.*)\h\{$#m'] = "$1$2\n$1{"; + $filter['#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m'] = "$1} +$1$2$3 +$1{"; + $filter['#^(\t*)(\w.*)\h\{$#m'] = "$1$2 +$1{"; } if ($this->getParameter('remove_closing_comments') == 'true') { $filter['#^(\t*)} //.*$#m'] = "$1}"; diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/SoftDeleteBehavior.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/SoftDeleteBehavior.php index 9f8df08fc..c31624d71 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/SoftDeleteBehavior.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/behavior/SoftDeleteBehavior.php @@ -59,7 +59,7 @@ protected function getColumnSetter() public function preDelete() { return <<getTable()->getPhpName()}Peer::isSoftDeleteEnabled()) { +if (!empty(\$ret) && {$this->getTable()->getPhpName()}Peer::isSoftDeleteEnabled()) { \$this->{$this->getColumnSetter()}(time()); \$this->save(); \$con->commit(); @@ -218,9 +218,9 @@ public static function doSoftDeleteAll(PropelPDO \$con = null) public static function doDeleteAll2(PropelPDO \$con = null) { if ({$this->getTable()->getPhpName()}Peer::isSoftDeleteEnabled()) { - return {$this->getTable()->getPhpName()}Peer::doSoftDeleteAll(\$values, \$con); + return {$this->getTable()->getPhpName()}Peer::doSoftDeleteAll(\$con); } else { - return {$this->getTable()->getPhpName()}Peer::doForceDeleteAll(\$values, \$con); + return {$this->getTable()->getPhpName()}Peer::doForceDeleteAll(\$con); } } EOT; diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/OMBuilder.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/OMBuilder.php index 058493b11..f5ef4369f 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/OMBuilder.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/OMBuilder.php @@ -1,7 +1,7 @@ getConstantName(); + return $this->getBuildProperty('classPrefix') . $col->getConstantName(); } // was it overridden in schema.xml ? if ($col->getPeerName()) { diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php index 54727d2e5..9e63bdcd1 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5ObjectBuilder.php @@ -1,7 +1,7 @@ getPeerClassname()."::NUM_COLUMNS - ".$this->getPeerClassname()."::NUM_LAZY_LOAD_COLUMNS). } catch (Exception \$e) { - throw new PropelException(\"Error populating ".$table->getPhpName()." object\", \$e); + throw new PropelException(\"Error populating ".$this->getStubObjectBuilder()->getClassname()." object\", \$e); }"; } @@ -2034,6 +2034,8 @@ protected function addDeleteBody(&$script) { $script .= " \$this->setDeleted(true); \$con->commit(); + } else { + \$con->commit(); }"; } else { // apply behaviors @@ -3587,10 +3589,12 @@ protected function addSaveBody(&$script) { \$this->postSave(\$con);"; $this->applyBehaviorModifier('postSave', $script, " "); $script .= " - \$con->commit(); ".$this->getPeerClassname()."::addInstanceToPool(\$this); - return \$affectedRows; - }"; + } else { + \$affectedRows = 0; + } + \$con->commit(); + return \$affectedRows;"; } else { // save without runtime hooks $this->applyBehaviorModifier('preSave', $script, " "); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5PeerBuilder.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5PeerBuilder.php index b0dcab7ff..fa29313ab 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5PeerBuilder.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/PHP5PeerBuilder.php @@ -1,7 +1,7 @@ getTable()->isAbstract() ? '' : $this->getTable()->getPhpName()) . 'TableMap'; + return $this->getTablePhpName() . 'TableMap'; + } + + public function getTablePhpName() + { + return ($this->getTable()->isAbstract() ? '' : $this->getStubObjectBuilder()->getClassname()); } /** @@ -172,7 +177,7 @@ protected function addConstantsAndAttributes(&$script) { $dbName = $this->getDatabase()->getName(); $tableName = $this->prefixTableName($this->getTable()->getName()); - $tablePhpName = $this->getTable()->isAbstract() ? '' : $this->getTable()->getPhpName(); + $tablePhpName = $this->getTablePhpName(); $script .= " /** the default database name for this class */ const DATABASE_NAME = '$dbName'; @@ -1264,6 +1269,7 @@ public static function doDeleteAll(\$con = null) protected function addDoDelete(&$script) { $table = $this->getTable(); + $emulateCascade = $this->isDeleteCascadeEmulationNeeded() || $this->isDeleteSetNullEmulationNeeded(); $script .= " /** * Method perform a DELETE on the database, given a ".$this->getObjectClassname()." or Criteria object OR a primary key value. @@ -1282,18 +1288,23 @@ public static function doDelete(\$values, PropelPDO \$con = null) \$con = Propel::getConnection(".$this->getPeerClassname()."::DATABASE_NAME, Propel::CONNECTION_WRITE); } - if (\$values instanceof Criteria) { + if (\$values instanceof Criteria) {"; + if (!$emulateCascade) { + $script .= " // invalidate the cache for all objects of this type, since we have no // way of knowing (without running a query) what objects should be invalidated // from the cache based on this Criteria. - ".$this->getPeerClassname()."::clearInstancePool(); - + ".$this->getPeerClassname()."::clearInstancePool();"; + } + $script .= " // rename for clarity \$criteria = clone \$values; - } elseif (\$values instanceof ".$this->getObjectClassname().") { + } elseif (\$values instanceof ".$this->getObjectClassname().") { // it's a model object"; + if (!$emulateCascade) { + $script .= " // invalidate the cache for this single object ".$this->getPeerClassname()."::removeInstanceFromPool(\$values);"; - + } if (count($table->getPrimaryKey()) > 0) { $script .= " // create criteria based on pk values @@ -1305,36 +1316,31 @@ public static function doDelete(\$values, PropelPDO \$con = null) } $script .= " - } else { - // it must be the primary key - - - + } else { // it's a primary key, or an array of pks"; + $script .= " \$criteria = new Criteria(self::DATABASE_NAME);"; if (count($table->getPrimaryKey()) === 1) { $pkey = $table->getPrimaryKey(); $col = array_shift($pkey); $script .= " - \$criteria->add(".$this->getColumnConstant($col).", (array) \$values, Criteria::IN); - + \$criteria->add(".$this->getColumnConstant($col).", (array) \$values, Criteria::IN);"; + if (!$emulateCascade) { + $script .= " + // invalidate the cache for this object(s) foreach ((array) \$values as \$singleval) { - // we can invalidate the cache for this single object ".$this->getPeerClassname()."::removeInstanceFromPool(\$singleval); }"; - + } } else { $script .= " // primary key is composite; we therefore, expect - // the primary key passed to be an array of pkey - // values + // the primary key passed to be an array of pkey values if (count(\$values) == count(\$values, COUNT_RECURSIVE)) { // array is not multi-dimensional \$values = array(\$values); } - - foreach (\$values as \$value) { -"; + foreach (\$values as \$value) {"; $i=0; foreach ($table->getPrimaryKey() as $col) { if ($i == 0) { @@ -1347,10 +1353,13 @@ public static function doDelete(\$values, PropelPDO \$con = null) $i++; } $script .= " - \$criteria->addOr(\$criterion); - + \$criteria->addOr(\$criterion);"; + if (!$emulateCascade) { + $script .= " // we can invalidate the cache for this single PK - ".$this->getPeerClassname()."::removeInstanceFromPool(\$value); + ".$this->getPeerClassname()."::removeInstanceFromPool(\$value);"; + } + $script .= " }"; } /* if count(table->getPrimaryKeys()) */ @@ -1377,16 +1386,20 @@ public static function doDelete(\$values, PropelPDO \$con = null) "; } - if ($this->isDeleteCascadeEmulationNeeded() || $this->isDeleteSetNullEmulationNeeded()) { + if ($emulateCascade) { $script .= " - // Because this db requires some delete cascade/set null emulation, we have to - // clear the cached instance *after* the emulation has happened (since - // instances get re-added by the select statement contained therein). - if (\$values instanceof Criteria) { - ".$this->getPeerClassname()."::clearInstancePool(); - } else { // it's a PK or object - ".$this->getPeerClassname()."::removeInstanceFromPool(\$values); + // Because this db requires some delete cascade/set null emulation, we have to + // clear the cached instance *after* the emulation has happened (since + // instances get re-added by the select statement contained therein). + if (\$values instanceof Criteria) { + ".$this->getPeerClassname()."::clearInstancePool(); + } elseif (\$values instanceof ".$this->getObjectClassname().") { // it's a model object + ".$this->getPeerClassname()."::removeInstanceFromPool(\$values); + } else { // it's a primary key, or an array of pks + foreach ((array) \$values as \$singleval) { + ".$this->getPeerClassname()."::removeInstanceFromPool(\$singleval); } + } "; } @@ -1969,9 +1982,17 @@ public static function doSelectJoin".$thisTableObjectBuilder->getFKPhpNameAffix( \$obj2->hydrate(\$row, \$startcol); ".$joinedTablePeerBuilder->getPeerClassname()."::addInstanceToPool(\$obj2, \$key2); } // if obj2 already loaded - - // Add the \$obj1 (".$this->getObjectClassname().") to \$obj2 (".$joinedTablePeerBuilder->getObjectClassname().") - \$obj2->".($fk->isLocalPrimaryKey() ? 'set' : 'add') . $joinedTableObjectBuilder->getRefFKPhpNameAffix($fk, $plural = false)."(\$obj1); + + // Add the \$obj1 (".$this->getObjectClassname().") to \$obj2 (".$joinedTablePeerBuilder->getObjectClassname().")"; + if ($fk->isLocalPrimaryKey()) { + $script .= " + // one to one relationship + \$obj1->set" . $joinedTablePeerBuilder->getObjectClassname() . "(\$obj2);"; + } else { + $script .= " + \$obj2->add" . $joinedTableObjectBuilder->getRefFKPhpNameAffix($fk, $plural = false)."(\$obj1);"; + } + $script .= " } // if joined row was not null @@ -2220,10 +2241,15 @@ public static function doSelectJoinAll(Criteria \$criteria, \$con = null, \$join ".$joinedTablePeerBuilder->getPeerClassname()."::addInstanceToPool(\$obj$index, \$key$index); } // if obj$index loaded - // Add the \$obj1 (".$this->getObjectClassname().") to the collection in \$obj".$index." (".$joinedTablePeerBuilder->getObjectClassname().") - ".($fk->isLocalPrimaryKey() ? - "\$obj1->set".$joinedTablePeerBuilder->getObjectClassname()."(\$obj".$index.");" : - "\$obj".$index."->add".$joinedTableObjectBuilder->getRefFKPhpNameAffix($fk, $plural = false)."(\$obj1);")." + // Add the \$obj1 (".$this->getObjectClassname().") to the collection in \$obj".$index." (".$joinedTablePeerBuilder->getObjectClassname().")"; + if ($fk->isLocalPrimaryKey()) { + $script .= " + \$obj1->set".$joinedTablePeerBuilder->getObjectClassname()."(\$obj".$index.");"; + } else { + $script .= " + \$obj".$index."->add".$joinedTableObjectBuilder->getRefFKPhpNameAffix($fk, $plural = false)."(\$obj1);"; + } + $script .= " } // if joined row not null "; @@ -2485,8 +2511,15 @@ public static function doSelectJoinAllExcept".$thisTableObjectBuilder->getFKPhpN ".$joinedTablePeerBuilder->getPeerClassname()."::addInstanceToPool(\$obj$index, \$key$index); } // if \$obj$index already loaded - // Add the \$obj1 (".$this->getObjectClassname().") to the collection in \$obj".$index." (".$joinedTablePeerBuilder->getObjectClassname().") - \$obj".$index."->".($subfk->isLocalPrimaryKey() ? 'set' : 'add') . $joinedTableObjectBuilder->getRefFKPhpNameAffix($subfk, $plural = false)."(\$obj1); + // Add the \$obj1 (".$this->getObjectClassname().") to the collection in \$obj".$index." (".$joinedTablePeerBuilder->getObjectClassname().")"; + if ($subfk->isLocalPrimaryKey()) { + $script .= " + \$obj1->set".$joinedTablePeerBuilder->getObjectClassname()."(\$obj".$index.");"; + } else { + $script .= " + \$obj".$index."->add".$joinedTableObjectBuilder->getRefFKPhpNameAffix($subfk, $plural = false)."(\$obj1);"; + } + $script .= " } // if joined row is not null "; diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/Column.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/Column.php index 04d633d54..3e63bcda1 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/Column.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/Column.php @@ -1,6 +1,6 @@ (Torque) * @author Byron Foster (Torque) * @author Bernd Goldschmidt - * @version $Revision: 1295 $ + * @version $Revision: 1447 $ * @package propel.engine.database.model */ class Column extends XMLElement { @@ -211,7 +211,12 @@ protected function setupObject() // Add type, size information to associated Domain object $this->getDomain()->replaceSqlType($this->getAttribute("sqlType")); - $this->getDomain()->replaceSize($this->getAttribute("size", $type == 'VARCHAR' ? 255 : null)); + if (!$this->getAttribute("size") && $this->getDomain()->getType() == 'VARCHAR' && !$this->getAttribute("sqlType")) { + $size = 255; + } else { + $size = $this->getAttribute("size"); + } + $this->getDomain()->replaceSize($size); $this->getDomain()->replaceScale($this->getAttribute("scale")); $defval = $this->getAttribute("defaultValue", $this->getAttribute("default")); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/ForeignKey.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/ForeignKey.php index 6f424ea0c..9275538fc 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/ForeignKey.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/model/ForeignKey.php @@ -1,6 +1,6 @@ * @author Fedor * @author Daniel Rall - * @version $Revision: 1262 $ + * @version $Revision: 1448 $ * @package propel.engine.database.model */ class ForeignKey extends XMLElement { @@ -384,6 +384,11 @@ public function isLocalPrimaryKey() * @link http://propel.phpdb.org/trac/ticket/549 */ public function isMatchedByInverseFK() + { + return (bool) $this->getInverseFK(); + } + + public function getInverseFK() { $foreignTable = $this->getForeignTable(); $map = $this->getForeignLocalMapping(); @@ -391,11 +396,9 @@ public function isMatchedByInverseFK() foreach ($foreignTable->getForeignKeys() as $refFK) { $fkMap = $refFK->getLocalForeignMapping(); if ( ($refFK->getTableName() == $this->getTableName()) && ($map == $fkMap) ) { // compares keys and values, but doesn't care about order, included check to make sure it's the same table (fixes #679) - return true; + return $refFK; } } - - return false; } /** diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/reverse/pgsql/PgsqlSchemaParser.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/reverse/pgsql/PgsqlSchemaParser.php index 63a9ad358..6fabe9211 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/reverse/pgsql/PgsqlSchemaParser.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/database/reverse/pgsql/PgsqlSchemaParser.php @@ -1,6 +1,6 @@ - * @version $Revision: 1262 $ + * @version $Revision: 1397 $ * @package propel.engine.database.reverse.pgsql */ class PgsqlSchemaParser extends BaseSchemaParser { @@ -334,13 +334,15 @@ protected function addForeignKeys(Table $table, $oid, $version) conname, confupdtype, confdeltype, - cl.relname as fktab, + CASE nl.nspname WHEN 'public' THEN cl.relname ELSE nl.nspname||'.'||cl.relname END as fktab, a2.attname as fkcol, - cr.relname as reftab, + CASE nr.nspname WHEN 'public' THEN cr.relname ELSE nr.nspname||'.'||cr.relname END as reftab, a1.attname as refcol FROM pg_constraint ct JOIN pg_class cl ON cl.oid=conrelid JOIN pg_class cr ON cr.oid=confrelid + JOIN pg_namespace nl ON nl.oid = cl.relnamespace + JOIN pg_namespace nr ON nr.oid = cr.relnamespace LEFT JOIN pg_catalog.pg_attribute a1 ON a1.attrelid = ct.confrelid LEFT JOIN pg_catalog.pg_attribute a2 ON a2.attrelid = ct.conrelid WHERE diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/default.properties b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/default.properties index f03aefebd..9b2144bc4 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/default.properties +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/default.properties @@ -16,7 +16,7 @@ # # ------------------------------------------------------------------- -propel.version = 1.4.0 +propel.version = 1.4.1 propel.home = . diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php index 72326f09d..aca659682 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/Propel.php @@ -1,6 +1,6 @@ (Torque) * @author Henning P. Schmiedehausen (Torque) * @author Kurt Schrader (Torque) - * @version $Revision: 1299 $ + * @version $Revision: 1452 $ * @package propel */ class Propel @@ -90,7 +90,7 @@ class Propel /** * The Propel version. */ - const VERSION = '1.4.0'; + const VERSION = '1.4.1'; /** * The class name for a PDO object. @@ -255,7 +255,7 @@ public static function initialize() } /** - * Configure Propel using an INI or PHP (array) config file. + * Configure Propel using a PHP (array) config file. * * @param string Path (absolute or relative to include_path) to config file. * @@ -291,7 +291,7 @@ protected static function configureLogging() } /** - * Initialization of Propel with an INI or PHP (array) configuration file. + * Initialization of Propel with a PHP (array) configuration file. * * @param string $c The Propel configuration file path. * diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDO.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDO.php index bc9aaa825..a546b6c95 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDO.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDO.php @@ -1,6 +1,6 @@ getDebugSnapshot(); $args = func_get_args(); - $return = call_user_func_array(array($this, 'parent::query'), $args); + if (version_compare(PHP_VERSION, '5.3', '<')) { + $return = call_user_func_array(array($this, 'parent::query'), $args); + } else { + $return = call_user_func_array('parent::query', $args); + } $sql = $args[0]; $this->log($sql, null, __METHOD__, $debug); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php index b643d33d6..16ae2aeaf 100644 --- a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel/util/DebugPDOStatement.php @@ -1,6 +1,6 @@ = 0; $i--) { $pos = $matches[1][$i]; $sql = str_replace($pos, $this->boundValues[$pos], $sql); } diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/form/sfFormPropelTest.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/form/sfFormPropelTest.php new file mode 100644 index 000000000..819a8e216 --- /dev/null +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/form/sfFormPropelTest.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$app = 'frontend'; +include dirname(__FILE__).'/../../bootstrap/functional.php'; +include $configuration->getSymfonyLibDir().'/vendor/lime/lime.php'; + +$t = new lime_test(2); + +// ->__construct() +$t->diag('->__construct()'); + +class DefaultValuesForm extends AuthorForm +{ + public function configure() + { + $this->setDefault('name', 'John Doe'); + } +} + +$author = new Author(); +$form = new DefaultValuesForm($author); +$t->is($form->getDefault('name'), 'John Doe', '->__construct() uses form defaults for new objects'); + +$author = new Author(); +$author->setName('Jacques Doe'); +$author->save(); +$form = new DefaultValuesForm($author); +$t->is($form->getDefault('name'), 'Jacques Doe', '->__construct() uses object value as a default for existing objects'); +$author->delete(); diff --git a/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/validator/sfValidatorPropelUniqueTest.php b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/validator/sfValidatorPropelUniqueTest.php new file mode 100644 index 000000000..011f7a6fe --- /dev/null +++ b/lib/vendor/symfony/lib/plugins/sfPropelPlugin/test/unit/validator/sfValidatorPropelUniqueTest.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$app = 'frontend'; +include dirname(__FILE__).'/../../bootstrap/functional.php'; +include $configuration->getSymfonyLibDir().'/vendor/lime/lime.php'; + +$t = new lime_test(2); + +// ->clean() +$t->diag('->clean()'); + +$validator = new sfValidatorPropelUnique(array('model' => 'Author', 'column' => 'name')); + +$author = new Author(); +$author->setName('==NAME=='); +$author->save(); + +try +{ + $validator->clean(array('name' => '==NAME==')); + $t->fail('->clean() throws an error on the column'); +} +catch (sfValidatorErrorSchema $errors) +{ + $t->is(isset($errors['name']), true, '->clean() throws an error on the column'); +} +catch (Exception $e) +{ + $t->fail('->clean() throws an error on the column'); + $t->diag(' '.$e->getMessage()); +} + +$validator->setOption('field', 'author_name'); + +try +{ + $validator->clean(array('author_name' => '==NAME==')); + $t->fail('->clean() throws an error on the field'); +} +catch (sfValidatorErrorSchema $errors) +{ + $t->is(isset($errors['author_name']), true, '->clean() throws an error on the field'); +} +catch (Exception $e) +{ + $t->fail('->clean() throws an error on the field'); + $t->diag(' '.$e->getMessage()); +} + +$author->delete(); diff --git a/lib/vendor/symfony/lib/routing/sfRoute.class.php b/lib/vendor/symfony/lib/routing/sfRoute.class.php index 676263b2b..d1b32d0a7 100644 --- a/lib/vendor/symfony/lib/routing/sfRoute.class.php +++ b/lib/vendor/symfony/lib/routing/sfRoute.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage routing * @author Fabien Potencier - * @version SVN: $Id: sfRoute.class.php 24293 2009-11-23 21:23:48Z FabianLange $ + * @version SVN: $Id: sfRoute.class.php 27183 2010-01-26 11:52:46Z FabianLange $ */ class sfRoute implements Serializable { @@ -556,9 +556,9 @@ protected function tokenize() $buffer = substr($buffer, strlen($match[1])); $afterASeparator = false; } - else if (!$afterASeparator && preg_match('#^'.$this->options['segment_separators_regex'].'#', $buffer, $match)) + else if (!$afterASeparator && preg_match('#^/|^'.$this->options['segment_separators_regex'].'#', $buffer, $match)) { - // a separator + // beginning of URL (^/) or a separator $this->tokens[] = array('separator', $currentSeparator, $match[0], null); $currentSeparator = $match[0]; @@ -686,16 +686,27 @@ protected function initializeOptions() 'extra_parameters_as_query_string' => true, ), $this->getDefaultOptions(), $this->options); + $preg_quote_hash = create_function('$a', 'return preg_quote($a, \'#\');'); + // compute some regexes - $this->options['variable_prefix_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['variable_prefixes'])).')'; - $this->options['segment_separators_regex'] = '(?:'.implode('|', array_map(create_function('$a', 'return preg_quote($a, \'#\');'), $this->options['segment_separators'])).')'; - - // as of PHP 5.3.0, preg_quote automatically quotes dashes "-" (see http://bugs.php.net/bug.php?id=47229) - $this->options['variable_content_regex'] = '[^'.implode('', array_map( - version_compare(PHP_VERSION, '5.3.0RC4', '>=') ? - create_function('$a', 'return preg_quote($a, \'#\');') : - create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));') - , $this->options['segment_separators'])).']+'; + $this->options['variable_prefix_regex'] = '(?:'.implode('|', array_map($preg_quote_hash, $this->options['variable_prefixes'])).')'; + + if (count($this->options['segment_separators'])) + { + $this->options['segment_separators_regex'] = '(?:'.implode('|', array_map($preg_quote_hash, $this->options['segment_separators'])).')'; + + // as of PHP 5.3.0, preg_quote automatically quotes dashes "-" (see http://bugs.php.net/bug.php?id=47229) + $preg_quote_hash_53 = create_function('$a', 'return str_replace(\'-\', \'\-\', preg_quote($a, \'#\'));'); + $this->options['variable_content_regex'] = '[^'.implode('', + array_map(version_compare(PHP_VERSION, '5.3.0RC4', '>=') ? $preg_quote_hash : $preg_quote_hash_53, $this->options['segment_separators']) + ).']+'; + } + else + { + // use simplified regexes for case where no separators are used + $this->options['segment_separators_regex'] = '()'; + $this->options['variable_content_regex'] = '.+'; + } } protected function parseStarParameter($star) diff --git a/lib/vendor/symfony/lib/task/generator/sfGenerateProjectTask.class.php b/lib/vendor/symfony/lib/task/generator/sfGenerateProjectTask.class.php index ef71a9948..bab63e078 100644 --- a/lib/vendor/symfony/lib/task/generator/sfGenerateProjectTask.class.php +++ b/lib/vendor/symfony/lib/task/generator/sfGenerateProjectTask.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfGenerateProjectTask.class.php 23922 2009-11-14 14:58:38Z fabien $ + * @version SVN: $Id: sfGenerateProjectTask.class.php 27211 2010-01-26 20:23:26Z FabianLange $ */ class sfGenerateProjectTask extends sfGeneratorBaseTask { @@ -134,9 +134,11 @@ protected function execute($arguments = array(), $options = array()) // execute a custom installer if ($options['installer'] && $this->commandApplication) { - $this->reloadTasks(); - - include $options['installer']; + if ($this->canRunInstaller($options['installer'])) + { + $this->reloadTasks(); + include $options['installer']; + } } // fix permission for common directories @@ -147,4 +149,21 @@ protected function execute($arguments = array(), $options = array()) $this->replaceTokens(); } + + protected function canRunInstaller($installer) + { + if (preg_match('#^(https?|ftps?)://#', $installer)) + { + if (ini_get('allow_url_fopen') === false) + { + $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_fopen" is off', $installer)); + } + if (ini_get('allow_url_include') === false) + { + $this->logSection('generate', sprintf('Cannot run remote installer "%s" because "allow_url_include" is off', $installer)); + } + return ini_get('allow_url_fopen') && ini_get('allow_url_include'); + } + return true; + } } diff --git a/lib/vendor/symfony/lib/task/generator/sfGenerateTaskTask.class.php b/lib/vendor/symfony/lib/task/generator/sfGenerateTaskTask.class.php index 5bda88f34..17539a0f6 100644 --- a/lib/vendor/symfony/lib/task/generator/sfGenerateTaskTask.class.php +++ b/lib/vendor/symfony/lib/task/generator/sfGenerateTaskTask.class.php @@ -28,7 +28,7 @@ protected function configure() $this->addOptions(array( new sfCommandOption('dir', null, sfCommandOption::PARAMETER_REQUIRED, 'The directory to create the task in', 'lib/task'), - new sfCommandOption('use-database', null, sfCommandOption::PARAMETER_REQUIRED, 'Whether the task needs model initialization to access database', 'doctrine'), + new sfCommandOption('use-database', null, sfCommandOption::PARAMETER_REQUIRED, 'Whether the task needs model initialization to access database', sfConfig::get('sf_orm')), new sfCommandOption('brief-description', null, sfCommandOption::PARAMETER_REQUIRED, 'A brief task description (appears in task list)'), )); @@ -93,7 +93,7 @@ protected function execute($arguments = array(), $options = array()) HED; $useDatabase = sfToolkit::literalize($options['use-database']); - $defaultConnection = is_string($useDatabase) ? $useDatabase : 'doctrine'; + $defaultConnection = is_string($useDatabase) ? $useDatabase : sfConfig::get('sf_orm'); if ($useDatabase) { @@ -128,7 +128,7 @@ protected function execute(\$arguments = array(), \$options = array()) { // initialize the database connection \$databaseManager = new sfDatabaseManager(\$this->configuration); - \$connection = \$databaseManager->getDatabase(\$options['connection'] ? \$options['connection'] : null)->getConnection(); + \$connection = \$databaseManager->getDatabase(\$options['connection'])->getConnection(); // add your code here } diff --git a/lib/vendor/symfony/lib/task/project/sfProjectOptimizeTask.class.php b/lib/vendor/symfony/lib/task/project/sfProjectOptimizeTask.class.php index aa13feb13..a50112cc7 100644 --- a/lib/vendor/symfony/lib/task/project/sfProjectOptimizeTask.class.php +++ b/lib/vendor/symfony/lib/task/project/sfProjectOptimizeTask.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfProjectOptimizeTask.class.php 24039 2009-11-16 17:52:14Z Kris.Wallsmith $ + * @version SVN: $Id: sfProjectOptimizeTask.class.php 27511 2010-02-03 19:39:44Z FabianLange $ */ class sfProjectOptimizeTask extends sfBaseTask { @@ -49,7 +49,7 @@ protected function execute($arguments = array(), $options = array()) { $data = array(); $modules = $this->findModules(); - $target = sfConfig::get('sf_cache_dir').'/'.$arguments['application'].'/'.$arguments['environment'].'/config/configuration.php'; + $target = sfConfig::get('sf_cache_dir').'/'.$arguments['application'].'/'.$arguments['env'].'/config/configuration.php'; // remove existing optimization file if (file_exists($target)) diff --git a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedClassesValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedClassesValidation.class.php index 6898b7274..06043d4c8 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedClassesValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedClassesValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfDeprecatedClassesValidation.class.php 24706 2009-12-01 19:38:44Z fabien $ + * @version SVN: $Id: sfDeprecatedClassesValidation.class.php 25411 2009-12-15 15:31:29Z fabien $ */ class sfDeprecatedClassesValidation extends sfValidation { @@ -59,7 +59,7 @@ public function validate() 'sfActionException', 'sfValidatorException', 'sfFillInFormFilter', 'sfValidationExecutionFilter', 'sfRequestCompat10', 'sfFillInForm', 'sfCallbackValidator', 'sfCompareValidator', 'sfDateValidator', 'sfEmailValidator', 'sfFileValidator', 'sfNumberValidator', 'sfRegexValidator', 'sfStringValidator', - 'sfUrlValidator', 'sfValidator(', 'sfValidatorManager', 'sfMailView', 'sfMail(', + 'sfUrlValidator', 'sfValidator', 'sfValidatorManager', 'sfMailView', 'sfMail', ); $found = array(); @@ -71,12 +71,12 @@ public function validate() )); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); $matches = array(); foreach ($classes as $class) { - if (false !== stripos($content, $class)) + if (preg_match('#\b'.preg_quote($class, '#').'\b#', $content)) { $matches[] = $class; } diff --git a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedHelpersValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedHelpersValidation.class.php index b3030709e..7f6ac0be2 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedHelpersValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedHelpersValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfDeprecatedHelpersValidation.class.php 24610 2009-11-30 22:07:34Z FabianLange $ + * @version SVN: $Id: sfDeprecatedHelpersValidation.class.php 25411 2009-12-15 15:31:29Z fabien $ */ class sfDeprecatedHelpersValidation extends sfValidation { @@ -66,12 +66,12 @@ public function validate() )); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); $matches = array(); foreach ($helpers as $helper) { - if (false !== stripos($content, $helper)) + if (preg_match('#\b'.preg_quote($helper, '#').'\b#', $content)) { $matches[] = $helper; } diff --git a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedMethodsValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedMethodsValidation.class.php index e9c20f195..3d8b1e9be 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedMethodsValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedMethodsValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfDeprecatedMethodsValidation.class.php 24706 2009-12-01 19:38:44Z fabien $ + * @version SVN: $Id: sfDeprecatedMethodsValidation.class.php 25411 2009-12-15 15:31:29Z fabien $ */ class sfDeprecatedMethodsValidation extends sfValidation { @@ -50,9 +50,9 @@ public function validate() 'sfValidatorBase::setRequiredMessage', 'debug_message', 'sfContext::retrieveObjects', - '->getXDebugStack', - '->checkSymfonyVersion', - '->sh(', + 'getXDebugStack', + 'checkSymfonyVersion', + 'sh', ), array( sfConfig::get('sf_apps_dir'), sfConfig::get('sf_lib_dir'), @@ -61,7 +61,7 @@ public function validate() )), $this->doValidate(array( - '\-\>contains\(', 'responseContains', 'isRequestParameter', 'isResponseHeader', + 'contains', 'responseContains', 'isRequestParameter', 'isResponseHeader', 'isUserCulture', 'isRequestFormat', 'checkResponseElement', ), sfConfig::get('sf_test_dir')), @@ -79,12 +79,12 @@ public function doValidate($methods, $dir) $files = sfFinder::type('file')->name('*.php')->prune('vendor')->in($dir); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); $matches = array(); foreach ($methods as $method) { - if (false !== stripos($content, $method)) + if (preg_match('#\b'.preg_quote($method, '#').'\b#', $content)) { $matches[] = $method; } diff --git a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php index 5e33c8489..a8769526d 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedPluginsValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfDeprecatedPluginsValidation.class.php 24610 2009-11-30 22:07:34Z FabianLange $ + * @version SVN: $Id: sfDeprecatedPluginsValidation.class.php 25410 2009-12-15 15:19:07Z fabien $ */ class sfDeprecatedPluginsValidation extends sfValidation { @@ -41,7 +41,7 @@ public function validate() $files = sfFinder::type('file')->name('*Configuration.class.php')->in($this->getProjectConfigDirectories()); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); $matches = array(); if (false !== strpos($content, 'sfCompat10Plugin')) diff --git a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedSettingsValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedSettingsValidation.class.php index 6dc2e7900..bc098a186 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedSettingsValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfDeprecatedSettingsValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfDeprecatedSettingsValidation.class.php 24610 2009-11-30 22:07:34Z FabianLange $ + * @version SVN: $Id: sfDeprecatedSettingsValidation.class.php 25410 2009-12-15 15:19:07Z fabien $ */ class sfDeprecatedSettingsValidation extends sfValidation { @@ -56,7 +56,7 @@ public function validate() )); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); $matches = array(); foreach ($settings as $setting) diff --git a/lib/vendor/symfony/lib/task/project/validation/sfParameterHolderValidation.class.php b/lib/vendor/symfony/lib/task/project/validation/sfParameterHolderValidation.class.php index b548d8dcb..737d035e3 100644 --- a/lib/vendor/symfony/lib/task/project/validation/sfParameterHolderValidation.class.php +++ b/lib/vendor/symfony/lib/task/project/validation/sfParameterHolderValidation.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage task * @author Fabien Potencier - * @version SVN: $Id: sfParameterHolderValidation.class.php 24610 2009-11-30 22:07:34Z FabianLange $ + * @version SVN: $Id: sfParameterHolderValidation.class.php 25411 2009-12-15 15:31:29Z fabien $ */ class sfParameterHolderValidation extends sfValidation { @@ -44,7 +44,7 @@ public function getExplanation() public function validate() { $found = array(); - $files = sfFinder::type('file')->name('*.class.php')->prune('vendor')->in(array( + $files = sfFinder::type('file')->name('*.php')->prune('vendor')->in(array( sfConfig::get('sf_apps_dir'), sfConfig::get('sf_lib_dir'), sfConfig::get('sf_test_dir'), @@ -52,9 +52,9 @@ public function validate() )); foreach ($files as $file) { - $content = file_get_contents($file); + $content = sfToolkit::stripComments(file_get_contents($file)); - if (preg_match('#(get|has|remove)(Request)*Parameter\(\s*[\'"][^\),]*?\[[^\),]#', $content)) + if (preg_match('#\b(get|has|remove)(Request)*Parameter\(\s*[\'"][^\),]*?\[[^\),]#', $content)) { $found[$file] = true; } diff --git a/lib/vendor/symfony/lib/task/sfFilesystem.class.php b/lib/vendor/symfony/lib/task/sfFilesystem.class.php index db35db10c..85e583697 100644 --- a/lib/vendor/symfony/lib/task/sfFilesystem.class.php +++ b/lib/vendor/symfony/lib/task/sfFilesystem.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage util * @author Fabien Potencier - * @version SVN: $Id: sfFilesystem.class.php 24991 2009-12-06 20:22:52Z Kris.Wallsmith $ + * @version SVN: $Id: sfFilesystem.class.php 27816 2010-02-10 15:46:46Z FabianLange $ */ class sfFilesystem { @@ -182,7 +182,7 @@ public function rename($origin, $target) // we check that target does not exist if (is_readable($target)) { - throw new sfException(sprintf('Cannot rename because the target "%" already exist.', $target)); + throw new sfException(sprintf('Cannot rename because the target "%s" already exist.', $target)); } $this->logSection('rename', $origin.' > '.$target); @@ -198,7 +198,7 @@ public function rename($origin, $target) */ public function symlink($originDir, $targetDir, $copyOnWindows = false) { - if (!function_exists('symlink') && $copyOnWindows) + if ('\\' == DIRECTORY_SEPARATOR && $copyOnWindows) { $finder = sfFinder::type('any'); $this->mirror($originDir, $targetDir, $finder); @@ -234,10 +234,11 @@ public function symlink($originDir, $targetDir, $copyOnWindows = false) */ public function relativeSymlink($originDir, $targetDir, $copyOnWindows = false) { - if (function_exists('symlink') || !$copyOnWindows) + if ('\\' != DIRECTORY_SEPARATOR || !$copyOnWindows) { $originDir = $this->calculateRelativeDir($targetDir, $originDir); } + $this->symlink($originDir, $targetDir, $copyOnWindows); } diff --git a/lib/vendor/symfony/lib/test/sfTestFunctionalBase.class.php b/lib/vendor/symfony/lib/test/sfTestFunctionalBase.class.php index d964634d1..ce43ae97b 100644 --- a/lib/vendor/symfony/lib/test/sfTestFunctionalBase.class.php +++ b/lib/vendor/symfony/lib/test/sfTestFunctionalBase.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage test * @author Fabien Potencier - * @version SVN: $Id: sfTestFunctionalBase.class.php 23922 2009-11-14 14:58:38Z fabien $ + * @version SVN: $Id: sfTestFunctionalBase.class.php 27845 2010-02-10 19:46:03Z Kris.Wallsmith $ */ abstract class sfTestFunctionalBase { @@ -108,7 +108,7 @@ public function end() { if (null === $this->blockTester) { - throw new LogicException(sprintf('There is not current tester block to end.')); + throw new LogicException(sprintf('There is no current tester block to end.')); } $this->blockTester = null; diff --git a/lib/vendor/symfony/lib/test/sfTesterRequest.class.php b/lib/vendor/symfony/lib/test/sfTesterRequest.class.php index d19149b0e..60d4f6e7f 100644 --- a/lib/vendor/symfony/lib/test/sfTesterRequest.class.php +++ b/lib/vendor/symfony/lib/test/sfTesterRequest.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage test * @author Fabien Potencier - * @version SVN: $Id: sfTesterRequest.class.php 14497 2009-01-06 17:30:36Z fabien $ + * @version SVN: $Id: sfTesterRequest.class.php 27845 2010-02-10 19:46:03Z Kris.Wallsmith $ */ class sfTesterRequest extends sfTester { @@ -92,7 +92,7 @@ public function hasCookie($name, $exists = true) { if ($exists) { - $this->tester->fail(sprintf('cookie "%s" exist.', $name)); + $this->tester->fail(sprintf('cookie "%s" exists.', $name)); } else { diff --git a/lib/vendor/symfony/lib/test/sfTesterResponse.class.php b/lib/vendor/symfony/lib/test/sfTesterResponse.class.php index 30ff24ace..c621cd41e 100644 --- a/lib/vendor/symfony/lib/test/sfTesterResponse.class.php +++ b/lib/vendor/symfony/lib/test/sfTesterResponse.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage test * @author Fabien Potencier - * @version SVN: $Id: sfTesterResponse.class.php 23922 2009-11-14 14:58:38Z fabien $ + * @version SVN: $Id: sfTesterResponse.class.php 27061 2010-01-22 17:08:04Z FabianLange $ */ class sfTesterResponse extends sfTester { @@ -183,7 +183,21 @@ public function isValid($checkDTD = false) if (true === $checkDTD) { $cache = sfConfig::get('sf_cache_dir').'/sf_tester_response/w3'; - $local = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', $cache); + if ($cache[1] == ':') + { + // On Windows systems the path will be like c:\symfony\cache\xml.dtd + // I did not manage to get DOMDocument loading a file protocol url including the drive letter + // file://c:\symfony\cache\xml.dtd or file://c:/symfony/cache/xml.dtd + // The first one simply doesnt work, the second one is treated as remote call. + // However the following works. Unfortunatly this means we can only access the current disk + // file:///symfony/cache/xml.dtd + // Note that all work for file_get_contents so the bug is most likely in DOMDocument. + $local = 'file://'.substr(str_replace(DIRECTORY_SEPARATOR, '/', $cache), 2); + } + else + { + $local = 'file://'.$cache; + } if (!file_exists($cache.'/TR/xhtml11/DTD/xhtml11.dtd')) { diff --git a/lib/vendor/symfony/lib/util/sfBrowserBase.class.php b/lib/vendor/symfony/lib/util/sfBrowserBase.class.php index 9baf5a399..7a5f08cd8 100644 --- a/lib/vendor/symfony/lib/util/sfBrowserBase.class.php +++ b/lib/vendor/symfony/lib/util/sfBrowserBase.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage util * @author Fabien Potencier - * @version SVN: $Id: sfBrowserBase.class.php 23901 2009-11-14 13:33:03Z bschussek $ + * @version SVN: $Id: sfBrowserBase.class.php 27836 2010-02-10 19:00:00Z Kris.Wallsmith $ */ abstract class sfBrowserBase { @@ -186,7 +186,7 @@ public function setAuth($username, $password) */ public function get($uri, $parameters = array(), $changeStack = true) { - return $this->call($uri, 'get', $parameters); + return $this->call($uri, 'get', $parameters, $changeStack); } /** @@ -200,7 +200,7 @@ public function get($uri, $parameters = array(), $changeStack = true) */ public function post($uri, $parameters = array(), $changeStack = true) { - return $this->call($uri, 'post', $parameters); + return $this->call($uri, 'post', $parameters, $changeStack); } /** @@ -805,6 +805,11 @@ public function doClickElement(DOMElement $item, $arguments = array(), $options $xpath = $this->getResponseDomXpath(); foreach ($xpath->query('descendant::input | descendant::textarea | descendant::select', $item) as $element) { + if ($element->hasAttribute('disabled')) + { + continue; + } + $elementName = $element->getAttribute('name'); $nodeName = $element->nodeName; $value = null; diff --git a/lib/vendor/symfony/lib/util/sfDomCssSelector.class.php b/lib/vendor/symfony/lib/util/sfDomCssSelector.class.php index bb332abd3..e38b460b8 100644 --- a/lib/vendor/symfony/lib/util/sfDomCssSelector.class.php +++ b/lib/vendor/symfony/lib/util/sfDomCssSelector.class.php @@ -19,7 +19,7 @@ * @package symfony * @subpackage util * @author Fabien Potencier - * @version SVN: $Id: sfDomCssSelector.class.php 23892 2009-11-14 11:37:55Z fabien $ + * @version SVN: $Id: sfDomCssSelector.class.php 26872 2010-01-19 10:50:05Z fabien $ */ class sfDomCssSelector implements Countable, Iterator { @@ -185,7 +185,7 @@ protected function getElementsForNode($selector, $root_node) { $attrName = $match[1]; $attrOperator = $match[2]; - $attrValue = $match[4]; + $attrValue = $match[4] ? $match[4] : $match[5]; switch ($attrOperator) { diff --git a/lib/vendor/symfony/lib/validator/sfValidatedFile.class.php b/lib/vendor/symfony/lib/validator/sfValidatedFile.class.php index bb0c50825..1954a43fb 100644 --- a/lib/vendor/symfony/lib/validator/sfValidatedFile.class.php +++ b/lib/vendor/symfony/lib/validator/sfValidatedFile.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage validator * @author Fabien Potencier - * @version SVN: $Id: sfValidatedFile.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $ + * @version SVN: $Id: sfValidatedFile.class.php 26264 2010-01-06 07:47:56Z fabien $ */ class sfValidatedFile { @@ -33,6 +33,7 @@ class sfValidatedFile * @param string $type The file content type * @param string $tempName The absolute temporary path to the file * @param int $size The file size (in bytes) + * @param string $path The path to save the file (optional). */ public function __construct($originalName, $type, $tempName, $size, $path = null) { diff --git a/lib/vendor/symfony/lib/validator/sfValidatorDate.class.php b/lib/vendor/symfony/lib/validator/sfValidatorDate.class.php index 07d8efc83..b13cd8ad2 100644 --- a/lib/vendor/symfony/lib/validator/sfValidatorDate.class.php +++ b/lib/vendor/symfony/lib/validator/sfValidatorDate.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage validator * @author Fabien Potencier - * @version SVN: $Id: sfValidatorDate.class.php 24628 2009-12-01 00:19:33Z Kris.Wallsmith $ + * @version SVN: $Id: sfValidatorDate.class.php 26871 2010-01-19 10:43:09Z fabien $ */ class sfValidatorDate extends sfValidatorBase { @@ -82,7 +82,7 @@ protected function doClean($value) } // convert timestamp to date number format - if (ctype_digit($value)) + if (is_numeric($value)) { $cleanTime = (integer) $value; $clean = date('YmdHis', $cleanTime); @@ -106,10 +106,10 @@ protected function doClean($value) if ($max = $this->getOption('max')) { // convert timestamp to date number format - if (ctype_digit($max)) + if (is_numeric($max)) { - $max = date('YmdHis', $max); $maxError = date($this->getOption('date_format_range_error'), $max); + $max = date('YmdHis', $max); } // convert string to date number else @@ -129,10 +129,10 @@ protected function doClean($value) if ($min = $this->getOption('min')) { // convert timestamp to date number - if (ctype_digit($min)) + if (is_numeric($min)) { - $min = date('YmdHis', $min); $minError = date($this->getOption('date_format_range_error'), $min); + $min = date('YmdHis', $min); } // convert string to date number else diff --git a/lib/vendor/symfony/lib/widget/sfWidgetFormSchema.class.php b/lib/vendor/symfony/lib/widget/sfWidgetFormSchema.class.php index a3bc36d7e..94f5d482f 100644 --- a/lib/vendor/symfony/lib/widget/sfWidgetFormSchema.class.php +++ b/lib/vendor/symfony/lib/widget/sfWidgetFormSchema.class.php @@ -16,7 +16,7 @@ * @package symfony * @subpackage widget * @author Fabien Potencier - * @version SVN: $Id: sfWidgetFormSchema.class.php 24963 2009-12-04 20:42:16Z FabianLange $ + * @version SVN: $Id: sfWidgetFormSchema.class.php 26870 2010-01-19 10:34:52Z fabien $ */ class sfWidgetFormSchema extends sfWidgetForm implements ArrayAccess { @@ -753,8 +753,8 @@ public function getPositions() */ public function setPositions(array $positions) { - $positions = array_values($positions); - $current = array_keys($this->fields); + $positions = array_unique(array_values($positions)); + $current = array_keys($this->fields); if ($diff = array_diff($positions, $current)) { diff --git a/lib/vendor/symfony/lib/widget/sfWidgetFormSelectCheckbox.class.php b/lib/vendor/symfony/lib/widget/sfWidgetFormSelectCheckbox.class.php index 2d4a71ca3..d33b18b4a 100644 --- a/lib/vendor/symfony/lib/widget/sfWidgetFormSelectCheckbox.class.php +++ b/lib/vendor/symfony/lib/widget/sfWidgetFormSelectCheckbox.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage widget * @author Fabien Potencier - * @version SVN: $Id: sfWidgetFormSelectCheckbox.class.php 23994 2009-11-15 22:55:24Z bschussek $ + * @version SVN: $Id: sfWidgetFormSelectCheckbox.class.php 27738 2010-02-08 15:07:33Z Kris.Wallsmith $ */ class sfWidgetFormSelectCheckbox extends sfWidgetFormChoiceBase { @@ -107,7 +107,7 @@ protected function formatChoices($name, $value, $choices, $attributes) $inputs[$id] = array( 'input' => $this->renderTag('input', array_merge($baseAttributes, $attributes)), - 'label' => $this->renderContentTag('label', $option, array('for' => $id)), + 'label' => $this->renderContentTag('label', self::escapeOnce($option), array('for' => $id)), ); } diff --git a/lib/vendor/symfony/lib/widget/sfWidgetFormSelectRadio.class.php b/lib/vendor/symfony/lib/widget/sfWidgetFormSelectRadio.class.php index 683049b89..23f615406 100644 --- a/lib/vendor/symfony/lib/widget/sfWidgetFormSelectRadio.class.php +++ b/lib/vendor/symfony/lib/widget/sfWidgetFormSelectRadio.class.php @@ -14,7 +14,7 @@ * @package symfony * @subpackage widget * @author Fabien Potencier - * @version SVN: $Id: sfWidgetFormSelectRadio.class.php 23994 2009-11-15 22:55:24Z bschussek $ + * @version SVN: $Id: sfWidgetFormSelectRadio.class.php 27738 2010-02-08 15:07:33Z Kris.Wallsmith $ */ class sfWidgetFormSelectRadio extends sfWidgetFormChoiceBase { @@ -102,7 +102,7 @@ protected function formatChoices($name, $value, $choices, $attributes) $inputs[$id] = array( 'input' => $this->renderTag('input', array_merge($baseAttributes, $attributes)), - 'label' => $this->renderContentTag('label', $option, array('for' => $id)), + 'label' => $this->renderContentTag('label', self::escapeOnce($option), array('for' => $id)), ); } diff --git a/lib/vendor/symfony/test/functional/escapingTest.php b/lib/vendor/symfony/test/functional/escapingTest.php index 92f32401b..3e47fce0d 100644 --- a/lib/vendor/symfony/test/functional/escapingTest.php +++ b/lib/vendor/symfony/test/functional/escapingTest.php @@ -16,28 +16,35 @@ $b = new sfTestBrowser(); -$b-> - get('/escaping/on')-> - with('request')->begin()-> - isParameter('module', 'escaping')-> - isParameter('action', 'on')-> - end()-> - with('response')->begin()-> - isStatusCode(200)-> - matches('#

    Lorem <strong>ipsum</strong> dolor sit amet.

    #')-> - matches('#

    Lorem <strong>ipsum</strong> dolor sit amet.

    #')-> - end() +$b->get('/escaping/on') + + ->with('request')->begin() + ->isParameter('module', 'escaping') + ->isParameter('action', 'on') + ->end() + + ->with('response')->begin() + ->isStatusCode(200) + ->matches('#

    Lorem <strong>ipsum</strong> dolor sit amet.

    #') + ->matches('#

    Lorem <strong>ipsum</strong> dolor sit amet.

    #') + ->matches('#

    Lorem <strong>ipsum</strong> dolor sit amet.

    #') + ->matches('#

    Lorem ipsum dolor sit amet.

    #') + ->matches('#
    Lorem <strong>ipsum</strong> dolor sit amet.
    #') + ->matches('#
    Lorem ipsum dolor sit amet.
    #') + ->checkElement('span.no', 2) + ->end() ; -$b-> - get('/escaping/off')-> - with('request')->begin()-> - isParameter('module', 'escaping')-> - isParameter('action', 'off')-> - end()-> - with('response')->begin()-> - isStatusCode(200)-> - matches('#

    Lorem ipsum dolor sit amet.

    #')-> - matches('#

    Lorem ipsum dolor sit amet.

    #')-> - end() +$b->get('/escaping/off') + + ->with('request')->begin() + ->isParameter('module', 'escaping') + ->isParameter('action', 'off') + ->end() + + ->with('response')->begin() + ->isStatusCode(200) + ->matches('#

    Lorem ipsum dolor sit amet.

    #') + ->matches('#

    Lorem ipsum dolor sit amet.

    #') + ->end() ; diff --git a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php index 99d066b3a..0a16565ec 100644 --- a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php +++ b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/actions/actions.class.php @@ -6,7 +6,7 @@ * @package project * @subpackage escaping * @author Fabien Potencier - * @version SVN: $Id: actions.class.php 20546 2009-07-28 07:13:31Z fabien $ + * @version SVN: $Id: actions.class.php 27755 2010-02-08 20:51:02Z Kris.Wallsmith $ */ class escapingActions extends sfActions { @@ -19,11 +19,11 @@ public function preExecute() public function executeOn() { - sfConfig::set('sf_escaping_strategy', 'on'); + sfConfig::set('sf_escaping_strategy', true); } public function executeOff() { - sfConfig::set('sf_escaping_strategy', 'off'); + sfConfig::set('sf_escaping_strategy', false); } } diff --git a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial1.php b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial1.php new file mode 100644 index 000000000..fe4fadcc8 --- /dev/null +++ b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial1.php @@ -0,0 +1,6 @@ +

    +

    getRaw('var') ?>

    + + + + $var, 'arr' => $arr)) ?> diff --git a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial2.php b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial2.php new file mode 100644 index 000000000..b0224e1d1 --- /dev/null +++ b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/_partial2.php @@ -0,0 +1,4 @@ +
    +
    getRaw('var') ?>
    + + diff --git a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php index 7d05dbaf9..5163d1079 100644 --- a/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php +++ b/lib/vendor/symfony/test/functional/fixtures/apps/frontend/modules/escaping/templates/indexSuccess.php @@ -1,2 +1,4 @@

    get('var') ?>

    + + $var, 'arr' => array())) ?> diff --git a/lib/vendor/symfony/test/unit/addon/sfPagerTest.php b/lib/vendor/symfony/test/unit/addon/sfPagerTest.php new file mode 100644 index 000000000..c1a8cfa3f --- /dev/null +++ b/lib/vendor/symfony/test/unit/addon/sfPagerTest.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); + +$t = new lime_test(2); +class myPager extends sfPager +{ + function init() {} + function retrieveObject($offset) {} + function getResults() + { + $this->setNbResults(2); + return array("foo", "bar"); + } +} + +$pager = new myPager("fooClass"); + +// #8021 +// ->rewind() +$t->diag('->rewind()'); +$countRuns = 0; +foreach ($pager as $item) +{ + $countRuns++; +} +$t->is($countRuns, $pager->count(), 'iterating first time will invoke on all items'); + +$countRuns = 0; +$pager->rewind(); +foreach ($pager as $item) +{ + $countRuns++; +} +$t->is($countRuns, $pager->count(), '->rewind will allow reiterating'); \ No newline at end of file diff --git a/lib/vendor/symfony/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php b/lib/vendor/symfony/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php index 9c9921da3..bed42dbe5 100644 --- a/lib/vendor/symfony/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php +++ b/lib/vendor/symfony/test/unit/escaper/sfOutputEscaperArrayDecoratorTest.php @@ -24,7 +24,7 @@ class sfException extends Exception sfConfig::set('sf_charset', 'UTF-8'); -$t = new lime_test(10); +$t = new lime_test(11); $a = array('escaped!', 1, null, array(2, 'escaped!')); $escaped = sfOutputEscaper::escape('esc_entities', $a); @@ -83,3 +83,9 @@ class sfException extends Exception $t->fail('The escaped object behaves like an array'); } } + +// ->valid() +$t->diag('->valid()'); + +$escaped = sfOutputEscaper::escape('esc_entities', array(1, 2, 3)); +$t->is($escaped->valid(), true, '->valid() returns true if called before iteration'); diff --git a/lib/vendor/symfony/test/unit/form/sfFormTest.php b/lib/vendor/symfony/test/unit/form/sfFormTest.php index 8fb0ddbe5..51cd50287 100644 --- a/lib/vendor/symfony/test/unit/form/sfFormTest.php +++ b/lib/vendor/symfony/test/unit/form/sfFormTest.php @@ -10,7 +10,7 @@ require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); -$t = new lime_test(155); +$t = new lime_test(157); class FormTest extends sfForm { @@ -82,6 +82,14 @@ public function configure() } } +class TestForm4 extends FormTest +{ + public function configure() + { + $this->enableLocalCSRFProtection($this->getOption('csrf_secret')); + } +} + sfForm::disableCSRFProtection(); // __construct() @@ -175,9 +183,15 @@ public function configure() $t->ok(!$f->isCSRFProtected(),'->disableLocalCSRFProtection() disabled CSRF protection for the current form, even if the global CSRF protection is enabled'); $f = new TestForm3(array(), array(), 'foo'); $t->ok(!$f->isCSRFProtected(),'->disableLocalCSRFProtection() disabled CSRF protection for the current form, even a CSRF secret is provided in the constructor'); +sfForm::disableCSRFProtection(); +$f = new TestForm4(); +$t->ok($f->isCSRFProtected(), '->enableLocalCSRFProtection() enables CSRF protection when passed null and global CSRF is disabled'); +$f = new TestForm4(array(), array('csrf_secret' => '**localsecret**')); +$t->ok($f->isCSRFProtected(), '->enableLocalCSRFProtection() enables CSRF protection when passed a string global CSRF is disabled'); // ::getCSRFFieldName() ::setCSRFFieldName() $t->diag('::getCSRFFieldName() ::setCSRFFieldName()'); +sfForm::enableCSRFProtection(); sfForm::setCSRFFieldName('_token_'); $f = new FormTest(); $v = $f->getValidatorSchema(); diff --git a/lib/vendor/symfony/test/unit/helper/NumberHelperTest.php b/lib/vendor/symfony/test/unit/helper/NumberHelperTest.php index c9a6c8297..e3ebb42cc 100644 --- a/lib/vendor/symfony/test/unit/helper/NumberHelperTest.php +++ b/lib/vendor/symfony/test/unit/helper/NumberHelperTest.php @@ -11,7 +11,7 @@ require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); require_once(dirname(__FILE__).'/../../../lib/helper/NumberHelper.php'); -$t = new lime_test(7); +$t = new lime_test(10); // format_number() $t->diag('format_number()'); @@ -26,3 +26,7 @@ $t->is(format_currency(1200000.10, 'USD', 'en'), '$1,200,000.10', 'format_currency() takes a number as its first argument'); $t->is(format_currency(1200000.101, 'USD', 'en'), '$1,200,000.10', 'format_currency() takes a number as its first argument'); $t->is(format_currency('1200000', 'USD', 'en'), '$1,200,000.00', 'format_currency() takes a number as its first argument'); + +$t->is(format_currency('11.50999', 'USD', 'en'), '$11.50', 'format_currency() takes a number as its first argument'); +$t->is(format_currency('11.50999', 'EUR', 'fr'), '11,50 €', 'format_currency() takes a number as its first argument'); +$t->is(format_currency('11.9999464', 'EUR', 'fr'), '11,99 €', 'format_currency() takes a number as its first argument'); diff --git a/lib/vendor/symfony/test/unit/routing/sfPatternRoutingTest.php b/lib/vendor/symfony/test/unit/routing/sfPatternRoutingTest.php index 31c9c106f..9a68f7584 100644 --- a/lib/vendor/symfony/test/unit/routing/sfPatternRoutingTest.php +++ b/lib/vendor/symfony/test/unit/routing/sfPatternRoutingTest.php @@ -10,7 +10,7 @@ require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); -$t = new lime_test(137); +$t = new lime_test(145); class sfPatternRoutingTest extends sfPatternRouting { @@ -42,7 +42,7 @@ public function isRouteLoaded($name) class sfAlwaysAbsoluteRoute extends sfRoute { - public function generate($params = array(), $context = array(), $absolute = false) + public function generate($params, $context = array(), $absolute = false) { $url = parent::generate($params, $context, $absolute); @@ -325,7 +325,6 @@ public function generate($params = array(), $context = array(), $absolute = fals // separators $t->diag('separators'); $r = new sfPatternRoutingTest(new sfEventDispatcher(), null, array_merge($options, array('segment_separators' => array('/', ';', ':', '|', '.', '-', '+')))); -$r->clearRoutes(); $r->connect('test', new sfRoute('/:module/:action;:foo::baz+static+:toto|:hip-:zozo.:format', array())); $r->connect('test0', new sfRoute('/:module/:action0', array())); $r->connect('test1', new sfRoute('/:module;:action1', array())); @@ -367,6 +366,27 @@ public function generate($params = array(), $context = array(), $absolute = fals $t->is($r->parse($url), $params, '->parse() recognizes parameters separated by mixed separators'); $t->is($r->generate('', $params), $url, '->generate() creates routes with mixed separators'); +// see ticket #8114 +$r = new sfPatternRoutingTest(new sfEventDispatcher(), null, array_merge($options, array('segment_separators' => array()))); +$r->connect('nosegment', new sfRoute('/:nonsegmented', array())); +$params = array('module' => 'default', 'action' => 'index', 'nonsegmented' => 'plainurl'); +$url = '/plainurl'; +$t->is($r->parse($url), $params, '->parse() works without segment_separators'); +$t->is($r->generate('', $params), $url, '->generate() works without segment_separators'); +$params = array('module' => 'default', 'action' => 'index', 'nonsegmented' => 'foo/bar/baz'); +$t->is($r->parse('/foo/bar/baz'), $params, '->parse() works without segment_separators'); +$t->is($r->generate('', $params), '/foo%2Fbar%2Fbaz', '->generate() works without segment_separators'); + +$r = new sfPatternRoutingTest(new sfEventDispatcher(), null, array_merge($options, array('segment_separators' => array('~')))); +$r->connect('nosegment', new sfRoute('/:nonsegmented', array())); +$params = array('module' => 'default', 'action' => 'index', 'nonsegmented' => 'plainurl'); +$url = '/plainurl'; +$t->is($r->parse($url), $params, '->parse() works with segment_separators which are not in url'); +$t->is($r->generate('', $params), $url, '->generate() works with segment_separators which are not in url'); +$params = array('module' => 'default', 'action' => 'index', 'nonsegmented' => 'foo/bar/baz'); +$t->is($r->parse('/foo/bar/baz'), $params, '->parse() works with segment_separators which are not in url'); +$t->is($r->generate('', $params), '/foo%2Fbar%2Fbaz', '->generate() works with segment_separators which are not in url'); + $r = new sfPatternRoutingTest(new sfEventDispatcher(), null, array_merge($options, array('variable_prefixes' => array(':', '$')))); // token names diff --git a/lib/vendor/symfony/test/unit/util/sfBrowserTest.php b/lib/vendor/symfony/test/unit/util/sfBrowserTest.php index bcff667d9..8983aa9ee 100644 --- a/lib/vendor/symfony/test/unit/util/sfBrowserTest.php +++ b/lib/vendor/symfony/test/unit/util/sfBrowserTest.php @@ -10,7 +10,7 @@ require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); -$t = new lime_test(70); +$t = new lime_test(71); // ->click() $t->diag('->click()'); @@ -56,6 +56,7 @@ public function getDefaultServerArray($name)
    +  ', '->render() escapes the choices'); + // __clone() $t->diag('__clone()'); $w = new sfWidgetFormSelectCheckbox(array('choices' => new sfCallable(array($w, 'foo')))); diff --git a/lib/vendor/symfony/test/unit/widget/sfWidgetFormSelectRadioTest.php b/lib/vendor/symfony/test/unit/widget/sfWidgetFormSelectRadioTest.php index 9a9ec556e..23243b49d 100644 --- a/lib/vendor/symfony/test/unit/widget/sfWidgetFormSelectRadioTest.php +++ b/lib/vendor/symfony/test/unit/widget/sfWidgetFormSelectRadioTest.php @@ -20,7 +20,7 @@ public function translate($subject, $parameters = array()) } } -$t = new lime_test(11); +$t = new lime_test(12); $dom = new DomDocument('1.0', 'utf-8'); $dom->validateOnParse = true; @@ -106,6 +106,12 @@ function choice_callable() ''; $t->is($w->render('foo'), $output, '->render() translates the options'); +// choices as escaped +$t->diag('choices are escaped'); + +$w = new sfWidgetFormSelectRadio(array('choices' => array('Hello world'))); +$t->is($w->render('foo'), '
    •  
    ', '->render() escapes the choices'); + // __clone() $t->diag('__clone()'); $w = new sfWidgetFormSelectRadio(array('choices' => new sfCallable(array($w, 'foo')))); diff --git a/symfony b/symfony index e28569c9c..b45db0907 100755 --- a/symfony +++ b/symfony @@ -9,6 +9,29 @@ * file that was distributed with this source code. */ -chdir(dirname(__FILE__)); -require_once(dirname(__FILE__).'/config/ProjectConfiguration.class.php'); -include(sfCoreAutoload::getInstance()->getBaseDir().'/command/cli.php'); +// project exists? +if (file_exists('config/ProjectConfiguration.class.php')) +{ + require_once('config/ProjectConfiguration.class.php'); + $dir = sfCoreAutoload::getInstance()->getBaseDir(); +} +else +{ + if (is_readable(dirname(__FILE__).'/../../lib/autoload/sfCoreAutoload.class.php')) + { + // SVN + $dir = realpath(dirname(__FILE__).'/../../lib'); + } + else + { + // PEAR + $dir = '@PEAR-DIR@/symfony'; + + if (!is_dir($dir)) + { + throw new Exception('Unable to find symfony libraries'); + } + } +} + +include($dir.'/command/cli.php');