"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/db/Schema.php" between
yii2-2.0.36.tar.gz and yii2-2.0.37.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

Schema.php  (yii2-2.0.36):Schema.php  (yii2-2.0.37)
skipping to change at line 561 skipping to change at line 561
/** /**
* Quotes a simple column name for use in a query. * Quotes a simple column name for use in a query.
* A simple column name should contain the column name only without any pref ix. * A simple column name should contain the column name only without any pref ix.
* If the column name is already quoted or is the asterisk character '*', th is method will do nothing. * If the column name is already quoted or is the asterisk character '*', th is method will do nothing.
* @param string $name column name * @param string $name column name
* @return string the properly quoted column name * @return string the properly quoted column name
*/ */
public function quoteSimpleColumnName($name) public function quoteSimpleColumnName($name)
{ {
if (is_string($this->tableQuoteCharacter)) { if (is_string($this->columnQuoteCharacter)) {
$startingCharacter = $endingCharacter = $this->columnQuoteCharacter; $startingCharacter = $endingCharacter = $this->columnQuoteCharacter;
} else { } else {
list($startingCharacter, $endingCharacter) = $this->columnQuoteChara cter; list($startingCharacter, $endingCharacter) = $this->columnQuoteChara cter;
} }
return $name === '*' || strpos($name, $startingCharacter) !== false ? $n ame : $startingCharacter . $name . $endingCharacter; return $name === '*' || strpos($name, $startingCharacter) !== false ? $n ame : $startingCharacter . $name . $endingCharacter;
} }
/** /**
* Unquotes a simple table name. * Unquotes a simple table name.
* A simple table name should contain the table name only without any schema prefix. * A simple table name should contain the table name only without any schema prefix.
skipping to change at line 676 skipping to change at line 676
} }
$exceptionClass = '\yii\db\Exception'; $exceptionClass = '\yii\db\Exception';
foreach ($this->exceptionMap as $error => $class) { foreach ($this->exceptionMap as $error => $class) {
if (strpos($e->getMessage(), $error) !== false) { if (strpos($e->getMessage(), $error) !== false) {
$exceptionClass = $class; $exceptionClass = $class;
} }
} }
$message = $e->getMessage() . "\nThe SQL being executed was: $rawSql"; $message = $e->getMessage() . "\nThe SQL being executed was: $rawSql";
$errorInfo = $e instanceof \PDOException ? $e->errorInfo : null; $errorInfo = $e instanceof \PDOException ? $e->errorInfo : null;
return new $exceptionClass($message, $errorInfo, (int)$e->getCode(), $e) ; return new $exceptionClass($message, $errorInfo, $e->getCode(), $e);
} }
/** /**
* Returns a value indicating whether a SQL statement is for read purpose. * Returns a value indicating whether a SQL statement is for read purpose.
* @param string $sql the SQL statement * @param string $sql the SQL statement
* @return bool whether a SQL statement is for read purpose. * @return bool whether a SQL statement is for read purpose.
*/ */
public function isReadQuery($sql) public function isReadQuery($sql)
{ {
$pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i'; $pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i';
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)