Code Duplication    Length = 20-20 lines in 2 locations

install/actions/action_summary.php 1 location

@@ 2-21 (lines=20) @@
1
<?php
2
if( ! function_exists('f_owc')){
3
    /**
4
     * @param $path
5
     * @param $data
6
     * @param null|int $mode
7
     */
8
    function f_owc($path, $data, $mode = null){
9
        try {
10
            // make an attempt to create the file
11
            $hnd = fopen($path, 'w');
12
            fwrite($hnd, $data);
13
            fclose($hnd);
14
15
            if(null !== $mode) chmod($path, $mode);
16
        }catch(Exception $e){
17
            // Nothing, this is NOT normal
18
            unset($e);
19
        }
20
    }
21
}
22
23
$installMode = isset($_POST['installmode']) ? (int)$_POST['installmode'] : 0;
24
if( ! isset($_lang)) $_lang = array();

install/cli-install.php 1 location

@@ 126-145 (lines=20) @@
123
}
124
125
//////////////////////////////////////////////////////////////////////////////////////
126
if( ! function_exists('f_owc')){
127
    /**
128
     * @param $path
129
     * @param $data
130
     * @param null|int $mode
131
     */
132
    function f_owc($path, $data, $mode = null){
133
        try {
134
            // make an attempt to create the file
135
            $hnd = fopen($path, 'w');
136
            fwrite($hnd, $data);
137
            fclose($hnd);
138
139
            if(null !== $mode) chmod($path, $mode);
140
        }catch(Exception $e){
141
            // Nothing, this is NOT normal
142
            unset($e);
143
        }
144
    }
145
}
146
147
// check PHP version
148
define('PHP_MIN_VERSION', '5.4.0');