mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-28 12:26:23 +02:00
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:
commit
79cf1faf53
@ -1,6 +1,6 @@
|
||||
## 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)).
|
||||
Requires a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project. Typically used alongside the [`cms`](http://github.com/silverstripe/silverstripe-cms) module.
|
||||
|
@ -213,16 +213,16 @@ abstract class SS_Database {
|
||||
public function endSchemaUpdate() {
|
||||
foreach($this->schemaUpdateTransaction as $tableName => $changes) {
|
||||
switch($changes['command']) {
|
||||
case 'create':
|
||||
case 'create':
|
||||
$this->createTable($tableName, $changes['newFields'], $changes['newIndexes'], $changes['options'],
|
||||
@$changes['advancedOptions']);
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'alter':
|
||||
$this->alterTable($tableName, $changes['newFields'], $changes['newIndexes'],
|
||||
case 'alter':
|
||||
$this->alterTable($tableName, $changes['newFields'], $changes['newIndexes'],
|
||||
$changes['alteredFields'], $changes['alteredIndexes'], $changes['alteredOptions'],
|
||||
@$changes['advancedOptions']);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->schemaUpdateTransaction = null;
|
||||
@ -828,8 +828,8 @@ abstract class SS_Database {
|
||||
public function sqlLimitToString($limit) {
|
||||
$clause = '';
|
||||
|
||||
// Pass limit as array or SQL string value
|
||||
if(is_array($limit)) {
|
||||
// Pass limit as array or SQL string value
|
||||
if(is_array($limit)) {
|
||||
if(!array_key_exists('limit', $limit)) {
|
||||
throw new InvalidArgumentException('Database::sqlLimitToString(): Wrong format for $limit: '
|
||||
. var_export($limit, true));
|
||||
@ -839,11 +839,11 @@ abstract class SS_Database {
|
||||
&& is_numeric($limit['limit'])) {
|
||||
|
||||
$combinedLimit = $limit['start'] ? "$limit[limit] OFFSET $limit[start]" : "$limit[limit]";
|
||||
} elseif(isset($limit['limit']) && is_numeric($limit['limit'])) {
|
||||
$combinedLimit = (int) $limit['limit'];
|
||||
} else {
|
||||
$combinedLimit = false;
|
||||
}
|
||||
} elseif(isset($limit['limit']) && is_numeric($limit['limit'])) {
|
||||
$combinedLimit = (int)$limit['limit'];
|
||||
} else {
|
||||
$combinedLimit = false;
|
||||
}
|
||||
if(!empty($combinedLimit)) $clause .= ' LIMIT ' . $combinedLimit;
|
||||
} else {
|
||||
$clause .= ' LIMIT ' . $limit;
|
||||
@ -859,9 +859,9 @@ abstract class SS_Database {
|
||||
public function sqlQueryToString(SQLQuery $query) {
|
||||
if($query->getDelete()) {
|
||||
$text = 'DELETE ';
|
||||
} else {
|
||||
} else {
|
||||
$text = $this->sqlSelectToString($query->getSelect(), $query->getDistinct());
|
||||
}
|
||||
}
|
||||
|
||||
if($query->getFrom()) $text .= $this->sqlFromToString($query->getFrom());
|
||||
if($query->getWhere()) $text .= $this->sqlWhereToString($query->getWhere(), $query->getConnective());
|
||||
@ -986,9 +986,9 @@ abstract class SS_Database {
|
||||
*/
|
||||
public function supportsLocks() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Returns if the lock is available.
|
||||
* See {@link supportsLocks()} to check if locking is generally supported.
|
||||
*
|
||||
@ -1136,7 +1136,7 @@ abstract class SS_Query implements Iterator {
|
||||
$result .= "<tr>";
|
||||
foreach($record as $k => $v) {
|
||||
$result .= "<th>" . Convert::raw2xml($k) . "</th> ";
|
||||
}
|
||||
}
|
||||
$result .= "</tr> \n";
|
||||
}
|
||||
|
||||
@ -1213,7 +1213,7 @@ abstract class SS_Query implements Iterator {
|
||||
*/
|
||||
public function valid() {
|
||||
if(!$this->queryHasBegun) $this->next();
|
||||
return $this->currentRecord !== false;
|
||||
return $this->currentRecord !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user