Completed
Push — master ( 189faf...34e3bf )
by Kenji
02:38
created

update.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * Part of ci-phpunit-test
4
 *
5
 * @author     Kenji Suzuki <https://github.com/kenjis>
6
 * @license    MIT License
7
 * @copyright  2015 Kenji Suzuki
8
 * @link       https://github.com/kenjis/ci-phpunit-test
9
 */
10
11
require __DIR__ . '/Installer.php';
12
13
$silent = false;
14
$app_dir = 'application';
15
16
// php update.php -s
17
if (isset($argv[1]) && $argv[1] === '-s') {
18
    $silent = true;
19
20
    // php update.php -s app
21 View Code Duplication
    if (isset($argv[2]) && is_dir($argv[2])) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
        $app_dir = $argv[2];
23
    }
24
}
25
26
// php update.php app
27 View Code Duplication
if (isset($argv[1]) && is_dir($argv[1])) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
    $app_dir = $argv[1];
29
}
30
31
$installer = new Installer($silent);
32
$installer->update($app_dir);
33