@@ -26,14 +26,14 @@ |
||
| 26 | 26 | $config['DB_PORT'] = env('DB_PORT'); |
| 27 | 27 | if (empty($config['DB_TYPE'])) { |
| 28 | 28 | switch ($config['DB_PORT']) { |
| 29 | - case 3306: |
|
| 30 | - $config['DB_TYPE'] = 'mysql'; |
|
| 31 | - break; |
|
| 32 | - case 5432: |
|
| 33 | - $config['DB_TYPE'] = 'pgsql'; |
|
| 34 | - break; |
|
| 35 | - default: |
|
| 36 | - error('Database on non-standard port ' . $config['DB_PORT'] . ' and env DB_TYPE not present'); |
|
| 29 | + case 3306: |
|
| 30 | + $config['DB_TYPE'] = 'mysql'; |
|
| 31 | + break; |
|
| 32 | + case 5432: |
|
| 33 | + $config['DB_TYPE'] = 'pgsql'; |
|
| 34 | + break; |
|
| 35 | + default: |
|
| 36 | + error('Database on non-standard port ' . $config['DB_PORT'] . ' and env DB_TYPE not present'); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | try { |
| 73 | 73 | $pdo->query('SELECT 1 FROM ttrss_feeds'); |
| 74 | 74 | // reached this point => table found, assume db is complete |
| 75 | -} |
|
| 76 | -catch (PDOException $e) { |
|
| 75 | +} catch (PDOException $e) { |
|
| 77 | 76 | echo 'Database table not found, applying schema... ' . PHP_EOL; |
| 78 | 77 | $schema = file_get_contents('schema/ttrss_schema_' . $config['DB_TYPE'] . '.sql'); |
| 79 | 78 | $schema = preg_replace('/--(.*?);/', '', $schema); |
@@ -128,8 +127,7 @@ discard block |
||
| 128 | 127 | try { |
| 129 | 128 | dbconnect($config); |
| 130 | 129 | return true; |
| 131 | - } |
|
| 132 | - catch (PDOException $e) { |
|
| 130 | + } catch (PDOException $e) { |
|
| 133 | 131 | return false; |
| 134 | 132 | } |
| 135 | 133 | } |
@@ -15,7 +15,9 @@ |
||
| 15 | 15 | $filename = substr($filename, 0, strpos($filename, "?")); |
| 16 | 16 | } |
| 17 | 17 | $timestamp = filemtime(BASEPATH.DS.'public'.DS.'js'.DS.$filename); |
| 18 | - if ($query) $timestamp .= "&$query"; |
|
| 18 | + if ($query) { |
|
| 19 | + $timestamp .= "&$query"; |
|
| 20 | + } |
|
| 19 | 21 | |
| 20 | 22 | return "<script type=\"text/javascript\" charset=\"utf-8\" src=\"/js/$filename?$timestamp\"></script>\n"; |
| 21 | 23 | } |