Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Line length fixes

  • Loading branch information...
commit fb5e488103b6dde6f01fbc835b14ac2f36a04cc1 1 parent 56f7ce1
@chillu chillu authored
View
4 control/Cookie.php
@@ -98,7 +98,9 @@ public static function report_errors() {
* @param boolean $secure See http://php.net/set_session
* @param boolean $httpOnly See http://php.net/set_session
*/
- protected function inst_set($name, $value, $expiry = 90, $path = null, $domain = null, $secure = false, $httpOnly = false) {
+ protected function inst_set($name, $value, $expiry = 90, $path = null,
+ $domain = null, $secure = false, $httpOnly = false
+ ) {
if(!headers_sent($file, $line)) {
$expiry = $expiry > 0 ? time()+(86400*$expiry) : $expiry;
$path = ($path) ? $path : Director::baseURL();
View
5 model/Database.php
@@ -559,7 +559,10 @@ public function requireField($table, $field, $spec) {
}
}
$this->transAlterField($table, $field, $spec_orig);
- $this->alterationMessage("Field $table.$field: changed to $specValue <i style=\"color: #AAA\">(from {$fieldValue})</i>","changed");
+ $this->alterationMessage(
+ "Field $table.$field: changed to $specValue <i style=\"color: #AAA\">(from {$fieldValue})</i>",
+ "changed"
+ );
}
}
View
4 model/MySQLDatabase.php
@@ -857,7 +857,9 @@ public function searchEngine($classesToSearch, $keywords, $start, $pageLength, $
// We make the relevance search by converting a boolean mode search into a normal one
$relevanceKeywords = str_replace(array('*','+','-'),'',$keywords);
$htmlEntityRelevanceKeywords = str_replace(array('*','+','-'),'',$htmlEntityKeywords);
- $relevance['SiteTree'] = "MATCH (Title, MenuTitle, Content, MetaDescription) AGAINST ('$relevanceKeywords') + MATCH (Title, MenuTitle, Content, MetaDescription) AGAINST ('$htmlEntityRelevanceKeywords')";
+ $relevance['SiteTree'] = "MATCH (Title, MenuTitle, Content, MetaDescription) "
+ . "AGAINST ('$relevanceKeywords') "
+ . "+ MATCH (Title, MenuTitle, Content, MetaDescription) AGAINST ('$htmlEntityRelevanceKeywords')";
$relevance['File'] = "MATCH (Filename, Title, Content) AGAINST ('$relevanceKeywords')";
} else {
$relevance['SiteTree'] = $relevance['File'] = 1;
View
3  model/SQLQuery.php
@@ -888,7 +888,8 @@ public function sql() {
else $filter = "(" . implode(") AND (", $join['filter']) . ")";
$aliasClause = ($alias != $join['table']) ? " AS \"" . Convert::raw2sql($alias) . "\"" : "";
- $this->from[$alias] = strtoupper($join['type']) . " JOIN \"" . $join['table'] . "\"$aliasClause ON $filter";
+ $this->from[$alias] = strtoupper($join['type']) . " JOIN \""
+ . $join['table'] . "\"$aliasClause ON $filter";
}
}
View
21 tests/model/DataListTest.php
@@ -108,10 +108,23 @@ public function testLeftJoin() {
// Test with namespaces (with non-sensical join, but good enough for testing)
$list = DataObjectTest_TeamComment::get();
- $list->leftJoin('DataObjectTest\NamespacedClass', '"DataObjectTest\NamespacedClass"."ID" = "DataObjectTest_TeamComment"."ID"');
- $expected = 'SELECT DISTINCT "DataObjectTest_TeamComment"."ClassName", "DataObjectTest_TeamComment"."Created", "DataObjectTest_TeamComment"."LastEdited", "DataObjectTest_TeamComment"."Name", "DataObjectTest_TeamComment"."Comment", "DataObjectTest_TeamComment"."TeamID", "DataObjectTest_TeamComment"."ID", CASE WHEN "DataObjectTest_TeamComment"."ClassName" IS NOT NULL THEN "DataObjectTest_TeamComment"."ClassName" ELSE '.$db->prepStringForDB('DataObjectTest_TeamComment').' END AS "RecordClassName" ' .
- 'FROM "DataObjectTest_TeamComment" ' .
- 'LEFT JOIN "DataObjectTest\NamespacedClass" ON "DataObjectTest\NamespacedClass"."ID" = "DataObjectTest_TeamComment"."ID"';
+ $list->leftJoin(
+ 'DataObjectTest\NamespacedClass',
+ '"DataObjectTest\NamespacedClass"."ID" = "DataObjectTest_TeamComment"."ID"'
+ );
+ $expected = 'SELECT DISTINCT "DataObjectTest_TeamComment"."ClassName", '
+ . '"DataObjectTest_TeamComment"."Created", '
+ . '"DataObjectTest_TeamComment"."LastEdited", '
+ . '"DataObjectTest_TeamComment"."Name", '
+ . '"DataObjectTest_TeamComment"."Comment", '
+ . '"DataObjectTest_TeamComment"."TeamID", '
+ . '"DataObjectTest_TeamComment"."ID", '
+ . 'CASE WHEN "DataObjectTest_TeamComment"."ClassName" IS NOT NULL '
+ . 'THEN "DataObjectTest_TeamComment"."ClassName" '
+ . 'ELSE ' . $db->prepStringForDB('DataObjectTest_TeamComment') . ' END AS "RecordClassName" '
+ . 'FROM "DataObjectTest_TeamComment" '
+ . 'LEFT JOIN "DataObjectTest\NamespacedClass" ON '
+ . '"DataObjectTest\NamespacedClass"."ID" = "DataObjectTest_TeamComment"."ID"';
$this->assertEquals($expected, $list->sql(), 'Retains backslashes in namespaced classes');
}
View
16 tests/model/DataQueryTest.php
@@ -41,7 +41,10 @@ public function testDisjunctiveGroup() {
$subDq->where('DataQueryTest_A.Name = \'John\'');
$subDq->where('DataQueryTest_A.Name = \'Bob\'');
- $this->assertContains("WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') OR (DataQueryTest_A.Name = 'Bob'))", $dq->sql());
+ $this->assertContains(
+ "WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') OR (DataQueryTest_A.Name = 'Bob'))",
+ $dq->sql()
+ );
}
public function testConjunctiveGroup() {
@@ -52,7 +55,10 @@ public function testConjunctiveGroup() {
$subDq->where('DataQueryTest_A.Name = \'John\'');
$subDq->where('DataQueryTest_A.Name = \'Bob\'');
- $this->assertContains("WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') AND (DataQueryTest_A.Name = 'Bob'))", $dq->sql());
+ $this->assertContains(
+ "WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') AND (DataQueryTest_A.Name = 'Bob'))",
+ $dq->sql()
+ );
}
public function testNestedGroups() {
@@ -66,7 +72,11 @@ public function testNestedGroups() {
$subSubDq->where('DataQueryTest_A.Age = 50');
$subDq->where('DataQueryTest_A.Name = \'Bob\'');
- $this->assertContains("WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') OR ((DataQueryTest_A.Age = 18) AND (DataQueryTest_A.Age = 50)) OR (DataQueryTest_A.Name = 'Bob'))", $dq->sql());
+ $this->assertContains(
+ "WHERE (DataQueryTest_A.ID = 2) AND ((DataQueryTest_A.Name = 'John') OR ((DataQueryTest_A.Age = 18) "
+ . "AND (DataQueryTest_A.Age = 50)) OR (DataQueryTest_A.Name = 'Bob'))",
+ $dq->sql()
+ );
}
public function testEmptySubgroup() {
View
3  view/SSViewer.php
@@ -843,7 +843,8 @@ public function process($item, $arguments = null) {
$template = $this->chosenTemplates[$key];
}
- $cacheFile = TEMP_FOLDER . "/.cache" . str_replace(array('\\','/',':'), '.', Director::makeRelative(realpath($template)));
+ $cacheFile = TEMP_FOLDER . "/.cache"
+ . str_replace(array('\\','/',':'), '.', Director::makeRelative(realpath($template)));
$lastEdited = filemtime($template);
if(!file_exists($cacheFile) || filemtime($cacheFile) < $lastEdited || isset($_GET['flush'])) {
Please sign in to comment.
Something went wrong with that request. Please try again.