@@ -705,7 +705,7 @@ public function convertFilter($field, $comparator, $value) {
705
705
case 'nsis ' : return array ('!.STIsSimple()=0 ' ,$ field );
706
706
case 'nsiv ' : return array ('!.STIsValid()=0 ' ,$ field );
707
707
}
708
- }
708
+ }
709
709
return false ;
710
710
}
711
711
@@ -1154,7 +1154,7 @@ protected function processOrderingsParameter($orderings) {
1154
1154
protected function convertFilter ($ field , $ comparator , $ value ) {
1155
1155
$ result = $ this ->db ->convertFilter ($ field ,$ comparator ,$ value );
1156
1156
if ($ result ) return $ result ;
1157
- // default behavior
1157
+ // default behavior
1158
1158
$ comparator = strtolower ($ comparator );
1159
1159
if ($ comparator [0 ]!='n ' ) {
1160
1160
if (strlen ($ comparator )==2 ) {
@@ -1167,8 +1167,10 @@ protected function convertFilter($field, $comparator, $value) {
1167
1167
case 'le ' : return array ('! <= ? ' ,$ field ,$ value );
1168
1168
case 'ge ' : return array ('! >= ? ' ,$ field ,$ value );
1169
1169
case 'gt ' : return array ('! > ? ' ,$ field ,$ value );
1170
- case 'bt ' : $ v = explode (', ' ,$ value ); if (count ($ v )<2 ) return false ;
1171
- return array ('! BETWEEN ? AND ? ' ,$ field ,$ v [0 ],$ v [1 ]);
1170
+ case 'bt ' :
1171
+ $ v = explode (', ' ,$ value );
1172
+ if (count ($ v )<2 ) return false ;
1173
+ return array ('! BETWEEN ? AND ? ' ,$ field ,$ v [0 ],$ v [1 ]);
1172
1174
case 'in ' : return array ('! IN ? ' ,$ field ,explode (', ' ,$ value ));
1173
1175
case 'is ' : return array ('! IS NULL ' ,$ field );
1174
1176
}
@@ -1204,8 +1206,10 @@ protected function convertFilter($field, $comparator, $value) {
1204
1206
case 'nle ' : return array ('! > ? ' ,$ field ,$ value );
1205
1207
case 'nge ' : return array ('! < ? ' ,$ field ,$ value );
1206
1208
case 'ngt ' : return array ('! <= ? ' ,$ field ,$ value );
1207
- case 'nbt ' : $ v = explode (', ' ,$ value ); if (count ($ v )<2 ) return false ;
1208
- return array ('! NOT BETWEEN ? AND ? ' ,$ field ,$ v [0 ],$ v [1 ]);
1209
+ case 'nbt ' :
1210
+ $ v = explode (', ' ,$ value );
1211
+ if (count ($ v )<2 ) return false ;
1212
+ return array ('! NOT BETWEEN ? AND ? ' ,$ field ,$ v [0 ],$ v [1 ]);
1209
1213
case 'nin ' : return array ('! NOT IN ? ' ,$ field ,explode (', ' ,$ value ));
1210
1214
case 'nis ' : return array ('! IS NOT NULL ' ,$ field );
1211
1215
}
@@ -1518,7 +1522,7 @@ protected function addRelationColumns($columns,$select) {
1518
1522
foreach ($ keys as $ key =>$ other ) {
1519
1523
$ columns .=", $ table. $ key, " .implode ('. ' ,$ other );
1520
1524
}
1521
- }
1525
+ }
1522
1526
}
1523
1527
return $ columns ;
1524
1528
}
@@ -1896,7 +1900,7 @@ public function __construct($config) {
1896
1900
$ get = isset ($ get )?$ get :null ;
1897
1901
$ post = isset ($ post )?$ post :null ;
1898
1902
$ origin = isset ($ origin )?$ origin :null ;
1899
-
1903
+
1900
1904
// defaults
1901
1905
if (!$ dbengine ) {
1902
1906
$ dbengine = 'MySQL ' ;
@@ -1923,7 +1927,7 @@ public function __construct($config) {
1923
1927
// connect
1924
1928
$ request = trim ($ request ,'/ ' );
1925
1929
if (!$ database ) {
1926
- $ database = $ this ->parseRequestParameter ($ request , 'a-zA-Z0-9\-_ ' );
1930
+ $ database = $ this ->parseRequestParameter ($ request , 'a-zA-Z0-9\-_ ' );
1927
1931
}
1928
1932
if (!$ db ) {
1929
1933
$ db = new $ dbengine ();
@@ -2013,7 +2017,7 @@ protected function swagger($settings) {
2013
2017
$ table_list = array ($ table ['name ' ]);
2014
2018
$ table_fields = $ this ->findFields ($ table_list ,false ,$ database );
2015
2019
$ table_names = array_map (function ($ v ){ return $ v ['name ' ];},$ tables );
2016
-
2020
+
2017
2021
if ($ extensions ) {
2018
2022
$ result = $ this ->db ->query ($ this ->db ->getSql ('reflect_belongs_to ' ),array ($ table_list [0 ],$ table_names ,$ database ,$ database ));
2019
2023
while ($ row = $ this ->db ->fetchRow ($ result )) {
@@ -2028,7 +2032,7 @@ protected function swagger($settings) {
2028
2032
$ table_fields [$ table ['name ' ]][$ primaryKey ]->primaryKey = true ;
2029
2033
}
2030
2034
}
2031
-
2035
+
2032
2036
foreach (array ('root_actions ' ,'id_actions ' ) as $ path ) {
2033
2037
foreach ($ table [$ path ] as $ i =>$ action ) {
2034
2038
$ table_list = array ($ table ['name ' ]);
@@ -2296,7 +2300,7 @@ protected function allowOrigin($origin,$allowOrigins) {
2296
2300
header ('Access-Control-Allow-Origin: * ' );
2297
2301
} else {
2298
2302
if ($ origin ) foreach (explode (', ' ,$ allowOrigins ) as $ o ) {
2299
- if (preg_match ('/^ ' .str_replace ('\* ' ,'.* ' ,preg_quote (strtolower (trim ($ o )))).'$/ ' ,$ origin )) {
2303
+ if (preg_match ('/^ ' .str_replace ('\* ' ,'.* ' ,preg_quote (strtolower (trim ($ o )))).'$/ ' ,$ origin )) {
2300
2304
header ('Access-Control-Allow-Origin: ' .$ origin );
2301
2305
break ;
2302
2306
}
0 commit comments