@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | // Handle single file |
45 | - $file =& $files[$field]; |
|
45 | + $file = & $files[$field]; |
|
46 | 46 | |
47 | - if (! file_exists($file['tmp_name'])) |
|
47 | + if ( ! file_exists($file['tmp_name'])) |
|
48 | 48 | { |
49 | 49 | $file['error'] = UPLOAD_ERR_NO_FILE; |
50 | 50 | $file['type'] = ''; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // Set $_GET if URI string has query string |
111 | 111 | parse_str($query_string, $_GET); |
112 | 112 | // Remove query string from URI string |
113 | - $argv = substr($argv, 0, -strlen($query_string)-1); |
|
113 | + $argv = substr($argv, 0, -strlen($query_string) - 1); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | if ($_GET !== []) |
144 | 144 | { |
145 | 145 | $_SERVER['REQUEST_URI'] = |
146 | - '/' . $path . '?' |
|
146 | + '/'.$path.'?' |
|
147 | 147 | . http_build_query($_GET); |
148 | 148 | } |
149 | 149 | else |
150 | 150 | { |
151 | - $_SERVER['REQUEST_URI'] = '/' . $path; |
|
151 | + $_SERVER['REQUEST_URI'] = '/'.$path; |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | if ($query_string === false) |
167 | 167 | { |
168 | - throw new LogicException('Bad URI string: ' . $uri); |
|
168 | + throw new LogicException('Bad URI string: '.$uri); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | return $query_string; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | else |
192 | 192 | { |
193 | - $key = 'HTTP_' . $normalized_name; |
|
193 | + $key = 'HTTP_'.$normalized_name; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | $_SERVER[$key] = $value; |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | { |
294 | 294 | empty($config) OR $this->initialize($config, FALSE); |
295 | 295 | |
296 | - $this->_mimes =& get_mimes(); |
|
297 | - $this->_CI =& get_instance(); |
|
296 | + $this->_mimes = & get_mimes(); |
|
297 | + $this->_CI = & get_instance(); |
|
298 | 298 | |
299 | 299 | log_message('info', 'Upload Class Initialized'); |
300 | 300 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | else |
481 | 481 | { |
482 | 482 | // An extension was provided, let's have it! |
483 | - $this->file_ext = $this->get_extension($this->_file_name_override); |
|
483 | + $this->file_ext = $this->get_extension($this->_file_name_override); |
|
484 | 484 | } |
485 | 485 | |
486 | 486 | if ( ! $this->is_allowed_filetype(TRUE)) |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | // Convert the file size to kilobytes |
494 | 494 | if ($this->file_size > 0) |
495 | 495 | { |
496 | - $this->file_size = round($this->file_size/1024, 2); |
|
496 | + $this->file_size = round($this->file_size / 1024, 2); |
|
497 | 497 | } |
498 | 498 | |
499 | 499 | // Is the file size within the allowed maximum? |
@@ -818,10 +818,10 @@ discard block |
||
818 | 818 | { |
819 | 819 | $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); |
820 | 820 | |
821 | - $this->image_width = $D[0]; |
|
822 | - $this->image_height = $D[1]; |
|
823 | - $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown'; |
|
824 | - $this->image_size_str = $D[3]; // string containing height and width |
|
821 | + $this->image_width = $D[0]; |
|
822 | + $this->image_height = $D[1]; |
|
823 | + $this->image_type = isset($types[$D[2]]) ? $types[$D[2]] : 'unknown'; |
|
824 | + $this->image_size_str = $D[3]; // string containing height and width |
|
825 | 825 | } |
826 | 826 | } |
827 | 827 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | $this->file_type = 'image/jpeg'; |
870 | 870 | } |
871 | 871 | |
872 | - $img_mimes = array('image/gif', 'image/jpeg', 'image/png'); |
|
872 | + $img_mimes = array('image/gif', 'image/jpeg', 'image/png'); |
|
873 | 873 | |
874 | 874 | return in_array($this->file_type, $img_mimes, TRUE); |
875 | 875 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
1011 | 1011 | return FALSE; |
1012 | 1012 | } |
1013 | 1013 | |
1014 | - $this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path); |
|
1014 | + $this->upload_path = preg_replace('/(.+?)\/*$/', '\\1/', $this->upload_path); |
|
1015 | 1015 | return TRUE; |
1016 | 1016 | } |
1017 | 1017 | |
@@ -1055,9 +1055,9 @@ discard block |
||
1055 | 1055 | $ext = ''; |
1056 | 1056 | if (strpos($filename, '.') !== FALSE) |
1057 | 1057 | { |
1058 | - $parts = explode('.', $filename); |
|
1059 | - $ext = '.'.array_pop($parts); |
|
1060 | - $filename = implode('.', $parts); |
|
1058 | + $parts = explode('.', $filename); |
|
1059 | + $ext = '.'.array_pop($parts); |
|
1060 | + $filename = implode('.', $parts); |
|
1061 | 1061 | } |
1062 | 1062 | |
1063 | 1063 | return substr($filename, 0, ($length - strlen($ext))).$ext; |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | public static function install($app = 'application') |
23 | 23 | { |
24 | 24 | self::recursiveCopy( |
25 | - dirname(__FILE__) . '/application/tests', |
|
26 | - $app . '/' . static::TEST_FOLDER |
|
25 | + dirname(__FILE__).'/application/tests', |
|
26 | + $app.'/'.static::TEST_FOLDER |
|
27 | 27 | ); |
28 | 28 | self::fixPath($app); |
29 | 29 | } |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | */ |
34 | 34 | private static function fixPath($app = 'application') |
35 | 35 | { |
36 | - $file = $app . '/' . static::TEST_FOLDER . '/Bootstrap.php'; |
|
36 | + $file = $app.'/'.static::TEST_FOLDER.'/Bootstrap.php'; |
|
37 | 37 | $contents = file_get_contents($file); |
38 | 38 | |
39 | - if (! file_exists('system')) { |
|
39 | + if ( ! file_exists('system')) { |
|
40 | 40 | if (file_exists('vendor/codeigniter/framework/system')) { |
41 | 41 | $contents = str_replace( |
42 | 42 | '$system_path = \'../../system\';', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | - if (! file_exists('index.php')) { |
|
51 | + if ( ! file_exists('index.php')) { |
|
52 | 52 | if (file_exists('public/index.php')) { |
53 | 53 | // CodeIgniter 3.0.6 and after |
54 | 54 | $contents = str_replace( |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | "define('FCPATH', realpath(dirname(__FILE__).'/../../public').'/');", |
63 | 63 | $contents |
64 | 64 | ); |
65 | - } elseif (file_exists($app . '/public/index.php')) { |
|
65 | + } elseif (file_exists($app.'/public/index.php')) { |
|
66 | 66 | // CodeIgniter 3.0.6 and after |
67 | 67 | $contents = str_replace( |
68 | 68 | "define('FCPATH', realpath(dirname(__FILE__).'/../..').DIRECTORY_SEPARATOR);", |
@@ -92,10 +92,10 @@ discard block |
||
92 | 92 | |
93 | 93 | public static function update($app = 'application') |
94 | 94 | { |
95 | - $target_dir = $app . '/' . static::TEST_FOLDER . '/_ci_phpunit_test'; |
|
95 | + $target_dir = $app.'/'.static::TEST_FOLDER.'/_ci_phpunit_test'; |
|
96 | 96 | self::recursiveUnlink($target_dir); |
97 | 97 | self::recursiveCopy( |
98 | - dirname(__FILE__) . '/application/tests/_ci_phpunit_test', |
|
98 | + dirname(__FILE__).'/application/tests/_ci_phpunit_test', |
|
99 | 99 | $target_dir |
100 | 100 | ); |
101 | 101 | } |
@@ -117,12 +117,12 @@ discard block |
||
117 | 117 | |
118 | 118 | foreach ($iterator as $file) { |
119 | 119 | if ($file->isDir()) { |
120 | - @mkdir($dst . '/' . $iterator->getSubPathName()); |
|
120 | + @mkdir($dst.'/'.$iterator->getSubPathName()); |
|
121 | 121 | } else { |
122 | - $success = copy($file, $dst . '/' . $iterator->getSubPathName()); |
|
122 | + $success = copy($file, $dst.'/'.$iterator->getSubPathName()); |
|
123 | 123 | if ($success) { |
124 | - if (! $this->silent) { |
|
125 | - echo 'copied: ' . $dst . '/' . $iterator->getSubPathName() . PHP_EOL; |
|
124 | + if ( ! $this->silent) { |
|
125 | + echo 'copied: '.$dst.'/'.$iterator->getSubPathName().PHP_EOL; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -33,35 +33,35 @@ discard block |
||
33 | 33 | $cwd_backup = getcwd(); |
34 | 34 | |
35 | 35 | // Load autoloader for ci-phpunit-test |
36 | - require __DIR__ . '/autoloader.php'; |
|
36 | + require __DIR__.'/autoloader.php'; |
|
37 | 37 | |
38 | 38 | // Autoloader for PHP-Parser |
39 | 39 | // Don't use `require`, because we may have required already |
40 | 40 | // in `patcher/bootstrap.php` |
41 | - require_once __DIR__ . '/patcher/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
41 | + require_once __DIR__.'/patcher/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
42 | 42 | |
43 | - require APPPATH . '/tests/TestCase.php'; |
|
43 | + require APPPATH.'/tests/TestCase.php'; |
|
44 | 44 | |
45 | - $db_test_case_file = APPPATH . '/tests/DbTestCase.php'; |
|
45 | + $db_test_case_file = APPPATH.'/tests/DbTestCase.php'; |
|
46 | 46 | if (is_readable($db_test_case_file)) |
47 | 47 | { |
48 | 48 | require $db_test_case_file; |
49 | 49 | } |
50 | 50 | |
51 | 51 | // Replace a few Common functions |
52 | - require __DIR__ . '/replacing/core/Common.php'; |
|
53 | - require BASEPATH . 'core/Common.php'; |
|
52 | + require __DIR__.'/replacing/core/Common.php'; |
|
53 | + require BASEPATH.'core/Common.php'; |
|
54 | 54 | |
55 | 55 | // Workaround for missing CodeIgniter's error handler |
56 | 56 | // See https://github.com/kenjis/ci-phpunit-test/issues/37 |
57 | 57 | set_error_handler('_error_handler'); |
58 | 58 | |
59 | 59 | // Load new functions of CIPHPUnitTest |
60 | - require __DIR__ . '/functions.php'; |
|
60 | + require __DIR__.'/functions.php'; |
|
61 | 61 | // Load ci-phpunit-test CI_Loader |
62 | - require __DIR__ . '/replacing/core/Loader.php'; |
|
62 | + require __DIR__.'/replacing/core/Loader.php'; |
|
63 | 63 | // Load ci-phpunit-test CI_Input |
64 | - require __DIR__ . '/replacing/core/Input.php'; |
|
64 | + require __DIR__.'/replacing/core/Input.php'; |
|
65 | 65 | |
66 | 66 | // Change current directroy |
67 | 67 | chdir(FCPATH); |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | * |
74 | 74 | * And away we go... |
75 | 75 | */ |
76 | - require __DIR__ . '/replacing/core/CodeIgniter.php'; |
|
76 | + require __DIR__.'/replacing/core/CodeIgniter.php'; |
|
77 | 77 | |
78 | 78 | self::replaceHelpers(); |
79 | 79 | |
80 | 80 | // Create CodeIgniter instance |
81 | - if (! self::wiredesignzHmvcInstalled()) |
|
81 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
82 | 82 | { |
83 | 83 | new CI_Controller(); |
84 | 84 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | public static function createCodeIgniterInstance() |
101 | 101 | { |
102 | - if (! self::wiredesignzHmvcInstalled()) |
|
102 | + if ( ! self::wiredesignzHmvcInstalled()) |
|
103 | 103 | { |
104 | 104 | new CI_Controller(); |
105 | 105 | } |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | protected static function replaceLoader() |
129 | 129 | { |
130 | 130 | $my_loader_file = |
131 | - APPPATH . 'core/' . config_item('subclass_prefix') . 'Loader.php'; |
|
131 | + APPPATH.'core/'.config_item('subclass_prefix').'Loader.php'; |
|
132 | 132 | |
133 | 133 | if (file_exists($my_loader_file)) |
134 | 134 | { |
135 | - self::$loader_class = config_item('subclass_prefix') . 'Loader'; |
|
135 | + self::$loader_class = config_item('subclass_prefix').'Loader'; |
|
136 | 136 | if ( ! class_exists(self::$loader_class)) |
137 | 137 | { |
138 | 138 | require $my_loader_file; |
@@ -151,19 +151,19 @@ discard block |
||
151 | 151 | |
152 | 152 | protected static function loadHelper($helper) |
153 | 153 | { |
154 | - $my_helper_file = APPPATH . 'helpers/' . config_item('subclass_prefix') . $helper . '.php'; |
|
154 | + $my_helper_file = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; |
|
155 | 155 | if (file_exists($my_helper_file)) |
156 | 156 | { |
157 | 157 | require $my_helper_file; |
158 | 158 | } |
159 | - require __DIR__ . '/replacing/helpers/' . $helper . '.php'; |
|
159 | + require __DIR__.'/replacing/helpers/'.$helper.'.php'; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | public static function setPatcherCacheDir($dir = null) |
163 | 163 | { |
164 | 164 | if ($dir === null) |
165 | 165 | { |
166 | - $dir = APPPATH . 'tests/_ci_phpunit_test/tmp/cache'; |
|
166 | + $dir = APPPATH.'tests/_ci_phpunit_test/tmp/cache'; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | MonkeyPatchManager::setCacheDir( |
@@ -11,16 +11,16 @@ |
||
11 | 11 | // Autoloader for PHP-Parser |
12 | 12 | // Don't use `require`, because we must require it in CIPHPUnitTest::init() |
13 | 13 | // for providing autoloading when we don't use Monkey Patching |
14 | -require_once __DIR__ . '/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
14 | +require_once __DIR__.'/third_party/PHP-Parser-2.1.1/lib/bootstrap.php'; |
|
15 | 15 | |
16 | -require __DIR__ . '/IncludeStream.php'; |
|
17 | -require __DIR__ . '/PathChecker.php'; |
|
18 | -require __DIR__ . '/MonkeyPatchManager.php'; |
|
19 | -require __DIR__ . '/MonkeyPatch.php'; |
|
20 | -require __DIR__ . '/Cache.php'; |
|
21 | -require __DIR__ . '/InvocationVerifier.php'; |
|
16 | +require __DIR__.'/IncludeStream.php'; |
|
17 | +require __DIR__.'/PathChecker.php'; |
|
18 | +require __DIR__.'/MonkeyPatchManager.php'; |
|
19 | +require __DIR__.'/MonkeyPatch.php'; |
|
20 | +require __DIR__.'/Cache.php'; |
|
21 | +require __DIR__.'/InvocationVerifier.php'; |
|
22 | 22 | |
23 | -require __DIR__ . '/functions/exit__.php'; |
|
23 | +require __DIR__.'/functions/exit__.php'; |
|
24 | 24 | |
25 | 25 | const __GO_TO_ORIG__ = '__GO_TO_ORIG__'; |
26 | 26 |