Browse files

RELEASE_1_4_7 => v1.4.7 commit

  • Loading branch information...
1 parent 4da2a34 commit 928f88980d94acb53a5cf6f0cad1802ee8c064e8 @pylebecq pylebecq committed Oct 9, 2010
Showing with 1,154 additions and 520 deletions.
  1. +18 −0 CHANGELOG
  2. +5 −3 data/bin/changelog.php
  3. +2 −2 lib/autoload/sfCoreAutoload.class.php
  4. +6 −1 lib/controller/sfController.class.php
  5. +9 −2 lib/controller/sfWebController.class.php
  6. +11 −5 lib/debug/sfWebDebug.class.php
  7. +2 −2 lib/log/sfWebDebugLogger.class.php
  8. +11 −8 lib/plugins/sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php
  9. +2 −2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/paginationAction.php
  10. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php
  11. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/deleteAction.php
  12. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/editAction.php
  13. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/indexAction.php
  14. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/showAction.php
  15. +1 −1 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/updateAction.php
  16. +30 −2 lib/plugins/sfDoctrinePlugin/i18n/sf_admin.ru.xml
  17. +47 −7 lib/plugins/sfDoctrinePlugin/i18n/sf_admin.uk.xml
  18. +1 −9 lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php
  19. +1 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Adapter/Statement/Oracle.php
  20. +40 −5 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection.php
  21. +4 −4 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Column.php
  22. +4 −3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Compiler.php
  23. +5 −3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Mssql.php
  24. +21 −4 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Oracle.php
  25. +17 −5 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php
  26. +3 −13 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php
  27. +2 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Data/Export.php
  28. +14 −7 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Mssql.php
  29. +3 −3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Mysql.php
  30. +41 −10 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Pgsql.php
  31. +4 −4 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export.php
  32. +90 −38 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Mssql.php
  33. +40 −5 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Mysql.php
  34. +13 −13 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Pgsql.php
  35. +29 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Expression/Pgsql.php
  36. +3 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Formatter.php
  37. +13 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator.php
  38. +36 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Abstract.php
  39. +1 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/ArrayDriver.php
  40. +2 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/ArrayHierarchyDriver.php
  41. +23 −14 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/Graph.php
  42. +2 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Hydrator/RecordDriver.php
  43. +6 −6 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Mssql.php
  44. +4 −4 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Mysql.php
  45. +45 −28 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Pgsql.php
  46. +3 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Schema.php
  47. +5 −5 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Sqlite.php
  48. +1 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Inflector.php
  49. +3 −3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Manager.php
  50. +4 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Migration/Diff.php
  51. +1 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Pager.php
  52. +19 −11 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query.php
  53. +12 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Having.php
  54. +3 −3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Query/Where.php
  55. +32 −14 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php
  56. +4 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Search.php
  57. +152 −112 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Table.php
  58. +12 −8 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Task/RebuildDb.php
  59. +1 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Template/Listener/Sluggable.php
  60. +0 −1 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Template/SoftDelete.php
  61. +2 −2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Transaction.php
  62. +2 −2 lib/plugins/sfDoctrinePlugin/test/functional/AdminGenBrowser.class.php
  63. +3 −3 lib/plugins/sfDoctrinePlugin/test/functional/EnvironmentSetupTest.php
  64. +1 −1 lib/plugins/sfDoctrinePlugin/test/functional/PagerTest.php
  65. +1 −1 lib/plugins/sfDoctrinePlugin/test/functional/RouteTest.php
  66. +2 −2 lib/plugins/sfDoctrinePlugin/test/functional/Ticket/5269Test.php
  67. +3 −3 ...fDoctrinePlugin/test/functional/fixtures/apps/frontend/modules/articles/actions/actions.class.php
  68. +2 −2 lib/plugins/sfDoctrinePlugin/test/functional/fixtures/config/ProjectConfiguration.class.php
  69. +1 −1 lib/plugins/sfDoctrinePlugin/test/functional/fixtures/lib/model/doctrine/Author.class.php
  70. +2 −2 lib/plugins/sfDoctrinePlugin/test/functional/sfDoctrineRecordTest.php
  71. +15 −0 lib/plugins/sfDoctrinePlugin/test/unit/autoloaderTest.php
  72. +2 −2 lib/plugins/sfDoctrinePlugin/test/unit/form/sfFormDoctrineTest.php
  73. +2 −2 lib/plugins/sfDoctrinePlugin/test/unit/pager/sfDoctrinePagerTest.php
  74. +5 −5 lib/plugins/sfDoctrinePlugin/test/unit/sfDoctrineColumnTest.php
  75. +30 −2 lib/plugins/sfPropelPlugin/i18n/sf_admin.ru.xml
  76. +47 −7 lib/plugins/sfPropelPlugin/i18n/sf_admin.uk.xml
  77. +9 −2 lib/plugins/sfPropelPlugin/lib/mailer/Swift_PropelSpool.class.php
  78. BIN lib/plugins/sfPropelPlugin/test/functional/fixtures/data/database.sqlite
  79. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/ArticleTableMap.php
  80. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/AttachmentTableMap.php
  81. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/AuthorArticleTableMap.php
  82. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/AuthorTableMap.php
  83. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/BookTableMap.php
  84. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/CategoryTableMap.php
  85. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/MovieI18nTableMap.php
  86. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/MovieTableMap.php
  87. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/ProductI18nTableMap.php
  88. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/map/ProductTableMap.php
  89. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseArticle.php
  90. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseArticlePeer.php
  91. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAttachment.php
  92. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAttachmentPeer.php
  93. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAuthor.php
  94. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAuthorArticle.php
  95. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAuthorArticlePeer.php
  96. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseAuthorPeer.php
  97. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseBook.php
  98. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseBookPeer.php
  99. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseCategory.php
  100. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseCategoryPeer.php
  101. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseMovie.php
  102. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseMovieI18n.php
  103. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseMovieI18nPeer.php
  104. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseMoviePeer.php
  105. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseProduct.php
  106. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseProductI18n.php
  107. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseProductI18nPeer.php
  108. +1 −1 lib/plugins/sfPropelPlugin/test/functional/fixtures/lib/model/om/BaseProductPeer.php
  109. +49 −20 lib/request/sfWebRequest.class.php
  110. +2 −2 lib/task/generator/sfGenerateProjectTask.class.php
  111. +3 −3 lib/task/sfFilesystem.class.php
  112. +3 −2 lib/task/sfTask.class.php
  113. +6 −6 lib/util/sfFinder.class.php
  114. +2 −1 lib/validator/sfValidatedFile.class.php
  115. +3 −1 lib/widget/sfWidgetFormChoice.class.php
  116. +3 −1 lib/widget/sfWidgetFormDate.class.php
  117. +3 −1 lib/widget/sfWidgetFormDateRange.class.php
  118. +3 −1 lib/widget/sfWidgetFormDateTime.class.php
  119. +3 −1 lib/widget/sfWidgetFormFilterDate.class.php
  120. +3 −1 lib/widget/sfWidgetFormFilterInput.class.php
  121. +3 −1 lib/widget/sfWidgetFormInput.class.php
  122. +3 −1 lib/widget/sfWidgetFormInputCheckbox.class.php
  123. +3 −1 lib/widget/sfWidgetFormInputFile.class.php
  124. +3 −1 lib/widget/sfWidgetFormInputFileEditable.class.php
  125. +3 −1 lib/widget/sfWidgetFormInputHidden.class.php
  126. +3 −1 lib/widget/sfWidgetFormInputPassword.class.php
  127. +3 −1 lib/widget/sfWidgetFormInputText.class.php
  128. +3 −1 lib/widget/sfWidgetFormSchemaDecorator.class.php
  129. +3 −1 lib/widget/sfWidgetFormSelect.class.php
  130. +3 −1 lib/widget/sfWidgetFormSelectCheckbox.class.php
  131. +3 −1 lib/widget/sfWidgetFormSelectMany.class.php
  132. +3 −1 lib/widget/sfWidgetFormSelectRadio.class.php
  133. +5 −1 lib/widget/sfWidgetFormTextarea.class.php
  134. +3 −1 lib/widget/sfWidgetFormTime.class.php
View
18 CHANGELOG
@@ -1,3 +1,21 @@
+09/21/10: Version 1.4.7
+-----------------------
+
+ * [30951] fixed WDT injects multiple times (closes #9080)
+ * [30915] added support for "image/x-ms-bmp" mime type (closes #9069, patch from pbowyer)
+ * [30912] fixed view class overriding (closes #5097, patch from caefer)
+ * [30901] reverted remove of comments in Doctrine-generated table classes (closes #8880)
+ * [30900] fixed getUriPrefix() when requested is forwarded from a secure one (closes #4723)
+ * [30790] fixed logging of PHP errors to the WDT when error messages include a "%" character
+ * [30563] fixed sfWebController::redirect method does not respect HTTP specification (closes #8952, patch from rande)
+ * [30530] fixed path when a project is created on Windows and used on Linux (closes #8835)
+ * [30529] fixed Swift_PropelSpool when the message is stored in a GLOB column (closes #8869, #8558, patch from netounet)
+ * [30526] updated russian and ukrainian translation for the admin gen (closes #8814)
+ * [30445] added a check whether doctrine is already loaded to allow use of a compiled core (closes #8917, thanks gnukix)
+ * [30444] updated doctrine plugin to load Doctrine_Core rather than Doctrine
+ * [30442] changed remaining calls to `Doctrine` to `Doctrine_Core`
+ * [30441] Changed registration of Doctrine autoloader to use Doctrine_Core.
+
06/29/10: Version 1.4.6
-----------------------
View
8 data/bin/changelog.php
@@ -15,18 +15,20 @@
*
* @package symfony
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: changelog.php 24071 2009-11-17 07:36:21Z Kris.Wallsmith $
+ * @version SVN: $Id: changelog.php 30952 2010-09-22 02:22:51Z Kris.Wallsmith $
*/
require_once dirname(__FILE__).'/../../lib/task/sfFilesystem.class.php';
if (!isset($argv[1]))
{
- throw new Exception('You must provide a revision range (-r123:456)');
+ echo "You must provide a revision range (-r123:456)\n";
+ exit(1);
}
if (!isset($argv[2]))
{
- throw new Exception('You must provide a repository path (/branches/1.3)');
+ echo "You must provide a repository path (/branches/1.4)\n";
+ exit(1);
}
$filesystem = new sfFilesystem();
View
4 lib/autoload/sfCoreAutoload.class.php
@@ -11,7 +11,7 @@
/**
* The current symfony version.
*/
-define('SYMFONY_VERSION', '1.4.6');
+define('SYMFONY_VERSION', '1.4.7');
/**
* sfCoreAutoload class.
@@ -22,7 +22,7 @@
* @package symfony
* @subpackage autoload
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: sfCoreAutoload.class.php 30053 2010-06-29 17:06:07Z Kris.Wallsmith $
+ * @version SVN: $Id: sfCoreAutoload.class.php 30955 2010-09-22 02:35:27Z Kris.Wallsmith $
*/
class sfCoreAutoload
{
View
7 lib/controller/sfController.class.php
@@ -16,7 +16,7 @@
* @subpackage controller
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfController.class.php 29523 2010-05-19 12:50:54Z fabien $
+ * @version SVN: $Id: sfController.class.php 30912 2010-09-15 11:10:46Z fabien $
*/
abstract class sfController
{
@@ -203,7 +203,12 @@ public function forward($moduleName, $actionName)
$this->getActionStack()->addEntry($moduleName, $actionName, $actionInstance);
// include module configuration
+ $viewClass = sfConfig::get('mod_'.strtolower($moduleName).'_view_class', false);
require($this->context->getConfigCache()->checkConfig('modules/'.$moduleName.'/config/module.yml'));
+ if (false !== $viewClass)
+ {
+ sfConfig::set('mod_'.strtolower($moduleName).'_view_class', $viewClass);
+ }
// module enabled?
if (sfConfig::get('mod_'.strtolower($moduleName).'_enabled'))
View
11 lib/controller/sfWebController.class.php
@@ -16,7 +16,7 @@
* @subpackage controller
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Sean Kerr <sean@code-box.org>
- * @version SVN: $Id: sfWebController.class.php 28961 2010-04-01 14:17:52Z fabien $
+ * @version SVN: $Id: sfWebController.class.php 30563 2010-08-06 11:22:44Z fabien $
*/
abstract class sfWebController extends sfController
{
@@ -193,7 +193,14 @@ public function redirect($url, $delay = 0, $statusCode = 302)
$response = $this->context->getResponse();
$response->clearHttpHeaders();
$response->setStatusCode($statusCode);
- $response->setHttpHeader('Location', $url);
+
+ // The Location header should only be used for status codes 201 and 3..
+ // For other code, only the refresh meta tag is used
+ if ($statusCode == 201 || ($statusCode >= 300 && $statusCode < 400))
+ {
+ $response->setHttpHeader('Location', $url);
+ }
+
$response->setContent(sprintf('<html><head><meta http-equiv="refresh" content="%d;url=%s"/></head></html>', $delay, htmlspecialchars($url, ENT_QUOTES, sfConfig::get('sf_charset'))));
$response->send();
}
View
16 lib/debug/sfWebDebug.class.php
@@ -14,7 +14,7 @@
* @package symfony
* @subpackage debug
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: sfWebDebug.class.php 27284 2010-01-28 18:34:57Z Kris.Wallsmith $
+ * @version SVN: $Id: sfWebDebug.class.php 30951 2010-09-22 02:17:27Z Kris.Wallsmith $
*/
class sfWebDebug
{
@@ -154,15 +154,21 @@ public function getOption($name, $default = null)
*/
public function injectToolbar($content)
{
- $content = str_ireplace('</head>', '<style type="text/css">'.str_replace(array("\r", "\n"), ' ', $this->getStylesheet()).'</style></head>', $content);
+ if (false !== $pos = stripos($content, '</head>'))
+ {
+ $styles = '<style type="text/css">'.str_replace(array("\r", "\n"), ' ', $this->getStylesheet()).'</style>';
+ $content = substr($content, 0, $pos).$styles.substr($content, $pos);
+ }
$debug = $this->asHtml();
- $count = 0;
- $content = str_ireplace('</body>', '<script type="text/javascript">'.$this->getJavascript().'</script>'.$debug.'</body>', $content, $count);
- if (!$count)
+ if (false === $pos = strripos($content, '</body>'))
{
$content .= $debug;
}
+ else
+ {
+ $content = substr($content, 0, $pos).$debug.substr($content, $pos);
+ }
return $content;
}
View
4 lib/log/sfWebDebugLogger.class.php
@@ -14,7 +14,7 @@
* @package symfony
* @subpackage log
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
- * @version SVN: $Id: sfWebDebugLogger.class.php 22853 2009-10-07 12:11:15Z fabien $
+ * @version SVN: $Id: sfWebDebugLogger.class.php 30790 2010-08-31 13:23:50Z Kris.Wallsmith $
*/
class sfWebDebugLogger extends sfVarLogger
{
@@ -82,7 +82,7 @@ public function handlePhpError($errno, $errstr, $errfile, $errline, $errcontext
return false;
}
- $message = sprintf(' %%s at %s on line %s (%s)', $errfile, $errline, $errstr);
+ $message = sprintf(' %%s at %s on line %s (%s)', $errfile, $errline, str_replace('%', '%%', $errstr));
switch ($errno)
{
case E_STRICT:
View
19 lib/plugins/sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php
@@ -14,7 +14,7 @@
* @package symfony
* @subpackage doctrine
* @author Jonathan H. Wage <jonwage@gmail.com>
- * @version SVN: $Id: sfDoctrinePluginConfiguration.class.php 29156 2010-04-14 22:22:41Z bschussek $
+ * @version SVN: $Id: sfDoctrinePluginConfiguration.class.php 30445 2010-07-28 04:37:32Z Kris.Wallsmith $
*/
class sfDoctrinePluginConfiguration extends sfPluginConfiguration
{
@@ -37,15 +37,18 @@ public function initialize()
$this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelDoctrine', 'listenToAddPanelEvent'));
}
- require_once sfConfig::get('sf_doctrine_dir', realpath(dirname(__FILE__).'/../lib/vendor/doctrine')).'/Doctrine.php';
- spl_autoload_register(array('Doctrine', 'autoload'));
+ if (!class_exists('Doctrine_Core', false))
+ {
+ require_once sfConfig::get('sf_doctrine_dir', realpath(dirname(__FILE__).'/../lib/vendor/doctrine')).'/Doctrine/Core.php';
+ }
+ spl_autoload_register(array('Doctrine_Core', 'autoload'));
$manager = Doctrine_Manager::getInstance();
- $manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL);
- $manager->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_NONE);
- $manager->setAttribute(Doctrine::ATTR_RECURSIVE_MERGE_FIXTURES, true);
- $manager->setAttribute(Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
- $manager->setAttribute(Doctrine::ATTR_AUTOLOAD_TABLE_CLASSES, true);
+ $manager->setAttribute(Doctrine_Core::ATTR_EXPORT, Doctrine_Core::EXPORT_ALL);
+ $manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_NONE);
+ $manager->setAttribute(Doctrine_Core::ATTR_RECURSIVE_MERGE_FIXTURES, true);
+ $manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
+ $manager->setAttribute(Doctrine_Core::ATTR_AUTOLOAD_TABLE_CLASSES, true);
// apply default attributes
$manager->setDefaultAttributes();
View
4 ...plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/paginationAction.php
@@ -31,12 +31,12 @@ protected function buildQuery()
$query = $this->filters->buildQuery($this->getFilters());
<?php else: ?>
- $query = Doctrine::getTable('<?php echo $this->getModelClass() ?>')
+ $query = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')
->createQuery('a');
if ($tableMethod)
{
- $query = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->$tableMethod($query);
+ $query = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->$tableMethod($query);
}
<?php endif; ?>
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/admin/parts/sortingAction.php
@@ -37,5 +37,5 @@ protected function setSort(array $sort)
protected function isValidSortColumn($column)
{
- return Doctrine::getTable('<?php echo $this->getModelClass() ?>')->hasColumn($column);
+ return Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->hasColumn($column);
}
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/deleteAction.php
@@ -5,7 +5,7 @@ public function executeDelete(sfWebRequest $request)
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
$this->getRoute()->getObject()->delete();
<?php else: ?>
- $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
+ $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
$<?php echo $this->getSingularName() ?>->delete();
<?php endif; ?>
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/editAction.php
@@ -3,7 +3,7 @@ public function executeEdit(sfWebRequest $request)
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
$this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject());
<?php else: ?>
- $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
+ $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
$this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>);
<?php endif; ?>
}
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/indexAction.php
@@ -3,7 +3,7 @@ public function executeIndex(sfWebRequest $request)
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
$this-><?php echo $this->getPluralName() ?> = $this->getRoute()->getObjects();
<?php else: ?>
- $this-><?php echo $this->getPluralName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')
+ $this-><?php echo $this->getPluralName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')
->createQuery('a')
->execute();
<?php endif; ?>
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/showAction.php
@@ -3,7 +3,7 @@ public function executeShow(sfWebRequest $request)
<?php if (isset($this->params['with_doctrine_route']) && $this->params['with_doctrine_route']): ?>
$this-><?php echo $this->getSingularName() ?> = $this->getRoute()->getObject();
<?php else: ?>
- $this-><?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>));
+ $this-><?php echo $this->getSingularName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(65) ?>));
$this->forward404Unless($this-><?php echo $this->getSingularName() ?>);
<?php endif; ?>
}
View
2 lib/plugins/sfDoctrinePlugin/data/generator/sfDoctrineModule/default/parts/updateAction.php
@@ -4,7 +4,7 @@ public function executeUpdate(sfWebRequest $request)
$this->form = new <?php echo $this->getModelClass().'Form' ?>($this->getRoute()->getObject());
<?php else: ?>
$this->forward404Unless($request->isMethod(sfRequest::POST) || $request->isMethod(sfRequest::PUT));
- $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
+ $this->forward404Unless($<?php echo $this->getSingularName() ?> = Doctrine_Core::getTable('<?php echo $this->getModelClass() ?>')->find(array(<?php echo $this->getRetrieveByPkParamsForAction(43) ?>)), sprintf('Object <?php echo $this->getSingularName() ?> does not exist (%s).', <?php echo $this->getRetrieveByPkParamsForAction(43) ?>));
$this->form = new <?php echo $this->getModelClass().'Form' ?>($<?php echo $this->getSingularName() ?>);
<?php endif; ?>
View
32 lib/plugins/sfDoctrinePlugin/i18n/sf_admin.ru.xml
@@ -39,7 +39,11 @@
</trans-unit>
<trans-unit>
<source>go</source>
- <target>ок</target>
+ <target>Выполнить</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Back to list</source>
+ <target>Вернуться к списку</target>
</trans-unit>
<!-- Filters -->
@@ -123,7 +127,7 @@
</trans-unit>
<trans-unit>
<source>You must at least select one item.</source>
- <target>Вы должны выделить как-минимум один объект.</target>
+ <target>Вы должны выделить как минимум один объект.</target>
</trans-unit>
<trans-unit>
<source>You must select an action to execute on the selected items.</source>
@@ -141,6 +145,30 @@
<source>A problem occurs when deleting the selected items.</source>
<target>Возникла проблемма при удалении выделенных объектов.</target>
</trans-unit>
+ <trans-unit>
+ <source>is empty</source>
+ <target>пустое значение</target>
+ </trans-unit>
+ <trans-unit>
+ <source>yes or no</source>
+ <target>да или нет</target>
+ </trans-unit>
+ <trans-unit>
+ <source>yes</source>
+ <target>да</target>
+ </trans-unit>
+ <trans-unit>
+ <source>no</source>
+ <target>нет</target>
+ </trans-unit>
+ <trans-unit>
+ <source><![CDATA[from %from_date% to %to_date%]]></source>
+ <target><![CDATA[от %from_date% до %to_date%]]></target>
+ </trans-unit>
+ <trans-unit>
+ <source><![CDATA[from %from_date%<br />to %to_date%]]></source>
+ <target><![CDATA[от %from_date%<br />до %to_date%]]></target>
+ </trans-unit>
</body>
</file>
</xliff>
View
54 lib/plugins/sfDoctrinePlugin/i18n/sf_admin.uk.xml
@@ -31,7 +31,19 @@
</trans-unit>
<trans-unit>
<source>Cancel</source>
- <target>Відмінити</target>
+ <target>Скасувати</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Choose an action</source>
+ <target>Виберіть дію</target>
+ </trans-unit>
+ <trans-unit>
+ <source>go</source>
+ <target>Виконати</target>
+ </trans-unit>
+ <trans-unit>
+ <source>Back to list</source>
+ <target>Повернутися до списку</target>
</trans-unit>
<!-- Filters -->
@@ -65,6 +77,10 @@
<source>desc</source>
<target>(Я-А)</target>
</trans-unit>
+ <trans-unit>
+ <source>[0] no result|[1] 1 result|(1,+Inf] %1% results</source>
+ <target>[0] результат відсутній|[1] 1 результат|(1,+Inf] %1% результати(ів)</target>
+ </trans-unit>
<!-- Pagination -->
<trans-unit>
@@ -87,27 +103,27 @@
<!-- Form -->
<trans-unit>
<source>The item was created successfully.</source>
- <target>Запис створено успішно.</target>
+ <target>Запис успішно створено.</target>
</trans-unit>
<trans-unit>
<source>The item was updated successfully.</source>
- <target>Запис змінено успішно.</target>
+ <target>Запис успішно оновлено.</target>
</trans-unit>
<trans-unit>
<source>The item was created successfully. You can add another one below.</source>
- <target>Запис створено успішно. Можете додати наступний.</target>
+ <target>Запис успішно створено. Можете додати ще один.</target>
</trans-unit>
<trans-unit>
<source>The item was updated successfully. You can add another one below.</source>
- <target>Запис змінено успішно. Можете додати наступний.</target>
+ <target>Запис успішно змінено. Можете додати ще один.</target>
</trans-unit>
<trans-unit>
<source>The item has not been saved due to some errors.</source>
<target>Запис не було збережено через помилки.</target>
</trans-unit>
<trans-unit>
<source>The item was deleted successfully.</source>
- <target>Запис знищено успішно.</target>
+ <target>Запис успішно знищено.</target>
</trans-unit>
<trans-unit>
<source>You must at least select one item.</source>
@@ -123,12 +139,36 @@
</trans-unit>
<trans-unit>
<source>The selected items have been deleted successfully.</source>
- <target>Позначені записи знищено успішно.</target>
+ <target>Позначені записи успішно знищено.</target>
</trans-unit>
<trans-unit>
<source>A problem occurs when deleting the selected items.</source>
<target>При видаленні позначених записів виникла помилка.</target>
</trans-unit>
+ <trans-unit>
+ <source>is empty</source>
+ <target>пусте значення</target>
+ </trans-unit>
+ <trans-unit>
+ <source>yes or no</source>
+ <target>так чи ні</target>
+ </trans-unit>
+ <trans-unit>
+ <source>yes</source>
+ <target>так</target>
+ </trans-unit>
+ <trans-unit>
+ <source>no</source>
+ <target>ні</target>
+ </trans-unit>
+ <trans-unit>
+ <source><![CDATA[from %from_date% to %to_date%]]></source>
+ <target><![CDATA[від %from_date% до %to_date%]]></target>
+ </trans-unit>
+ <trans-unit>
+ <source><![CDATA[from %from_date%<br />to %to_date%]]></source>
+ <target><![CDATA[від %from_date%<br />до %to_date%]]></target>
+ </trans-unit>
</body>
</file>
</xliff>
View
10 lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildModelTask.class.php
@@ -18,7 +18,7 @@
* @subpackage doctrine
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @author Jonathan H. Wage <jonwage@gmail.com>
- * @version SVN: $Id: sfDoctrineBuildModelTask.class.php 24745 2009-12-02 02:14:05Z Kris.Wallsmith $
+ * @version SVN: $Id: sfDoctrineBuildModelTask.class.php 30901 2010-09-13 17:41:16Z Kris.Wallsmith $
*/
class sfDoctrineBuildModelTask extends sfDoctrineBaseTask
{
@@ -123,14 +123,6 @@ protected function execute($arguments = array(), $options = array())
$baseDirFinder = sfFinder::type('dir')->name('base');
$this->getFilesystem()->replaceTokens($baseFinder->in($baseDirFinder->in($config['models_path'])), '', '', $tokens);
- // cleanup new table classes
- $tableFinder = sfFinder::type('file')->prune('base')->name('*Table'.$builderOptions['suffix']);
- foreach (array_diff($tableFinder->in($config['models_path']), $before) as $file)
- {
- $contents = file_get_contents($file);
- file_put_contents($file, sfToolkit::stripComments($contents));
- }
-
$this->reloadAutoload();
}
}
View
2 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Adapter/Statement/Oracle.php
@@ -398,7 +398,7 @@ public function fetchColumn($columnIndex = 0)
return false;
}
$row = $this->fetch(Doctrine_Core::FETCH_NUM);
- return $row[$columnIndex];
+ return isset($row[$columnIndex]) ? $row[$columnIndex] : false;
}
/**
View
45 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Collection.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Collection.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Collection.php 7686 2010-08-24 16:54:40Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -28,7 +28,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7686 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Collection extends Doctrine_Access implements Countable, IteratorAggregate, Serializable
@@ -152,7 +152,7 @@ public function serialize()
$vars = get_object_vars($this);
unset($vars['reference']);
- unset($vars['reference_field']);
+ unset($vars['referenceField']);
unset($vars['relation']);
unset($vars['expandable']);
unset($vars['expanded']);
@@ -728,8 +728,8 @@ public function toHierarchy()
$collection = $this;
$table = $collection->getTable();
- if ( ! $table->hasTemplate('NestedSet')) {
- throw new Doctrine_Exception('Cannot hydrate model that does not have the NestedSet behavior enabled');
+ if ( ! $table->isTree() || ! $table->hasColumn('level')) {
+ throw new Doctrine_Exception('Cannot hydrate model that does not implements Tree behavior with `level` column');
}
// Trees mapped
@@ -920,6 +920,41 @@ public function save(Doctrine_Connection $conn = null, $processDiff = true)
}
/**
+ * Replaces all records of this collection and processes the
+ * difference of the last snapshot and the current data
+ *
+ * @param Doctrine_Connection $conn optional connection parameter
+ * @return Doctrine_Collection
+ */
+ public function replace(Doctrine_Connection $conn = null, $processDiff = true)
+ {
+ if ($conn == null) {
+ $conn = $this->_table->getConnection();
+ }
+
+ try {
+ $conn->beginInternalTransaction();
+
+ $conn->transaction->addCollection($this);
+
+ if ($processDiff) {
+ $this->processDiff();
+ }
+
+ foreach ($this->getData() as $key => $record) {
+ $record->replace($conn);
+ }
+
+ $conn->commit();
+ } catch (Exception $e) {
+ $conn->rollback();
+ throw $e;
+ }
+
+ return $this;
+ }
+
+ /**
* Deletes all records from this collection
*
* @return Doctrine_Collection
View
8 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Column.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Column.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Column.php 7663 2010-06-08 19:00:08Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
* @package Doctrine
* @subpackage Column
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
- * @version $Revision: 7490 $
+ * @version $Revision: 7663 $
* @link www.doctrine-project.org
* @since 1.0
*/
@@ -121,10 +121,10 @@ public function getEnumValues()
public function enumValue($index)
{
if ($index instanceof Doctrine_Null) {
- return $index;
+ return false;
}
- return isset($this->_definition['values'][$index]) ? $this->_definition['values'][$index] : $index;
+ return isset($this->_definition['values'][$index]) ? $this->_definition['values'][$index] : false;
}
/**
View
7 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Compiler.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Compiler.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Compiler.php 7677 2010-07-28 03:37:42Z kriswallsmith $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -29,7 +29,7 @@
* @license http://www.opensource.org/licenses/lgpllicense.php LGPL
* @link www.phpdoctrine.
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7677 $
*/
class Doctrine_Compiler
{
@@ -70,7 +70,8 @@ public static function compile($target = null, $includedDrivers = array())
//@todo what is a versioning file? do we have these anymore? None
//exists in my version of doctrine from svn.
// we don't want to require versioning files
- if (end($e) === 'php' && strpos($file->getFileName(), '.inc') === false) {
+ if (end($e) === 'php' && strpos($file->getFileName(), '.inc') === false
+ && strpos($file->getFileName(), 'sfYaml') === false) {
require_once $file->getPathName();
}
}
View
8 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Mssql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Mssql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Mssql.php 7659 2010-06-08 18:16:17Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
- * @version $Revision: 7490 $
+ * @version $Revision: 7659 $
* @link www.doctrine-project.org
* @since 1.0
*/
@@ -65,6 +65,8 @@ public function __construct(Doctrine_Manager $manager, $adapter)
'prepared_statements' => 'emulated',
);
+ $this->properties['varchar_max_length'] = 8000;
+
parent::__construct($manager, $adapter);
}
@@ -352,7 +354,7 @@ protected function replaceBoundParamsWithInlineValuesInQuery($query, array $para
$value = $this->quote($value);
}
- $re = '/([=,\(][^\\\']*)(\?)/iuU';
+ $re = '/([=,\(][^\\\']*)(\?)/iU';
$query = preg_replace($re, "\\1 {$value}", $query, 1);
View
25 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Oracle.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Oracle.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Oracle.php 7664 2010-06-08 19:10:14Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7664 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
*/
class Doctrine_Connection_Oracle extends Doctrine_Connection_Common
@@ -108,8 +108,8 @@ private function _createLimitSubquery($query, $limit, $offset, $column = null)
$column = $column === null ? '*' : $this->quoteIdentifier($column);
if ($offset > 0) {
$min = $offset + 1;
- $query = 'SELECT b.'.$column.' FROM ( '.
- 'SELECT a.*, ROWNUM AS doctrine_rownum FROM ( '
+ $query = 'SELECT '.$this->quoteIdentifier('b').'.'.$column.' FROM ( '.
+ 'SELECT '.$this->quoteIdentifier('a').'.*, ROWNUM AS doctrine_rownum FROM ( '
. $query . ' ) ' . $this->quoteIdentifier('a') . ' '.
' ) ' . $this->quoteIdentifier('b') . ' '.
'WHERE doctrine_rownum BETWEEN ' . $min . ' AND ' . $max;
@@ -142,4 +142,21 @@ public function getTmpConnection($info)
{
return clone $this;
}
+
+ /**
+ * Override quote behaviour for boolean to fix issues with quoting of
+ * boolean values.
+ */
+ public function quote($input, $type = null)
+ {
+ if ($type === 'boolean') {
+ if ($input === null) {
+ return null;
+ } else {
+ return $input ? 1 : 0;
+ }
+ } else {
+ return parent::quote($input, $type);
+ }
+ }
}
View
22 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/UnitOfWork.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: UnitOfWork.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: UnitOfWork.php 7684 2010-08-24 16:34:16Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -33,7 +33,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7684 $
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
*/
@@ -94,6 +94,8 @@ public function saveGraph(Doctrine_Record $record, $replace = false)
break;
}
+ $aliasesUnlinkInDb = array();
+
if ($isValid) {
// NOTE: what about referential integrity issues?
foreach ($record->getPendingDeletes() as $pendingDelete) {
@@ -103,8 +105,10 @@ public function saveGraph(Doctrine_Record $record, $replace = false)
foreach ($record->getPendingUnlinks() as $alias => $ids) {
if ($ids === false) {
$record->unlinkInDb($alias, array());
+ $aliasesUnlinkInDb[] = $alias;
} else if ($ids) {
$record->unlinkInDb($alias, array_keys($ids));
+ $aliasesUnlinkInDb[] = $alias;
}
}
$record->resetPendingUnlinks();
@@ -128,7 +132,8 @@ public function saveGraph(Doctrine_Record $record, $replace = false)
// check that the related object is not an instance of Doctrine_Null
if ($obj && ! ($obj instanceof Doctrine_Null)) {
- $obj->save($conn);
+ $processDiff = !in_array($alias, $aliasesUnlinkInDb);
+ $obj->save($conn, $processDiff);
}
}
}
@@ -595,7 +600,14 @@ public function replace(Doctrine_Record $record)
$table = $record->getTable();
$identifier = (array) $table->getIdentifier();
- $data = $record->getPrepared();
+ $data = $record->getPrepared();
+
+ foreach ($data as $key => $value) {
+ if ($value instanceof Doctrine_Expression) {
+ $data[$key] = $value->getSql();
+ }
+ }
+
$result = $this->conn->replace($table, $data, $identifier);
$record->invokeSaveHooks('post', 'insert', $insertEvent);
@@ -927,7 +939,7 @@ protected function _assignIdentifier(Doctrine_Record $record)
$id = false;
if ($record->$identifier == null) {
if (($driver = strtolower($this->conn->getDriverName())) == 'pgsql') {
- $seq = $table->getTableName() . '_' . $identifier;
+ $seq = $table->getTableName() . '_' . $table->getColumnName($identifier);
} elseif ($driver == 'oracle' || $driver == 'mssql') {
$seq = $table->getTableName();
}
View
16 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php
@@ -35,7 +35,7 @@ class Doctrine_Core
/**
* VERSION
*/
- const VERSION = '1.2.2';
+ const VERSION = '1.2.3';
/**
* ERROR CONSTANTS
@@ -582,16 +582,6 @@ public static function getExtensionsPath()
}
/**
- * Get all the loaded extension classes
- *
- * @return array $extensionClasses
- */
- public static function getExtensionsClasses()
- {
- return Doctrine_Manager::getInstance()->getExtensionsClasses();
- }
-
- /**
* Load an individual model name and path in to the model loading registry
*
* @return null
@@ -664,7 +654,7 @@ public static function loadModels($directory, $modelLoading = null, $classPrefix
$className = $e[0];
}
- if ($classPrefix) {
+ if ($classPrefix && $classPrefix != substr($className, 0, strlen($classPrefix))) {
$className = $classPrefix . $className;
}
@@ -1125,7 +1115,7 @@ public static function autoload($className)
return true;
}
- if (0 !== stripos($className, 'Doctrine_') || class_exists($className, false) || interface_exists($className, false)) {
+ if (0 !== stripos($className, 'Doctrine') || class_exists($className, false) || interface_exists($className, false)) {
return false;
}
View
3 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Data/Export.php
@@ -153,6 +153,7 @@ public function prepareData($data)
foreach ($data AS $className => $classData) {
$preparedData[$className] = array();
+ $keyType = $classData->getTable()->getIdentifierType();
foreach ($classData as $record) {
$className = get_class($record);
$recordKey = $className . '_' . implode('_', $record->identifier());
@@ -168,7 +169,7 @@ public function prepareData($data)
$keys = array($keys);
}
- if (count($keys) <= 1 && in_array($key, $keys)) {
+ if ($keyType !== Doctrine_Core::IDENTIFIER_NATURAL && count($keys) <= 1 && in_array($key, $keys)) {
continue;
}
View
21 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Mssql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Mssql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Mssql.php 7660 2010-06-08 18:30:22Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Frank M. Kromann <frank@kromann.info> (PEAR MDB2 Mssql driver)
* @author David Coallier <davidc@php.net> (PEAR MDB2 Mssql driver)
- * @version $Revision: 7490 $
+ * @version $Revision: 7660 $
* @link www.doctrine-project.org
* @since 1.0
*/
@@ -77,7 +77,7 @@ public function getNativeDeclaration($field)
$fixed = ((isset($field['fixed']) && $field['fixed']) || $field['type'] == 'char') ? true : false;
return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->varchar_max_length.')')
- : ($length ? 'VARCHAR('.$length.')' : 'TEXT');
+ : (($length && $length <= $this->conn->varchar_max_length) ? 'VARCHAR('.$length.')' : 'TEXT');
case 'clob':
if ( ! empty($field['length'])) {
$length = $field['length'];
@@ -245,9 +245,16 @@ public function getIntegerDeclaration($name, $field)
$field['default'] = empty($field['notnull']) ? null : 0;
}
- $default = ' DEFAULT ' . (is_null($field['default'])
+ $value = (is_null($field['default'])
? 'NULL'
: $this->conn->quote($field['default']));
+
+ // Name the constraint if a name has been supplied
+ if (array_key_exists('defaultConstraintName', $field)) {
+ $default .= ' CONSTRAINT ' . $field['defaultConstraintName'];
+ }
+
+ $default .= ' DEFAULT ' . $value;
}
@@ -256,11 +263,11 @@ public function getIntegerDeclaration($name, $field)
// MSSQL does not support the UNSIGNED keyword
$unsigned = '';
$comment = (isset($field['comment']) && $field['comment'])
- ? " COMMENT '" . $field['comment'] . "'" : '';
+ ? " COMMENT " . $this->conn->quote($field['comment'], 'text') : '';
$name = $this->conn->quoteIdentifier($name, true);
- return $name . ' ' . $this->getNativeDeclaration($field) . $unsigned
+ return $name . ' ' . $this->getNativeDeclaration($field) . $unsigned
. $default . $notnull . $autoinc . $comment;
}
-}
+}
View
6 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Mysql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Mysql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Mysql.php 7635 2010-06-08 13:56:17Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -25,7 +25,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
- * @version $Revision: 7490 $
+ * @version $Revision: 7635 $
* @link www.doctrine-project.org
* @since 1.0
*/
@@ -504,7 +504,7 @@ public function getIntegerDeclaration($name, $field)
$notnull = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : '';
$unsigned = (isset($field['unsigned']) && $field['unsigned']) ? ' UNSIGNED' : '';
$comment = (isset($field['comment']) && $field['comment'])
- ? " COMMENT '" . $field['comment'] . "'" : '';
+ ? " COMMENT " . $this->conn->quote($field['comment'], 'text') : '';
$name = $this->conn->quoteIdentifier($name, true);
View
51 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/DataDict/Pgsql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Pgsql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Pgsql.php 7641 2010-06-08 14:50:30Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -26,7 +26,7 @@
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @author Paul Cooper <pgc@ucecom.com>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
- * @version $Revision: 7490 $
+ * @version $Revision: 7641 $
* @link www.doctrine-project.org
* @since 1.0
*/
@@ -362,6 +362,12 @@ public function getNativeDeclaration(array $field)
if ( ! isset($field['type'])) {
throw new Doctrine_DataDict_Exception('Missing column type.');
}
+
+ // Postgres enum type by name containing enum
+ if (strpos($field['type'], 'enum') !== false){
+ $field['type'] = 'enum';
+ }
+
switch ($field['type']) {
case 'enum':
$field['length'] = isset($field['length']) && $field['length'] ? $field['length']:255;
@@ -454,14 +460,22 @@ public function getPortableDeclaration(array $field)
$dbType = strtolower($field['type']);
+ // Default from field for enum support
+ $default = isset($field['default']) ? $field['default'] : null;
+ $enumName = null;
+ if (strpos($dbType, 'enum') !== false){
+ $enumName = $dbType;
+ $dbType = 'enum';
+ }
+
switch ($dbType) {
- case 'inet':
- $type[] = 'inet';
- break;
- case 'bit':
- case 'varbit':
- $type[] = 'bit';
- break;
+ case 'inet':
+ $type[] = 'inet';
+ break;
+ case 'bit':
+ case 'varbit':
+ $type[] = 'bit';
+ break;
case 'smallint':
case 'int2':
$type[] = 'integer';
@@ -504,6 +518,7 @@ public function getPortableDeclaration(array $field)
case 'tsvector':
case 'unknown':
case 'char':
+ case 'character':
case 'bpchar':
$type[] = 'string';
if ($length == '1') {
@@ -518,6 +533,13 @@ public function getPortableDeclaration(array $field)
$fixed = true;
}
break;
+ case 'enum':
+ $type[] = 'enum';
+ $length = $length ? $length :255;
+ if($default) {
+ $default = preg_replace('/\'(\w+)\'.*/', '${1}', $default);
+ }
+ break;
case 'date':
$type[] = 'date';
$length = null;
@@ -577,10 +599,19 @@ public function getPortableDeclaration(array $field)
$length = isset($field['length']) ? $field['length']:null;
}
- return array('type' => $type,
+ $ret = array('type' => $type,
'length' => $length,
'unsigned' => $unsigned,
'fixed' => $fixed);
+
+ // If this is postgresql enum type we will have non-null values here
+ if ($default !== null) {
+ $ret['default'] = $default;
+ }
+ if ($enumName !== null) {
+ $ret['enumName'] = $enumName;
+ }
+ return $ret;
}
/**
View
8 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Export.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Export.php 7653 2010-06-08 15:54:31Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -29,7 +29,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7653 $
*/
class Doctrine_Export extends Doctrine_Connection_Module
{
@@ -148,7 +148,7 @@ public function dropConstraint($table, $name, $primary = false)
*/
public function dropForeignKey($table, $name)
{
- return $this->dropConstraint($table, $name);
+ return $this->dropConstraint($table, $this->conn->formatter->getForeignKeyName($name));
}
/**
@@ -1386,4 +1386,4 @@ public function exportTable(Doctrine_Table $table)
}
}
}
-}
+}
View
128 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Mssql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Mssql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Mssql.php 7660 2010-06-08 18:30:22Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -30,7 +30,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7660 $
*/
class Doctrine_Export_Mssql extends Doctrine_Export
{
@@ -191,23 +191,21 @@ public function alterTable($name, array $changes, $check = false)
}
}
- if( $check ) {
+ if ($check) {
return true;
}
$query = '';
- $post_queries = ''; //SQL Server uses a stored procedure to rename objects
+ $postQueries = ''; //SQL Server uses a stored procedure to rename objects
- //NAME (TABLE)
- if( !empty($changes['name']) )
- {
- $change_name = $this->conn->quoteIdentifier($changes['name'], true);
+ if ( ! empty($changes['name'])) {
+ $changeName = $this->conn->quoteIdentifier($changes['name'], true);
- $post_queries .= sprintf(
+ $postQueries .= sprintf(
"EXECUTE sp_RENAME '%s', '%s';",
$this->conn->quoteIdentifier($name),
- $change_name
+ $changeName
);
}
@@ -231,7 +229,7 @@ public function alterTable($name, array $changes, $check = false)
$dropped = array();
foreach ($changes['remove'] as $fieldName => $field) {
- $field_name = $this->conn->quoteIdentifier($fieldName, true);
+ $fieldName = $this->conn->quoteIdentifier($fieldName, true);
$dropped[] = $fieldName;
}
@@ -255,7 +253,6 @@ public function alterTable($name, array $changes, $check = false)
$altered = array();
foreach ($changes['change'] as $fieldName => $field) {
-
if (isset($rename[$fieldName])) {
$oldFieldName = $rename[$fieldName];
unset($rename[$fieldName]);
@@ -264,7 +261,31 @@ public function alterTable($name, array $changes, $check = false)
}
$oldFieldName = $this->conn->quoteIdentifier($oldFieldName, true);
- $altered[] = $this->getDeclaration($fieldName, $field['definition']);
+ $declaration = $this->getDeclaration($fieldName, $field['definition']);
+
+ if (preg_match('/(CONSTRAINT\s+([^\s]*)\s+DEFAULT\s+([^\s]*)\s*)|(DEFAULT\s+([^\s]*)\s*)/', $declaration, $matches)) {
+ // Remove the default constraint declaration from the statement
+ $altered[] = str_replace($matches[0], '', $declaration);
+
+ if (count($matches) === 6) {
+ // No constraint name provided. Try to make sure it's unique
+ $defaultName = 'DF__' . $name . '__' . $fieldName . '__' . mt_rand();
+ $defaultValue = $matches[5];
+ } else {
+ $defaultName = $matches[2];
+ $defaultValue = $matches[3];
+ }
+
+ $postQueries .= sprintf(
+ ' ALTER TABLE %s ADD CONSTRAINT %s DEFAULT (%s) FOR %s',
+ $name,
+ $defaultName,
+ $defaultValue,
+ $fieldName
+ );
+ } else {
+ $altered[] = $declaration;
+ }
}
$query .= implode(sprintf(
@@ -280,7 +301,7 @@ public function alterTable($name, array $changes, $check = false)
$field = $changes['rename'][$renamedField];
$renamedField = $this->conn->quoteIdentifier($renamedField);
- $post_queries .= sprintf(
+ $postQueries .= sprintf(
"EXECUTE sp_RENAME '%s.%s', '%s', 'COLUMN';",
$this->conn->quoteIdentifier($name),
$renamedField,
@@ -289,24 +310,22 @@ public function alterTable($name, array $changes, $check = false)
}
}
- if ( !$query && !$post_queries) {
+ if ( ! $query && ! $postQueries) {
return false;
}
$name = $this->conn->quoteIdentifier($name, true);
- $final_query = '';
- if( $query )
- {
- $final_query .= 'ALTER TABLE ' . $name . ' ' . trim($query) . ';';
- }
+ $finalQuery = '';
+ if ($query) {
+ $finalQuery .= 'ALTER TABLE ' . $name . ' ' . trim($query) . ';';
+ }
- if( $post_queries )
- {
- $final_query .= $post_queries;
+ if ($postQueries) {
+ $finalQuery .= $postQueries;
}
- return $this->conn->exec($final_query);
+ return $this->conn->exec($finalQuery);
}
/**
@@ -395,22 +414,19 @@ public function createTableSql($name, array $fields, array $options = array())
throw new Doctrine_Export_Exception('no fields specified for table ' . $name);
}
- if( !isset($options['primary']) ) //Use field declaration of primary if the primary option not set
- {
- foreach( $fields as $field_name => $field_data )
- {
- if( isset($field_data['primary']) && $field_data['primary'] )
- $options['primary'][$field_name] = $field_name;
+ // Use field declaration of primary if the primary option not set
+ if ( ! isset($options['primary'])) {
+ foreach ($fields as $fieldName => $fieldData) {
+ if (isset($fieldData['primary']) && $fieldData['primary']) {
+ $options['primary'][$fieldName] = $fieldName;
+ }
}
}
- if( isset($options['primary']) )
- {
- foreach( $options['primary'] as $field_name )
- {
- if( isset($fields[$field_name]) )
- {
- $fields[$field_name]['notnull'] = true; //Silently forcing NOT NULL as MSSQL will kill a query that has a nullable PK
+ if (isset($options['primary'])) {
+ foreach ($options['primary'] as $fieldName) {
+ if (isset($fields[$fieldName])) {
+ $fields[$fieldName]['notnull'] = true; //Silently forcing NOT NULL as MSSQL will kill a query that has a nullable PK
}
}
}
@@ -443,7 +459,6 @@ public function createTableSql($name, array $fields, array $options = array())
}
if (isset($options['foreignKeys'])) {
-
foreach ((array) $options['foreignKeys'] as $k => $definition) {
if (is_array($definition)) {
$sql[] = $this->createForeignKeySql($name, $definition);
@@ -469,4 +484,41 @@ public function getNotNullFieldDeclaration(array $definition)
(isset($definition['primary']) && $definition['primary'])
) ? ' NOT NULL' : ' NULL';
}
+
+ /**
+ * @see Doctrine_Export::getDefaultFieldDeclaration
+ *
+ * @param array $field field definition array
+ * @return string DBMS specific SQL code portion needed to set a default value
+ */
+ public function getDefaultFieldDeclaration($field)
+ {
+ $default = '';
+
+ if (array_key_exists('default', $field)) {
+ if ($field['default'] === '') {
+ $field['default'] = empty($field['notnull'])
+ ? null : $this->valid_default_values[$field['type']];
+
+ if ($field['default'] === '' &&
+ ($this->conn->getAttribute(Doctrine_Core::ATTR_PORTABILITY) & Doctrine_Core::PORTABILITY_EMPTY_TO_NULL)) {
+ $field['default'] = null;
+ }
+ }
+
+ if ($field['type'] === 'boolean') {
+ $field['default'] = $this->conn->convertBooleans($field['default']);
+ }
+
+ if (array_key_exists('defaultConstraintName', $field)) {
+ $default .= ' CONSTRAINT ' . $field['defaultConstraintName'];
+ }
+
+ $default .= ' DEFAULT ' . (is_null($field['default'])
+ ? 'NULL'
+ : $this->conn->quote($field['default'], $field['type']));
+ }
+
+ return $default;
+ }
}
View
45 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Mysql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Mysql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Mysql.php 7653 2010-06-08 15:54:31Z jwage $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -29,7 +29,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7653 $
*/
class Doctrine_Export_Mysql extends Doctrine_Export
{
@@ -160,6 +160,17 @@ public function createTableSql($name, array $fields, array $options = array())
// add all indexes
if (isset($options['indexes']) && ! empty($options['indexes'])) {
+ // Case Insensitive checking for duplicate indexes...
+ $dupes = array();
+ foreach ($options['indexes'] as $key => $index) {
+ if (in_array(strtolower($key), $dupes)) {
+ unset($options['indexes'][$key]);
+ } else {
+ $dupes[] = strtolower($key);
+ }
+ }
+ unset($dupes);
+
foreach($options['indexes'] as $index => $definition) {
$queryFields .= ', ' . $this->getIndexDeclaration($index, $definition);
}
@@ -267,7 +278,7 @@ public function getDeclaration($name, array $field)
' ' . $field['check'] : '';
$comment = (isset($field['comment']) && $field['comment']) ?
- " COMMENT '" . $field['comment'] . "'" : '';
+ " COMMENT " . $this->conn->quote($field['comment'], 'text') : '';
$method = 'get' . $field['type'] . 'Declaration';
@@ -718,6 +729,30 @@ public function getIndexFieldDeclarationList(array $fields)
}
/**
+ * Returns a character set declaration.
+ *
+ * @param string $charset A character set
+ *
+ * @return string A character set declaration
+ */
+ public function getCharsetFieldDeclaration($charset)
+ {
+ return $this->conn->dataDict->getCharsetFieldDeclaration($charset);
+ }
+
+ /**
+ * Returns a collation declaration.
+ *
+ * @param string $collation A collation
+ *
+ * @return string A collation declaration
+ */
+ public function getCollationFieldDeclaration($collation)
+ {
+ return $this->conn->dataDict->getCollationFieldDeclaration($collation);
+ }
+
+ /**
* getAdvancedForeignKeyOptions
* Return the FOREIGN KEY query section dealing with non-standard options
* as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
@@ -777,8 +812,8 @@ public function dropTableSql($table)
public function dropForeignKey($table, $name)
{
$table = $this->conn->quoteIdentifier($table);
- $name = $this->conn->quoteIdentifier($name);
+ $name = $this->conn->quoteIdentifier($this->conn->formatter->getForeignKeyName($name));
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $name);
}
-}
+}
View
26 lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Export/Pgsql.php
@@ -1,6 +1,6 @@
<?php
/*
- * $Id: Pgsql.php 7490 2010-03-29 19:53:27Z jwage $
+ * $Id: Pgsql.php 7680 2010-08-19 14:08:28Z lsmith $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -29,7 +29,7 @@
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 1.0
- * @version $Revision: 7490 $
+ * @version $Revision: 7680 $
*/
class Doctrine_Export_Pgsql extends Doctrine_Export
{
@@ -131,52 +131,52 @@ public function alterTableSql($name, array $changes, $check = false)
if (isset($changes['add']) && is_array($changes['add'])) {
foreach ($changes['add'] as $fieldName => $field) {
$query = 'ADD ' . $this->getDeclaration($fieldName, $field);
- $sql[] = 'ALTER TABLE ' . $name . ' ' . $query;
+ $sql[] = 'ALTER TABLE ' . $this->conn->quoteIdentifier($name, true) . ' ' . $query;
}
}
if (isset($changes['remove']) && is_array($changes['remove'])) {
foreach ($changes['remove'] as $fieldName => $field) {
$fieldName = $this->conn->quoteIdentifier($fieldName, true);
$query = 'DROP ' . $fieldName;
- $sql[] = 'ALTER TABLE ' . $name . ' ' . $query;
+ $sql[] = 'ALTER TABLE ' . $this->conn->quoteIdentifier($name, true) . ' ' . $query;
}
}
if (isset($changes['change']) && is_array($changes['change'])) {
foreach ($changes['change'] as $fieldName => $field) {
$fieldName = $this->conn->quoteIdentifier($fieldName, true);
- if (isset($field['type'])) {
+ if (isset($field['definition']['type'])) {
$serverInfo = $this->conn->getServerVersion();
if (is_array($serverInfo) && $serverInfo['major'] < 8) {
throw new Doctrine_Export_Exception('changing column type for "'.$field['type'].'\" requires PostgreSQL 8.0 or above');
}
- $query = 'ALTER ' . $fieldName . ' TYPE ' . $this->conn->datatype->getTypeDeclaration($field['definition']);
- $sql[] = 'ALTER TABLE ' . $name . ' ' . $query;
+ $query = 'ALTER ' . $fieldName . ' TYPE ' . $this->conn->dataDict->getNativeDeclaration($field['definition']);
+ $sql[] = 'ALTER TABLE ' . $this->conn->quoteIdentifier($name, true) . ' ' . $query;
}