Merge remote-tracking branch 'origin/2.4' into 3.0

Conflicts:
	README.md
	composer.json
	docs/en/installation/from-source.md
	docs/en/misc/contributing.md
	model/Database.php
This commit is contained in:
Ingo Schommer 2013-05-17 00:37:30 +02:00
commit 79cf1faf53
3 changed files with 31 additions and 31 deletions

View File

@ -1,6 +1,6 @@
## SilverStripe Framework ## SilverStripe Framework
[![Build Status](https://secure.travis-ci.org/silverstripe/sapphire.png?branch=3.0)](https://travis-ci.org/silverstripe/sapphire) [![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-framework.png?branch=3.0)](https://travis-ci.org/silverstripe/silverstripe-framework)
PHP5 framework forming the base for the SilverStripe CMS ([http://silverstripe.org](http://silverstripe.org)). PHP5 framework forming the base for the SilverStripe CMS ([http://silverstripe.org](http://silverstripe.org)).
Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project. Typically used alongside the [`cms`](http://github.com/silverstripe/silverstripe-cms) module. Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project. Typically used alongside the [`cms`](http://github.com/silverstripe/silverstripe-cms) module.

View File

@ -213,16 +213,16 @@ abstract class SS_Database {
public function endSchemaUpdate() { public function endSchemaUpdate() {
foreach($this->schemaUpdateTransaction as $tableName => $changes) { foreach($this->schemaUpdateTransaction as $tableName => $changes) {
switch($changes['command']) { switch($changes['command']) {
case 'create': case 'create':
$this->createTable($tableName, $changes['newFields'], $changes['newIndexes'], $changes['options'], $this->createTable($tableName, $changes['newFields'], $changes['newIndexes'], $changes['options'],
@$changes['advancedOptions']); @$changes['advancedOptions']);
break; break;
case 'alter': case 'alter':
$this->alterTable($tableName, $changes['newFields'], $changes['newIndexes'], $this->alterTable($tableName, $changes['newFields'], $changes['newIndexes'],
$changes['alteredFields'], $changes['alteredIndexes'], $changes['alteredOptions'], $changes['alteredFields'], $changes['alteredIndexes'], $changes['alteredOptions'],
@$changes['advancedOptions']); @$changes['advancedOptions']);
break; break;
} }
} }
$this->schemaUpdateTransaction = null; $this->schemaUpdateTransaction = null;
@ -828,8 +828,8 @@ abstract class SS_Database {
public function sqlLimitToString($limit) { public function sqlLimitToString($limit) {
$clause = ''; $clause = '';
// Pass limit as array or SQL string value // Pass limit as array or SQL string value
if(is_array($limit)) { if(is_array($limit)) {
if(!array_key_exists('limit', $limit)) { if(!array_key_exists('limit', $limit)) {
throw new InvalidArgumentException('Database::sqlLimitToString(): Wrong format for $limit: ' throw new InvalidArgumentException('Database::sqlLimitToString(): Wrong format for $limit: '
. var_export($limit, true)); . var_export($limit, true));
@ -839,11 +839,11 @@ abstract class SS_Database {
&& is_numeric($limit['limit'])) { && is_numeric($limit['limit'])) {
$combinedLimit = $limit['start'] ? "$limit[limit] OFFSET $limit[start]" : "$limit[limit]"; $combinedLimit = $limit['start'] ? "$limit[limit] OFFSET $limit[start]" : "$limit[limit]";
} elseif(isset($limit['limit']) && is_numeric($limit['limit'])) { } elseif(isset($limit['limit']) && is_numeric($limit['limit'])) {
$combinedLimit = (int) $limit['limit']; $combinedLimit = (int)$limit['limit'];
} else { } else {
$combinedLimit = false; $combinedLimit = false;
} }
if(!empty($combinedLimit)) $clause .= ' LIMIT ' . $combinedLimit; if(!empty($combinedLimit)) $clause .= ' LIMIT ' . $combinedLimit;
} else { } else {
$clause .= ' LIMIT ' . $limit; $clause .= ' LIMIT ' . $limit;
@ -859,9 +859,9 @@ abstract class SS_Database {
public function sqlQueryToString(SQLQuery $query) { public function sqlQueryToString(SQLQuery $query) {
if($query->getDelete()) { if($query->getDelete()) {
$text = 'DELETE '; $text = 'DELETE ';
} else { } else {
$text = $this->sqlSelectToString($query->getSelect(), $query->getDistinct()); $text = $this->sqlSelectToString($query->getSelect(), $query->getDistinct());
} }
if($query->getFrom()) $text .= $this->sqlFromToString($query->getFrom()); if($query->getFrom()) $text .= $this->sqlFromToString($query->getFrom());
if($query->getWhere()) $text .= $this->sqlWhereToString($query->getWhere(), $query->getConnective()); if($query->getWhere()) $text .= $this->sqlWhereToString($query->getWhere(), $query->getConnective());
@ -986,9 +986,9 @@ abstract class SS_Database {
*/ */
public function supportsLocks() { public function supportsLocks() {
return false; return false;
} }
/** /**
* Returns if the lock is available. * Returns if the lock is available.
* See {@link supportsLocks()} to check if locking is generally supported. * See {@link supportsLocks()} to check if locking is generally supported.
* *
@ -1136,7 +1136,7 @@ abstract class SS_Query implements Iterator {
$result .= "<tr>"; $result .= "<tr>";
foreach($record as $k => $v) { foreach($record as $k => $v) {
$result .= "<th>" . Convert::raw2xml($k) . "</th> "; $result .= "<th>" . Convert::raw2xml($k) . "</th> ";
} }
$result .= "</tr> \n"; $result .= "</tr> \n";
} }
@ -1213,7 +1213,7 @@ abstract class SS_Query implements Iterator {
*/ */
public function valid() { public function valid() {
if(!$this->queryHasBegun) $this->next(); if(!$this->queryHasBegun) $this->next();
return $this->currentRecord !== false; return $this->currentRecord !== false;
} }
/** /**