"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/db/Schema.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.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.35):Schema.php  (yii2-2.0.36)
skipping to change at line 480 skipping to change at line 480
* Quotes a table name for use in a query. * Quotes a table name for use in a query.
* If the table name contains schema prefix, the prefix will also be properl y quoted. * If the table name contains schema prefix, the prefix will also be properl y quoted.
* If the table name is already quoted or contains '(' or '{{', * If the table name is already quoted or contains '(' or '{{',
* then this method will do nothing. * then this method will do nothing.
* @param string $name table name * @param string $name table name
* @return string the properly quoted table name * @return string the properly quoted table name
* @see quoteSimpleTableName() * @see quoteSimpleTableName()
*/ */
public function quoteTableName($name) public function quoteTableName($name)
{ {
if (strpos($name, '(') !== false || strpos($name, '{{') !== false) {
if (strpos($name, '(') === 0 && strpos($name, ')') === strlen($name) - 1
) {
return $name;
}
if (strpos($name, '{{') !== false) {
return $name; return $name;
} }
if (strpos($name, '.') === false) { if (strpos($name, '.') === false) {
return $this->quoteSimpleTableName($name); return $this->quoteSimpleTableName($name);
} }
$parts = $this->getTableNameParts($name); $parts = $this->getTableNameParts($name);
foreach ($parts as $i => $part) { foreach ($parts as $i => $part) {
$parts[$i] = $this->quoteSimpleTableName($part); $parts[$i] = $this->quoteSimpleTableName($part);
} }
return implode('.', $parts); return implode('.', $parts);
} }
/** /**
* Splits full table name into parts * Splits full table name into parts
* @param string $name * @param string $name
* @return array * @return array
* @since 2.0.22 * @since 2.0.22
*/ */
protected function getTableNameParts($name) protected function getTableNameParts($name)
 End of changes. 2 change blocks. 
2 lines changed or deleted 6 lines changed or added

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