GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — integration (#2604)
by Brendan
05:28
created

migration_234::upgrade()   C

Complexity

Conditions 8
Paths 39

Size

Total Lines 39
Code Lines 17

Duplication

Lines 25
Ratio 64.1 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 8
eloc 17
c 1
b 1
f 0
nc 39
nop 0
dl 25
loc 39
rs 5.3846
1
<?php
2
namespace SymphonyCms\Installer\Migrations;
3
4
use SymphonyCms\Installer\Lib\Migration;
5
use Symphony;
6
use Exception;
7
8
class migration_234 extends Migration
9
{
10
    public static function getVersion()
11
    {
12
        return '2.3.4';
13
    }
14
15
    public static function getReleaseNotes()
16
    {
17
        return 'http://getsymphony.com/download/releases/version/2.3.4/';
18
    }
19
20
    public static function upgrade()
21
    {
22 View Code Duplication
        if (version_compare(self::$existing_version, '2.3.4beta1', '<=')) {
23
            // Detect mod_rewrite #1808
24
            try {
25
                $htaccess = file_get_contents(DOCROOT . '/.htaccess');
26
27
                if ($htaccess !== false && !preg_match('/SetEnv HTTP_MOD_REWRITE No/', $htaccess)) {
28
                    $rewrite = '
29
<IfModule !mod_rewrite.c>
30
    SetEnv HTTP_MOD_REWRITE No
31
</IfModule>
32
33
<IfModule mod_rewrite.c>';
34
35
                    $htaccess = str_replace('<IfModule mod_rewrite.c>', $rewrite, $htaccess);
36
                    file_put_contents(DOCROOT . '/.htaccess', $htaccess);
37
                }
38
            } catch (Exception $ex) {
39
            }
40
41
            // Extend token field to enable more secure tokens
42
            try {
43
                Symphony::Database()->query('ALTER TABLE `tbl_forgotpass` CHANGE `token` `token` VARCHAR(16);');
44
            } catch (Exception $ex) {
45
            }
46
        }
47
48
        if (version_compare(self::$existing_version, '2.3.4beta2', '<=')) {
49
            // Extend session_id field for default Suhosin installs
50
            try {
51
                Symphony::Database()->query('ALTER TABLE `tbl_sessions` CHANGE `session` `session` VARCHAR(128);');
52
            } catch (Exception $ex) {
53
            }
54
        }
55
56
        // Update the version information
57
        return parent::upgrade();
58
    }
59
}
60