Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 90eac7c

Browse files
committed
RELEASE_1_4_10 => v1.4.10 commit
1 parent 63e21e2 commit 90eac7c

File tree

73 files changed

+198
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+198
-335
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
03/21/11: Version 1.4.10
2+
------------------------
3+
4+
* Updated to Doctrine 1.2.4 (security release)
5+
16
02/04/11: Version 1.4.9
27
-----------------------
38

lib/autoload/sfCoreAutoload.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* The current symfony version.
1313
*/
14-
define('SYMFONY_VERSION', '1.4.9');
14+
define('SYMFONY_VERSION', '1.4.10');
1515

1616
/**
1717
* sfCoreAutoload class.
@@ -22,7 +22,7 @@
2222
* @package symfony
2323
* @subpackage autoload
2424
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
25-
* @version SVN: $Id: sfCoreAutoload.class.php 31977 2011-02-04 14:42:19Z Kris.Wallsmith $
25+
* @version SVN: $Id: sfCoreAutoload.class.php 32327 2011-03-21 15:47:58Z Kris.Wallsmith $
2626
*/
2727
class sfCoreAutoload
2828
{

lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Db2.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* $Id: Db2.php 7490 2010-03-29 19:53:27Z jwage $
3+
* $Id: Db2.php 7696 2011-03-21 12:10:28Z beberlei $
44
*
55
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
2727
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
2828
* @link www.doctrine-project.org
2929
* @since 1.0
30-
* @version $Revision: 7490 $
30+
* @version $Revision: 7696 $
3131
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
3232
*/
3333
class Doctrine_Connection_Db2 extends Doctrine_Connection_Common
@@ -46,7 +46,7 @@ public function modifyLimitQuery($query, $limit = false, $offset = false, $isMan
4646
return $query;
4747

4848
if ($offset == 0) {
49-
return $query . ' FETCH FIRST '. $limit .' ROWS ONLY';
49+
return $query . ' FETCH FIRST '. (int)$limit .' ROWS ONLY';
5050
} else {
5151
$sqlPieces = explode('from', $query);
5252
$select = $sqlPieces[0];
@@ -56,8 +56,8 @@ public function modifyLimitQuery($query, $limit = false, $offset = false, $isMan
5656

5757
$sql = 'WITH OFFSET AS(' . $select . ', ROW_NUMBER() ' .
5858
'OVER(ORDER BY ' . $col[1] . ') AS doctrine_rownum FROM ' . $table . ')' .
59-
$select . 'FROM OFFSET WHERE doctrine_rownum BETWEEN ' . $offset .
60-
'AND ' . ($offset + $limit - 1);
59+
$select . 'FROM OFFSET WHERE doctrine_rownum BETWEEN ' . (int)$offset .
60+
'AND ' . ((int)$offset + (int)$limit - 1);
6161
return $sql;
6262
}
6363
}

lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Mssql.php

Lines changed: 77 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* $Id: Mssql.php 7691 2011-02-04 15:43:29Z jwage $
3+
* $Id: Mssql.php 7659 2010-06-08 18:16:17Z jwage $
44
*
55
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
2727
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
2828
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
2929
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30-
* @version $Revision: 7691 $
30+
* @version $Revision: 7659 $
3131
* @link www.doctrine-project.org
3232
* @since 1.0
3333
*/
@@ -140,152 +140,98 @@ public function quoteIdentifier($identifier, $checkOption = false)
140140
* @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html
141141
* @return string
142142
*/
143-
public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false, $isSubQuery = false, Doctrine_Query $queryOrigin = null)
143+
public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false, $isSubQuery = false)
144144
{
145-
if ($limit === false || !($limit > 0)) {
146-
return $query;
147-
}
148-
149-
$orderby = stristr($query, 'ORDER BY');
145+
if ($limit > 0) {
146+
$count = intval($limit);
147+
$offset = intval($offset);
150148

151-
if ($offset !== false && $orderby === false) {
152-
throw new Doctrine_Connection_Exception("OFFSET cannot be used in MSSQL without ORDER BY due to emulation reasons.");
153-
}
154-
155-
$count = intval($limit);
156-
$offset = intval($offset);
149+
if ($offset < 0) {
150+
throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid");
151+
}
157152

158-
if ($offset < 0) {
159-
throw new Doctrine_Connection_Exception("LIMIT argument offset=$offset is not valid");
160-
}
153+
$orderby = stristr($query, 'ORDER BY');
161154

162-
$orderbySql = $queryOrigin->getSqlQueryPart('orderby');
163-
$orderbyDql = $queryOrigin->getDqlPart('orderby');
155+
if ($orderby !== false) {
156+
// Ticket #1835: Fix for ORDER BY alias
157+
// Ticket #2050: Fix for multiple ORDER BY clause
158+
$order = str_ireplace('ORDER BY', '', $orderby);
159+
$orders = explode(',', $order);
164160

165-
if ($orderby !== false) {
166-
$orders = $this->parseOrderBy(implode(', ', $queryOrigin->getDqlPart('orderby')));
161+
for ($i = 0; $i < count($orders); $i++) {
162+
$sorts[$i] = (stripos($orders[$i], ' desc') !== false) ? 'DESC' : 'ASC';
163+
$orders[$i] = trim(preg_replace('/\s+(ASC|DESC)$/i', '', $orders[$i]));
167164

168-
for ($i = 0; $i < count($orders); $i++) {
169-
$sorts[$i] = (stripos($orders[$i], ' desc') !== false) ? 'DESC' : 'ASC';
170-
$orders[$i] = trim(preg_replace('/\s+(ASC|DESC)$/i', '', $orders[$i]));
165+
// find alias in query string
166+
$helper_string = stristr($query, $orders[$i]);
171167

172-
list($fieldAliases[$i], $fields[$i]) = strstr($orders[$i], '.') ? explode('.', $orders[$i]) : array('', $orders[$i]);
173-
$columnAlias[$i] = $queryOrigin->getSqlTableAlias($queryOrigin->getExpressionOwner($orders[$i]));
168+
$from_clause_pos = strpos($helper_string, ' FROM ');
169+
$fields_string = substr($helper_string, 0, $from_clause_pos + 1);
174170

175-
$cmp = $queryOrigin->getQueryComponent($queryOrigin->getExpressionOwner($orders[$i]));
176-
$tables[$i] = $cmp['table'];
177-
$columns[$i] = $cmp['table']->getColumnName($fields[$i]);
171+
$field_array = explode(',', $fields_string);
172+
$field_array = array_shift($field_array);
173+
$aux2 = spliti(' as ', $field_array);
174+
$aux2 = explode('.', end($aux2));
178175

179-
// TODO: This sould be refactored as method called Doctrine_Table::getColumnAlias(<column name>).
180-
$aliases[$i] = $columnAlias[$i] . '__' . $columns[$i];
176+
$aliases[$i] = trim(end($aux2));
177+
}
181178
}
182-
}
183-
184-
// Ticket #1259: Fix for limit-subquery in MSSQL
185-
$selectRegExp = 'SELECT\s+';
186-
$selectReplace = 'SELECT ';
187-
188-
if (preg_match('/^SELECT(\s+)DISTINCT/i', $query)) {
189-
$selectRegExp .= 'DISTINCT\s+';
190-
$selectReplace .= 'DISTINCT ';
191-
}
192-
193-
$fields_string = substr($query, strlen($selectReplace), strpos($query, ' FROM ') - strlen($selectReplace));
194-
$field_array = explode(',', $fields_string);
195-
$field_array = array_shift($field_array);
196-
$aux2 = preg_split('/ as /i', $field_array);
197-
$aux2 = explode('.', end($aux2));
198-
$key_field = trim(end($aux2));
199179

200-
$query = preg_replace('/^'.$selectRegExp.'/i', $selectReplace . 'TOP ' . ($count + $offset) . ' ', $query);
180+
// Ticket #1259: Fix for limit-subquery in MSSQL
181+
$selectRegExp = 'SELECT\s+';
182+
$selectReplace = 'SELECT ';
201183

202-
if ($isSubQuery === true) {
203-
$query = 'SELECT TOP ' . $count . ' ' . $this->quoteIdentifier('inner_tbl') . '.' . $key_field . ' FROM (' . $query . ') AS ' . $this->quoteIdentifier('inner_tbl');
204-
} else {
205-
$query = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $query . ') AS ' . $this->quoteIdentifier('inner_tbl');
206-
}
184+
if (preg_match('/^SELECT(\s+)DISTINCT/i', $query)) {
185+
$selectRegExp .= 'DISTINCT\s+';
186+
$selectReplace .= 'DISTINCT ';
187+
}
207188

208-
if ($orderby !== false) {
209-
$query .= ' ORDER BY ';
189+
$fields_string = substr($query, strlen($selectReplace), strpos($query, ' FROM ') - strlen($selectReplace));
190+
$field_array = explode(',', $fields_string);
191+
$field_array = array_shift($field_array);
192+
$aux2 = spliti(' as ', $field_array);
193+
$aux2 = explode('.', end($aux2));
194+
$key_field = trim(end($aux2));
210195

211-
for ($i = 0, $l = count($orders); $i < $l; $i++) {
212-
if ($i > 0) { // not first order clause
213-
$query .= ', ';
214-
}
196+
$query = preg_replace('/^'.$selectRegExp.'/i', $selectReplace . 'TOP ' . ($count + $offset) . ' ', $query);
215197

216-
$query .= $this->modifyOrderByColumn($tables[$i], $columns[$i], $this->quoteIdentifier('inner_tbl') . '.' . $this->quoteIdentifier($aliases[$i])) . ' ';
217-
$query .= (stripos($sorts[$i], 'asc') !== false) ? 'DESC' : 'ASC';
198+
if ($isSubQuery === true) {
199+
$query = 'SELECT TOP ' . $count . ' ' . $this->quoteIdentifier('inner_tbl') . '.' . $key_field . ' FROM (' . $query . ') AS ' . $this->quoteIdentifier('inner_tbl');
200+
} else {
201+
$query = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $query . ') AS ' . $this->quoteIdentifier('inner_tbl');
218202
}
219-
}
220-
221-
if ($isSubQuery !== true) {
222-
$query .= ') AS ' . $this->quoteIdentifier('outer_tbl');
223203

224204
if ($orderby !== false) {
225-
$query .= ' ORDER BY ';
205+
$query .= ' ORDER BY ';
226206

227-
for ($i = 0, $l = count($orders); $i < $l; $i++) {
228-
if ($i > 0) { // not first order clause
229-
$query .= ', ';
230-
}
207+
for ($i = 0, $l = count($orders); $i < $l; $i++) {
208+
if ($i > 0) { // not first order clause
209+
$query .= ', ';
210+
}
231211

232-
$query .= $this->modifyOrderByColumn($tables[$i], $columns[$i], $this->quoteIdentifier('outer_tbl') . '.' . $this->quoteIdentifier($aliases[$i])) . ' ' . $sorts[$i];
212+
$query .= $this->quoteIdentifier('inner_tbl') . '.' . $aliases[$i] . ' ';
213+
$query .= (stripos($sorts[$i], 'asc') !== false) ? 'DESC' : 'ASC';
233214
}
234215
}
235-
}
236216

237-
return $query;
238-
}
217+
if ($isSubQuery !== true) {
218+
$query .= ') AS ' . $this->quoteIdentifier('outer_tbl');
239219

240-
/**
241-
* Parse an OrderBy-Statement into chunks
242-
*
243-
* @param string $orderby
244-
*/
245-
private function parseOrderBy($orderby)
246-
{
247-
$matches = array();
248-
$chunks = array();
249-
$tokens = array();
250-
$parsed = str_ireplace('ORDER BY', '', $orderby);
220+
if ($orderby !== false) {
221+
$query .= ' ORDER BY ';
251222

252-
preg_match_all('/(\w+\(.+?\)\s+(ASC|DESC)),?/', $orderby, $matches);
253-
254-
$matchesWithExpressions = $matches[1];
223+
for ($i = 0, $l = count($orders); $i < $l; $i++) {
224+
if ($i > 0) { // not first order clause
225+
$query .= ', ';
226+
}
255227

256-
foreach ($matchesWithExpressions as $match) {
257-
$chunks[] = $match;
258-
$parsed = str_replace($match, '##' . (count($chunks) - 1) . '##', $parsed);
259-
}
260-
261-
$tokens = preg_split('/,/', $parsed);
262-
263-
for ($i = 0, $iMax = count($tokens); $i < $iMax; $i++) {
264-
$tokens[$i] = trim(preg_replace('/##(\d+)##/e', "\$chunks[\\1]", $tokens[$i]));
228+
$query .= $this->quoteIdentifier('outer_tbl') . '.' . $aliases[$i] . ' ' . $sorts[$i];
229+
}
230+
}
231+
}
265232
}
266233

267-
return $tokens;
268-
}
269-
270-
/**
271-
* Order and Group By are not possible on columns from type text.
272-
* This method fix this issue by wrap the given term (column) into a CAST directive.
273-
*
274-
* @see DC-828
275-
* @param Doctrine_Table $table
276-
* @param string $field
277-
* @param string $term The term which will changed if it's necessary, depending to the field type.
278-
* @return string
279-
*/
280-
public function modifyOrderByColumn(Doctrine_Table $table, $field, $term)
281-
{
282-
$def = $table->getDefinitionOf($field);
283-
284-
if ($def['type'] == 'string' && $def['length'] === NULL) {
285-
$term = 'CAST(' . $term . ' AS varchar(8000))';
286-
}
287-
288-
return $term;
234+
return $query;
289235
}
290236

291237
/**
@@ -401,12 +347,18 @@ public function exec($query, array $params = array())
401347
protected function replaceBoundParamsWithInlineValuesInQuery($query, array $params) {
402348

403349
foreach($params as $key => $value) {
404-
$re = '/(?<=WHERE|VALUES|SET|JOIN)(.*?)(\?)/';
405-
$query = preg_replace($re, "\\1##{$key}##", $query, 1);
350+
if(is_null($value)) {
351+
$value = 'NULL';
352+
}
353+
else {
354+
$value = $this->quote($value);
355+
}
356+
357+
$re = '/([=,\(][^\\\']*)(\?)/iU';
358+
359+
$query = preg_replace($re, "\\1 {$value}", $query, 1);
360+
406361
}
407-
408-
$replacement = 'is_null($value) ? \'NULL\' : $this->quote($params[\\1])';
409-
$query = preg_replace('/##(\d+)##/e', $replacement, $query);
410362

411363
return $query;
412364

lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Connection/Pgsql.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
* $Id: Pgsql.php 7490 2010-03-29 19:53:27Z jwage $
3+
* $Id: Pgsql.php 7696 2011-03-21 12:10:28Z beberlei $
44
*
55
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
66
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -27,7 +27,7 @@
2727
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
2828
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
2929
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
30-
* @version $Revision: 7490 $
30+
* @version $Revision: 7696 $
3131
* @link www.doctrine-project.org
3232
* @since 1.0
3333
*/
@@ -142,14 +142,14 @@ public function modifyLimitQuery($query, $limit = false, $offset = false, $isMan
142142
$from = $match[2];
143143
$where = $match[3];
144144
$query = $manip . ' ' . $from . ' WHERE ctid=(SELECT ctid FROM '
145-
. $from . ' ' . $where . ' LIMIT ' . $limit . ')';
145+
. $from . ' ' . $where . ' LIMIT ' . (int)$limit . ')';
146146

147147
} else {
148148
if ( ! empty($limit)) {
149-
$query .= ' LIMIT ' . $limit;
149+
$query .= ' LIMIT ' . (int)$limit;
150150
}
151151
if ( ! empty($offset)) {
152-
$query .= ' OFFSET ' . $offset;
152+
$query .= ' OFFSET ' . (int)$offset;
153153
}
154154
}
155155
}

lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Doctrine_Core
3535
/**
3636
* VERSION
3737
*/
38-
const VERSION = '1.2.3';
38+
const VERSION = '1.2.4';
3939

4040
/**
4141
* ERROR CONSTANTS
@@ -373,11 +373,6 @@ class Doctrine_Core
373373
*/
374374
const HYDRATE_RECORD_HIERARCHY = 9;
375375

376-
/**
377-
* HYDRATE_ARRAY_SHALLOW
378-
*/
379-
const HYDRATE_ARRAY_SHALLOW = 10;
380-
381376
/**
382377
* VALIDATION CONSTANTS
383378
*/
@@ -1225,4 +1220,4 @@ public static function dump($var, $output = true, $indent = "")
12251220

12261221
return implode("\n", $ret);
12271222
}
1228-
}
1223+
}

0 commit comments

Comments
 (0)