@@ -302,5 +302,5 @@ |
||
| 302 | 302 | * @param array $data_array |
| 303 | 303 | * @return bool true on success fase on failure |
| 304 | 304 | */ |
| 305 | - public function createStructure($rootpath,$data_array); |
|
| 305 | + public function createStructure($rootpath, $data_array); |
|
| 306 | 306 | } |
@@ -248,7 +248,7 @@ |
||
| 248 | 248 | continue; |
| 249 | 249 | |
| 250 | 250 | $fparam = $df . (empty($sfx) ? $locale[$lkey][0] : ' ' . |
| 251 | - (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
|
| 251 | + (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
|
| 252 | 252 | |
| 253 | 253 | if (! empty($ago_single) && ! empty($dfs)) |
| 254 | 254 | break; |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | protected function setCwd($path = false, $validate_dir_name = false) |
| 39 | 39 | { |
| 40 | - if (empty($path)) |
|
| 40 | + if(empty($path)) |
|
| 41 | 41 | $current_working_directory = $this->getCwd(); |
| 42 | 42 | else |
| 43 | 43 | $current_working_directory = $this->makeAbsolute($path); |
| 44 | 44 | |
| 45 | - if (! empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name)) |
|
| 45 | + if(!empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name)) |
|
| 46 | 46 | return false; |
| 47 | 47 | |
| 48 | - if (! is_dir($current_working_directory) || ! is_readable($current_working_directory) || |
|
| 49 | - ! chdir($current_working_directory)) { |
|
| 48 | + if(!is_dir($current_working_directory) || !is_readable($current_working_directory) || |
|
| 49 | + !chdir($current_working_directory)) { |
|
| 50 | 50 | $this->alert(200, false, $current_working_directory); |
| 51 | 51 | return false; |
| 52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function getCwd() |
| 63 | 63 | { |
| 64 | - if (empty($this->cwd)) |
|
| 64 | + if(empty($this->cwd)) |
|
| 65 | 65 | $this->cwd = getcwd(); |
| 66 | 66 | |
| 67 | 67 | return $this->cwd; |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getSize($convert = false, $filename = false) |
| 76 | 76 | { |
| 77 | - $filename = ! empty($filename) ? $this->makeAbsolute($filename) : false; |
|
| 77 | + $filename = !empty($filename) ? $this->makeAbsolute($filename) : false; |
|
| 78 | 78 | $bytestotal = empty($filename) ? ((method_exists(get_parent_class($this), 'getSize')) ? parent::getSize() : false) : filesize( |
| 79 | 79 | $filename); |
| 80 | 80 | |
| 81 | - if (! $this->isDir($filename) && empty($convert)) |
|
| 81 | + if(!$this->isDir($filename) && empty($convert)) |
|
| 82 | 82 | return $bytestotal; |
| 83 | 83 | |
| 84 | 84 | $suffixes = array( |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | 'ZB', |
| 93 | 93 | 'YB' |
| 94 | 94 | ); |
| 95 | - if ($this->isDir($filename)) { |
|
| 95 | + if($this->isDir($filename)) { |
|
| 96 | 96 | $path = ((method_exists(get_class($this), 'getPathname')) ? $this->getPathname() : $filename); |
| 97 | - if ($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log') |
|
| 97 | + if($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log') |
|
| 98 | 98 | die('ss'); |
| 99 | 99 | |
| 100 | - foreach (new RecursiveIteratorIterator( |
|
| 100 | + foreach(new RecursiveIteratorIterator( |
|
| 101 | 101 | new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)) as $object) { |
| 102 | 102 | $bytestotal += $object->getSize(); |
| 103 | 103 | } |
| 104 | - if (! $convert) |
|
| 104 | + if(!$convert) |
|
| 105 | 105 | return $bytestotal; |
| 106 | 106 | } |
| 107 | 107 | $base = log($bytestotal, 1024); |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | 0, |
| 111 | 111 | 'B' |
| 112 | 112 | ]; |
| 113 | - if ($bytestotal > 0) { |
|
| 113 | + if($bytestotal > 0) { |
|
| 114 | 114 | |
| 115 | 115 | $result = array( |
| 116 | 116 | round(pow(1024, $base - floor($base)), 2), |
| 117 | 117 | $suffixes[floor($base)] |
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | - return ! empty($convert) ? $result : $result[0]; |
|
| 120 | + return !empty($convert) ? $result : $result[0]; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | public function getATime($timeformat = false, $pathname = false) |
| 129 | 129 | { |
| 130 | 130 | $atime = empty($pathname) ? parent::getATime() : fileatime($this->makeAbsolute($pathname)); |
| 131 | - if (! empty($timeformat) && is_int($atime)) { |
|
| 132 | - switch ($timeformat) { |
|
| 131 | + if(!empty($timeformat) && is_int($atime)) { |
|
| 132 | + switch($timeformat) { |
|
| 133 | 133 | case 'ago': |
| 134 | 134 | $atime = $this->ct_ago($atime, 'y,m,d,h,i,s', false, true); |
| 135 | 135 | break; |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | public function getCTime($timeformat = false, $pathname = false) |
| 153 | 153 | { |
| 154 | 154 | $ctime = empty($pathname) ? parent::getCTime() : filectime($this->makeAbsolute($pathname)); |
| 155 | - if (! empty($timeformat) && is_int($ctime)) { |
|
| 156 | - switch ($timeformat) { |
|
| 155 | + if(!empty($timeformat) && is_int($ctime)) { |
|
| 156 | + switch($timeformat) { |
|
| 157 | 157 | case 'ago': |
| 158 | 158 | $ctime = $this->ct_ago($ctime, 'y,m,d,h,i,s', false, true); |
| 159 | 159 | break; |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | public function getMTime($timeformat = false, $pathname = false) |
| 177 | 177 | { |
| 178 | 178 | $mtime = empty($pathname) ? parent::getMTime() : filemtime($this->makeAbsolute($pathname)); |
| 179 | - if (! empty($timeformat) && is_int($mtime)) { |
|
| 180 | - switch ($timeformat) { |
|
| 179 | + if(!empty($timeformat) && is_int($mtime)) { |
|
| 180 | + switch($timeformat) { |
|
| 181 | 181 | case 'ago': |
| 182 | 182 | $mtime = $this->ct_ago($mtime, 'y,m,d,h,i,s', false, true); |
| 183 | 183 | break; |
@@ -241,21 +241,21 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $interval = $date->diff(new DateTime('now')); |
| 243 | 243 | |
| 244 | - for ($df = strtok($date_format, ','); $df !== false; $df = strtok(",")) { |
|
| 244 | + for($df = strtok($date_format, ','); $df !== false; $df = strtok(",")) { |
|
| 245 | 245 | $lkey = ($df !== 'a') ? strtolower($df) : 'days'; |
| 246 | 246 | |
| 247 | - if ($ommit_zero && $interval->$lkey === 0) |
|
| 247 | + if($ommit_zero && $interval->$lkey === 0) |
|
| 248 | 248 | continue; |
| 249 | 249 | |
| 250 | 250 | $fparam = $df . (empty($sfx) ? $locale[$lkey][0] : ' ' . |
| 251 | 251 | (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
| 252 | 252 | |
| 253 | - if (! empty($ago_single) && ! empty($dfs)) |
|
| 253 | + if(!empty($ago_single) && !empty($dfs)) |
|
| 254 | 254 | break; |
| 255 | 255 | else |
| 256 | - $dfs = ! empty($dfs) ? $dfs . "%$fparam " : "%$fparam "; |
|
| 256 | + $dfs = !empty($dfs) ? $dfs . "%$fparam " : "%$fparam "; |
|
| 257 | 257 | } |
| 258 | - if (empty($dfs)) |
|
| 258 | + if(empty($dfs)) |
|
| 259 | 259 | $ret = $locale['now']; |
| 260 | 260 | else |
| 261 | 261 | $ret = $interval->format($dfs) . $locale['ago']; |
@@ -269,10 +269,10 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public function openFile($open_mode = "r", $use_include_path = false, $context = null) |
| 271 | 271 | { |
| 272 | - if (! method_exists(get_parent_class($this), 'openFile')) |
|
| 272 | + if(!method_exists(get_parent_class($this), 'openFile')) |
|
| 273 | 273 | return false; |
| 274 | 274 | |
| 275 | - return ! $this->isDir() ? (! empty($context) ? parent::openFile($open_mode, $use_include_path, |
|
| 275 | + return !$this->isDir() ? (!empty($context) ? parent::openFile($open_mode, $use_include_path, |
|
| 276 | 276 | $context) : parent::openFile($open_mode, $use_include_path)) : false; |
| 277 | 277 | } |
| 278 | 278 | |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function setFileClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\FileObject") |
| 285 | 285 | { |
| 286 | - if (! method_exists(get_parent_class($this), 'setFileClass')) |
|
| 286 | + if(!method_exists(get_parent_class($this), 'setFileClass')) |
|
| 287 | 287 | return false; |
| 288 | 288 | |
| 289 | - if (is_subclass_of($class_name, 'SplFileObject') || $class_name === 'SplFileObject') { |
|
| 289 | + if(is_subclass_of($class_name, 'SplFileObject') || $class_name === 'SplFileObject') { |
|
| 290 | 290 | parent::setFileClass($class_name); |
| 291 | 291 | return true; |
| 292 | 292 | } |
@@ -300,10 +300,10 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | public function setInfoClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject") |
| 302 | 302 | { |
| 303 | - if (! method_exists(get_parent_class($this), 'setInfoClass')) |
|
| 303 | + if(!method_exists(get_parent_class($this), 'setInfoClass')) |
|
| 304 | 304 | return false; |
| 305 | 305 | |
| 306 | - if (is_subclass_of($class_name, 'SplFileInfo') || $class_name === 'SplFileInfo') { |
|
| 306 | + if(is_subclass_of($class_name, 'SplFileInfo') || $class_name === 'SplFileInfo') { |
|
| 307 | 307 | parent::setInfoClass($class_name); |
| 308 | 308 | return true; |
| 309 | 309 | } |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function getOwnerName($filename = false) |
| 319 | 319 | { |
| 320 | - $userID = empty($filename) && method_exists(get_parent_class($this), 'getOwner') ? parent::getOwner() : (! empty( |
|
| 320 | + $userID = empty($filename) && method_exists(get_parent_class($this), 'getOwner') ? parent::getOwner() : (!empty( |
|
| 321 | 321 | $filename) ? fileowner($this->makeAbsolute($filename)) : false); |
| 322 | - $user = ! empty($userID) ? posix_getpwuid($userID) : false; |
|
| 322 | + $user = !empty($userID) ? posix_getpwuid($userID) : false; |
|
| 323 | 323 | return is_array($user) && array_key_exists('name', $user) ? $user['name'] : false; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | { |
| 333 | 333 | $groupID = empty($filename) ? ((method_exists(get_parent_class($this), 'getGroup')) ? parent::getGroup() : false) : filegroup( |
| 334 | 334 | $this->makeAbsolute($filename)); |
| 335 | - $group = ! empty($groupID) ? posix_getgrgid($groupID) : false; |
|
| 336 | - return ! empty($group) && array_key_exists('name', $group) ? $group['name'] : false; |
|
| 335 | + $group = !empty($groupID) ? posix_getgrgid($groupID) : false; |
|
| 336 | + return !empty($group) && array_key_exists('name', $group) ? $group['name'] : false; |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | public function getRealpath($filename = false) |
| 345 | 345 | { |
| 346 | - return ! empty($filename) ? realpath($this->makeAbsolute($filename)) : ((method_exists( |
|
| 346 | + return !empty($filename) ? realpath($this->makeAbsolute($filename)) : ((method_exists( |
|
| 347 | 347 | get_parent_class($this), 'getRealpath')) ? parent::getRealpath() : false); |
| 348 | 348 | } |
| 349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | public function getPathInfo($filename = false, $flags = false, |
| 356 | 356 | $class_name = '\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject') |
| 357 | 357 | { |
| 358 | - return ! empty($filename) ? empty($flags) ? pathinfo($this->makeAbsolute($filename)) : pathinfo( |
|
| 358 | + return !empty($filename) ? empty($flags) ? pathinfo($this->makeAbsolute($filename)) : pathinfo( |
|
| 359 | 359 | $this->makeAbsolute($filename), $flags) : (method_exists(get_parent_class($this), 'getPathInfo') ? parent::getPathInfo( |
| 360 | 360 | $class_name) : false); |
| 361 | 361 | } |
@@ -421,9 +421,9 @@ discard block |
||
| 421 | 421 | */ |
| 422 | 422 | public function getBasename($suffix = false, $pathname = false) |
| 423 | 423 | { |
| 424 | - $pathname = ! empty($pathname) ? $pathname : ($this->isDot() ? $this->getPath() : false); |
|
| 425 | - $suffix = ! empty($suffix) ? $suffix : ''; |
|
| 426 | - return ! empty($pathname) || ! method_exists(get_parent_class($this), 'getBasename') ? basename( |
|
| 424 | + $pathname = !empty($pathname) ? $pathname : ($this->isDot() ? $this->getPath() : false); |
|
| 425 | + $suffix = !empty($suffix) ? $suffix : ''; |
|
| 426 | + return !empty($pathname) || !method_exists(get_parent_class($this), 'getBasename') ? basename( |
|
| 427 | 427 | $pathname, $suffix) : parent::getBasename($suffix); |
| 428 | 428 | } |
| 429 | 429 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | { |
| 437 | 437 | $perms = empty($filename) ? ((method_exists(get_parent_class($this), 'getPerms')) ? parent::getPerms() : false) : fileperms( |
| 438 | 438 | $this->makeAbsolute($filename)); |
| 439 | - return ! empty($perms) ? (int) ltrim(substr(sprintf('%o', $perms), - 4), '0') : false; |
|
| 439 | + return !empty($perms) ? (int) ltrim(substr(sprintf('%o', $perms), - 4), '0') : false; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public function getType($filename = false) |
| 448 | 448 | { |
| 449 | - return ! empty($filename) ? filetype($this->makeAbsolute($filename)) : ((method_exists( |
|
| 449 | + return !empty($filename) ? filetype($this->makeAbsolute($filename)) : ((method_exists( |
|
| 450 | 450 | get_parent_class($this), 'getType')) ? parent::getType() : false); |
| 451 | 451 | } |
| 452 | 452 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | public function isExecutable($filename = false) |
| 525 | 525 | { |
| 526 | - return ! empty($filename) ? is_executable($this->makeAbsolute($filename)) : ((method_exists( |
|
| 526 | + return !empty($filename) ? is_executable($this->makeAbsolute($filename)) : ((method_exists( |
|
| 527 | 527 | get_parent_class($this), 'isExecutable')) ? parent::isExecutable() : false); |
| 528 | 528 | } |
| 529 | 529 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | */ |
| 535 | 535 | public function isFile($filename = false) |
| 536 | 536 | { |
| 537 | - return ! empty($filename) ? is_file($this->makeAbsolute($filename)) : ((method_exists( |
|
| 537 | + return !empty($filename) ? is_file($this->makeAbsolute($filename)) : ((method_exists( |
|
| 538 | 538 | get_parent_class($this), 'isFile')) ? parent::isFile() : false); |
| 539 | 539 | } |
| 540 | 540 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | */ |
| 546 | 546 | public function isLink($filename = false) |
| 547 | 547 | { |
| 548 | - return ! empty($filename) ? is_link($this->makeAbsolute($filename)) : ((method_exists( |
|
| 548 | + return !empty($filename) ? is_link($this->makeAbsolute($filename)) : ((method_exists( |
|
| 549 | 549 | get_parent_class($this), 'isLink')) ? parent::isLink() : false); |
| 550 | 550 | } |
| 551 | 551 | |
@@ -556,13 +556,13 @@ discard block |
||
| 556 | 556 | */ |
| 557 | 557 | public function makeAbsolute($path = false) |
| 558 | 558 | { |
| 559 | - if (! empty($path) && $this->isAbsolute($path)) |
|
| 559 | + if(!empty($path) && $this->isAbsolute($path)) |
|
| 560 | 560 | $absolute_path = $path; |
| 561 | - elseif (! empty($path) && $this->isRelative($path)) { |
|
| 561 | + elseif(!empty($path) && $this->isRelative($path)) { |
|
| 562 | 562 | |
| 563 | - if (preg_match('/^(~\/)/', $path) === 1) { |
|
| 563 | + if(preg_match('/^(~\/)/', $path) === 1) { |
|
| 564 | 564 | $absolute_path = getenv("HOME") . substr($path, 1); |
| 565 | - } elseif (preg_match('/^(.\/|..\/)/', $path) === 1) { |
|
| 565 | + } elseif(preg_match('/^(.\/|..\/)/', $path) === 1) { |
|
| 566 | 566 | $absolute_path = realpath($path); |
| 567 | 567 | } else |
| 568 | 568 | $absolute_path = $this->getCwd() . ($path !== '.' ? DIRECTORY_SEPARATOR . $path : ''); |
@@ -579,12 +579,12 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | public function exists($pathname = false) |
| 581 | 581 | { |
| 582 | - if (empty($pathname)) |
|
| 582 | + if(empty($pathname)) |
|
| 583 | 583 | return false; |
| 584 | 584 | |
| 585 | 585 | $pathname = $this->makeAbsolute($pathname); |
| 586 | 586 | |
| 587 | - return ! empty($pathname) ? file_exists($pathname) : false; |
|
| 587 | + return !empty($pathname) ? file_exists($pathname) : false; |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | */ |
| 595 | 595 | public function getFilename($filename = false) |
| 596 | 596 | { |
| 597 | - return ! empty($filename) ? basename($this->makeAbsolute($filename)) : ((method_exists( |
|
| 597 | + return !empty($filename) ? basename($this->makeAbsolute($filename)) : ((method_exists( |
|
| 598 | 598 | get_parent_class($this), 'getFilename')) ? parent::getFilename() : false); |
| 599 | 599 | } |
| 600 | 600 | |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | */ |
| 606 | 606 | public function getExtension($filename = false) |
| 607 | 607 | { |
| 608 | - return ! empty($filename) ? pathinfo($this->makeAbsolute($filename), PATHINFO_EXTENSION) : ((method_exists( |
|
| 608 | + return !empty($filename) ? pathinfo($this->makeAbsolute($filename), PATHINFO_EXTENSION) : ((method_exists( |
|
| 609 | 609 | get_parent_class($this), 'getExtension')) ? parent::getExtension() : false); |
| 610 | 610 | } |
| 611 | 611 | } |
@@ -248,7 +248,7 @@ |
||
| 248 | 248 | continue; |
| 249 | 249 | |
| 250 | 250 | $fparam = $df . (empty($sfx) ? $locale[$lkey][0] : ' ' . |
| 251 | - (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
|
| 251 | + (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
|
| 252 | 252 | |
| 253 | 253 | if (! empty($ago_single) && ! empty($dfs)) |
| 254 | 254 | break; |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | protected function setCwd($path = false, $validate_dir_name = false) |
| 39 | 39 | { |
| 40 | - if (empty($path)) |
|
| 40 | + if(empty($path)) |
|
| 41 | 41 | $current_working_directory = $this->getCwd(); |
| 42 | 42 | else |
| 43 | 43 | $current_working_directory = $this->makeAbsolute($path); |
| 44 | 44 | |
| 45 | - if (! empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name)) |
|
| 45 | + if(!empty($validate_dir_name) && (basename($current_working_directory) !== $validate_dir_name)) |
|
| 46 | 46 | return false; |
| 47 | 47 | |
| 48 | - if (! is_dir($current_working_directory) || ! is_readable($current_working_directory) || |
|
| 49 | - ! chdir($current_working_directory)) { |
|
| 48 | + if(!is_dir($current_working_directory) || !is_readable($current_working_directory) || |
|
| 49 | + !chdir($current_working_directory)) { |
|
| 50 | 50 | $this->alert(200, false, $current_working_directory); |
| 51 | 51 | return false; |
| 52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function getCwd() |
| 63 | 63 | { |
| 64 | - if (empty($this->cwd)) |
|
| 64 | + if(empty($this->cwd)) |
|
| 65 | 65 | $this->cwd = getcwd(); |
| 66 | 66 | |
| 67 | 67 | return $this->cwd; |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getSize($convert = false, $filename = false) |
| 76 | 76 | { |
| 77 | - $filename = ! empty($filename) ? $this->makeAbsolute($filename) : false; |
|
| 77 | + $filename = !empty($filename) ? $this->makeAbsolute($filename) : false; |
|
| 78 | 78 | $bytestotal = empty($filename) ? ((method_exists(get_parent_class($this), 'getSize')) ? parent::getSize() : false) : filesize( |
| 79 | 79 | $filename); |
| 80 | 80 | |
| 81 | - if (! $this->isDir($filename) && empty($convert)) |
|
| 81 | + if(!$this->isDir($filename) && empty($convert)) |
|
| 82 | 82 | return $bytestotal; |
| 83 | 83 | |
| 84 | 84 | $suffixes = array( |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | 'ZB', |
| 93 | 93 | 'YB' |
| 94 | 94 | ); |
| 95 | - if ($this->isDir($filename)) { |
|
| 95 | + if($this->isDir($filename)) { |
|
| 96 | 96 | $path = ((method_exists(get_class($this), 'getPathname')) ? $this->getPathname() : $filename); |
| 97 | - if ($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log') |
|
| 97 | + if($path === '/home/nitrotrigger/tmp/libhowi-filesystem/log/phpunit_test.log') |
|
| 98 | 98 | die('ss'); |
| 99 | 99 | |
| 100 | - foreach (new RecursiveIteratorIterator( |
|
| 100 | + foreach(new RecursiveIteratorIterator( |
|
| 101 | 101 | new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)) as $object) { |
| 102 | 102 | $bytestotal += $object->getSize(); |
| 103 | 103 | } |
| 104 | - if (! $convert) |
|
| 104 | + if(!$convert) |
|
| 105 | 105 | return $bytestotal; |
| 106 | 106 | } |
| 107 | 107 | $base = log($bytestotal, 1024); |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | 0, |
| 111 | 111 | 'B' |
| 112 | 112 | ]; |
| 113 | - if ($bytestotal > 0) { |
|
| 113 | + if($bytestotal > 0) { |
|
| 114 | 114 | |
| 115 | 115 | $result = array( |
| 116 | 116 | round(pow(1024, $base - floor($base)), 2), |
| 117 | 117 | $suffixes[floor($base)] |
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | - return ! empty($convert) ? $result : $result[0]; |
|
| 120 | + return !empty($convert) ? $result : $result[0]; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | public function getATime($timeformat = false, $pathname = false) |
| 129 | 129 | { |
| 130 | 130 | $atime = empty($pathname) ? parent::getATime() : fileatime($this->makeAbsolute($pathname)); |
| 131 | - if (! empty($timeformat) && is_int($atime)) { |
|
| 132 | - switch ($timeformat) { |
|
| 131 | + if(!empty($timeformat) && is_int($atime)) { |
|
| 132 | + switch($timeformat) { |
|
| 133 | 133 | case 'ago': |
| 134 | 134 | $atime = $this->ct_ago($atime, 'y,m,d,h,i,s', false, true); |
| 135 | 135 | break; |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | public function getCTime($timeformat = false, $pathname = false) |
| 153 | 153 | { |
| 154 | 154 | $ctime = empty($pathname) ? parent::getCTime() : filectime($this->makeAbsolute($pathname)); |
| 155 | - if (! empty($timeformat) && is_int($ctime)) { |
|
| 156 | - switch ($timeformat) { |
|
| 155 | + if(!empty($timeformat) && is_int($ctime)) { |
|
| 156 | + switch($timeformat) { |
|
| 157 | 157 | case 'ago': |
| 158 | 158 | $ctime = $this->ct_ago($ctime, 'y,m,d,h,i,s', false, true); |
| 159 | 159 | break; |
@@ -176,8 +176,8 @@ discard block |
||
| 176 | 176 | public function getMTime($timeformat = false, $pathname = false) |
| 177 | 177 | { |
| 178 | 178 | $mtime = empty($pathname) ? parent::getMTime() : filemtime($this->makeAbsolute($pathname)); |
| 179 | - if (! empty($timeformat) && is_int($mtime)) { |
|
| 180 | - switch ($timeformat) { |
|
| 179 | + if(!empty($timeformat) && is_int($mtime)) { |
|
| 180 | + switch($timeformat) { |
|
| 181 | 181 | case 'ago': |
| 182 | 182 | $mtime = $this->ct_ago($mtime, 'y,m,d,h,i,s', false, true); |
| 183 | 183 | break; |
@@ -241,21 +241,21 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $interval = $date->diff(new DateTime('now')); |
| 243 | 243 | |
| 244 | - for ($df = strtok($date_format, ','); $df !== false; $df = strtok(",")) { |
|
| 244 | + for($df = strtok($date_format, ','); $df !== false; $df = strtok(",")) { |
|
| 245 | 245 | $lkey = ($df !== 'a') ? strtolower($df) : 'days'; |
| 246 | 246 | |
| 247 | - if ($ommit_zero && $interval->$lkey === 0) |
|
| 247 | + if($ommit_zero && $interval->$lkey === 0) |
|
| 248 | 248 | continue; |
| 249 | 249 | |
| 250 | 250 | $fparam = $df . (empty($sfx) ? $locale[$lkey][0] : ' ' . |
| 251 | 251 | (($interval->$lkey === 1) ? $locale[$lkey][1] : $locale[$lkey][2])); |
| 252 | 252 | |
| 253 | - if (! empty($ago_single) && ! empty($dfs)) |
|
| 253 | + if(!empty($ago_single) && !empty($dfs)) |
|
| 254 | 254 | break; |
| 255 | 255 | else |
| 256 | - $dfs = ! empty($dfs) ? $dfs . "%$fparam " : "%$fparam "; |
|
| 256 | + $dfs = !empty($dfs) ? $dfs . "%$fparam " : "%$fparam "; |
|
| 257 | 257 | } |
| 258 | - if (empty($dfs)) |
|
| 258 | + if(empty($dfs)) |
|
| 259 | 259 | $ret = $locale['now']; |
| 260 | 260 | else |
| 261 | 261 | $ret = $interval->format($dfs) . $locale['ago']; |
@@ -269,10 +269,10 @@ discard block |
||
| 269 | 269 | */ |
| 270 | 270 | public function openFile($open_mode = "r", $use_include_path = false, $context = null) |
| 271 | 271 | { |
| 272 | - if (! method_exists(get_parent_class($this), 'openFile')) |
|
| 272 | + if(!method_exists(get_parent_class($this), 'openFile')) |
|
| 273 | 273 | return false; |
| 274 | 274 | |
| 275 | - return ! $this->isDir() ? (! empty($context) ? parent::openFile($open_mode, $use_include_path, |
|
| 275 | + return !$this->isDir() ? (!empty($context) ? parent::openFile($open_mode, $use_include_path, |
|
| 276 | 276 | $context) : parent::openFile($open_mode, $use_include_path)) : false; |
| 277 | 277 | } |
| 278 | 278 | |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | public function setFileClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\FileObject") |
| 285 | 285 | { |
| 286 | - if (! method_exists(get_parent_class($this), 'setFileClass')) |
|
| 286 | + if(!method_exists(get_parent_class($this), 'setFileClass')) |
|
| 287 | 287 | return false; |
| 288 | 288 | |
| 289 | - if (is_subclass_of($class_name, 'SplFileObject') || $class_name === 'SplFileObject') { |
|
| 289 | + if(is_subclass_of($class_name, 'SplFileObject') || $class_name === 'SplFileObject') { |
|
| 290 | 290 | parent::setFileClass($class_name); |
| 291 | 291 | return true; |
| 292 | 292 | } |
@@ -300,10 +300,10 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | public function setInfoClass($class_name = "\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject") |
| 302 | 302 | { |
| 303 | - if (! method_exists(get_parent_class($this), 'setInfoClass')) |
|
| 303 | + if(!method_exists(get_parent_class($this), 'setInfoClass')) |
|
| 304 | 304 | return false; |
| 305 | 305 | |
| 306 | - if (is_subclass_of($class_name, 'SplFileInfo') || $class_name === 'SplFileInfo') { |
|
| 306 | + if(is_subclass_of($class_name, 'SplFileInfo') || $class_name === 'SplFileInfo') { |
|
| 307 | 307 | parent::setInfoClass($class_name); |
| 308 | 308 | return true; |
| 309 | 309 | } |
@@ -317,9 +317,9 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function getOwnerName($filename = false) |
| 319 | 319 | { |
| 320 | - $userID = empty($filename) && method_exists(get_parent_class($this), 'getOwner') ? parent::getOwner() : (! empty( |
|
| 320 | + $userID = empty($filename) && method_exists(get_parent_class($this), 'getOwner') ? parent::getOwner() : (!empty( |
|
| 321 | 321 | $filename) ? fileowner($this->makeAbsolute($filename)) : false); |
| 322 | - $user = ! empty($userID) ? posix_getpwuid($userID) : false; |
|
| 322 | + $user = !empty($userID) ? posix_getpwuid($userID) : false; |
|
| 323 | 323 | return is_array($user) && array_key_exists('name', $user) ? $user['name'] : false; |
| 324 | 324 | } |
| 325 | 325 | |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | { |
| 333 | 333 | $groupID = empty($filename) ? ((method_exists(get_parent_class($this), 'getGroup')) ? parent::getGroup() : false) : filegroup( |
| 334 | 334 | $this->makeAbsolute($filename)); |
| 335 | - $group = ! empty($groupID) ? posix_getgrgid($groupID) : false; |
|
| 336 | - return ! empty($group) && array_key_exists('name', $group) ? $group['name'] : false; |
|
| 335 | + $group = !empty($groupID) ? posix_getgrgid($groupID) : false; |
|
| 336 | + return !empty($group) && array_key_exists('name', $group) ? $group['name'] : false; |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | */ |
| 344 | 344 | public function getRealpath($filename = false) |
| 345 | 345 | { |
| 346 | - return ! empty($filename) ? realpath($this->makeAbsolute($filename)) : ((method_exists( |
|
| 346 | + return !empty($filename) ? realpath($this->makeAbsolute($filename)) : ((method_exists( |
|
| 347 | 347 | get_parent_class($this), 'getRealpath')) ? parent::getRealpath() : false); |
| 348 | 348 | } |
| 349 | 349 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | public function getPathInfo($filename = false, $flags = false, |
| 356 | 356 | $class_name = '\HOWI3\libhowi\Filesystem\php5\Objects\InfoObject') |
| 357 | 357 | { |
| 358 | - return ! empty($filename) ? empty($flags) ? pathinfo($this->makeAbsolute($filename)) : pathinfo( |
|
| 358 | + return !empty($filename) ? empty($flags) ? pathinfo($this->makeAbsolute($filename)) : pathinfo( |
|
| 359 | 359 | $this->makeAbsolute($filename), $flags) : (method_exists(get_parent_class($this), 'getPathInfo') ? parent::getPathInfo( |
| 360 | 360 | $class_name) : false); |
| 361 | 361 | } |
@@ -421,9 +421,9 @@ discard block |
||
| 421 | 421 | */ |
| 422 | 422 | public function getBasename($suffix = false, $pathname = false) |
| 423 | 423 | { |
| 424 | - $pathname = ! empty($pathname) ? $pathname : ($this->isDot() ? $this->getPath() : false); |
|
| 425 | - $suffix = ! empty($suffix) ? $suffix : ''; |
|
| 426 | - return ! empty($pathname) || ! method_exists(get_parent_class($this), 'getBasename') ? basename( |
|
| 424 | + $pathname = !empty($pathname) ? $pathname : ($this->isDot() ? $this->getPath() : false); |
|
| 425 | + $suffix = !empty($suffix) ? $suffix : ''; |
|
| 426 | + return !empty($pathname) || !method_exists(get_parent_class($this), 'getBasename') ? basename( |
|
| 427 | 427 | $pathname, $suffix) : parent::getBasename($suffix); |
| 428 | 428 | } |
| 429 | 429 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | { |
| 437 | 437 | $perms = empty($filename) ? ((method_exists(get_parent_class($this), 'getPerms')) ? parent::getPerms() : false) : fileperms( |
| 438 | 438 | $this->makeAbsolute($filename)); |
| 439 | - return ! empty($perms) ? (int) ltrim(substr(sprintf('%o', $perms), - 4), '0') : false; |
|
| 439 | + return !empty($perms) ? (int) ltrim(substr(sprintf('%o', $perms), - 4), '0') : false; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | /** |
@@ -446,7 +446,7 @@ discard block |
||
| 446 | 446 | */ |
| 447 | 447 | public function getType($filename = false) |
| 448 | 448 | { |
| 449 | - return ! empty($filename) ? filetype($this->makeAbsolute($filename)) : ((method_exists( |
|
| 449 | + return !empty($filename) ? filetype($this->makeAbsolute($filename)) : ((method_exists( |
|
| 450 | 450 | get_parent_class($this), 'getType')) ? parent::getType() : false); |
| 451 | 451 | } |
| 452 | 452 | |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | */ |
| 524 | 524 | public function isExecutable($filename = false) |
| 525 | 525 | { |
| 526 | - return ! empty($filename) ? is_executable($this->makeAbsolute($filename)) : ((method_exists( |
|
| 526 | + return !empty($filename) ? is_executable($this->makeAbsolute($filename)) : ((method_exists( |
|
| 527 | 527 | get_parent_class($this), 'isExecutable')) ? parent::isExecutable() : false); |
| 528 | 528 | } |
| 529 | 529 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | */ |
| 535 | 535 | public function isFile($filename = false) |
| 536 | 536 | { |
| 537 | - return ! empty($filename) ? is_file($this->makeAbsolute($filename)) : ((method_exists( |
|
| 537 | + return !empty($filename) ? is_file($this->makeAbsolute($filename)) : ((method_exists( |
|
| 538 | 538 | get_parent_class($this), 'isFile')) ? parent::isFile() : false); |
| 539 | 539 | } |
| 540 | 540 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | */ |
| 546 | 546 | public function isLink($filename = false) |
| 547 | 547 | { |
| 548 | - return ! empty($filename) ? is_link($this->makeAbsolute($filename)) : ((method_exists( |
|
| 548 | + return !empty($filename) ? is_link($this->makeAbsolute($filename)) : ((method_exists( |
|
| 549 | 549 | get_parent_class($this), 'isLink')) ? parent::isLink() : false); |
| 550 | 550 | } |
| 551 | 551 | |
@@ -556,13 +556,13 @@ discard block |
||
| 556 | 556 | */ |
| 557 | 557 | public function makeAbsolute($path = false) |
| 558 | 558 | { |
| 559 | - if (! empty($path) && $this->isAbsolute($path)) |
|
| 559 | + if(!empty($path) && $this->isAbsolute($path)) |
|
| 560 | 560 | $absolute_path = $path; |
| 561 | - elseif (! empty($path) && $this->isRelative($path)) { |
|
| 561 | + elseif(!empty($path) && $this->isRelative($path)) { |
|
| 562 | 562 | |
| 563 | - if (preg_match('/^(~\/)/', $path) === 1) { |
|
| 563 | + if(preg_match('/^(~\/)/', $path) === 1) { |
|
| 564 | 564 | $absolute_path = getenv("HOME") . substr($path, 1); |
| 565 | - } elseif (preg_match('/^(.\/|..\/)/', $path) === 1) { |
|
| 565 | + } elseif(preg_match('/^(.\/|..\/)/', $path) === 1) { |
|
| 566 | 566 | $absolute_path = realpath($path); |
| 567 | 567 | } else |
| 568 | 568 | $absolute_path = $this->getCwd() . ($path !== '.' ? DIRECTORY_SEPARATOR . $path : ''); |
@@ -579,12 +579,12 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | public function exists($pathname = false) |
| 581 | 581 | { |
| 582 | - if (empty($pathname)) |
|
| 582 | + if(empty($pathname)) |
|
| 583 | 583 | return false; |
| 584 | 584 | |
| 585 | 585 | $pathname = $this->makeAbsolute($pathname); |
| 586 | 586 | |
| 587 | - return ! empty($pathname) ? file_exists($pathname) : false; |
|
| 587 | + return !empty($pathname) ? file_exists($pathname) : false; |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | */ |
| 595 | 595 | public function getFilename($filename = false) |
| 596 | 596 | { |
| 597 | - return ! empty($filename) ? basename($this->makeAbsolute($filename)) : ((method_exists( |
|
| 597 | + return !empty($filename) ? basename($this->makeAbsolute($filename)) : ((method_exists( |
|
| 598 | 598 | get_parent_class($this), 'getFilename')) ? parent::getFilename() : false); |
| 599 | 599 | } |
| 600 | 600 | |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | */ |
| 606 | 606 | public function getExtension($filename = false) |
| 607 | 607 | { |
| 608 | - return ! empty($filename) ? pathinfo($this->makeAbsolute($filename), PATHINFO_EXTENSION) : ((method_exists( |
|
| 608 | + return !empty($filename) ? pathinfo($this->makeAbsolute($filename), PATHINFO_EXTENSION) : ((method_exists( |
|
| 609 | 609 | get_parent_class($this), 'getExtension')) ? parent::getExtension() : false); |
| 610 | 610 | } |
| 611 | 611 | } |
@@ -186,14 +186,14 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $this->response->setCode($code); |
| 188 | 188 | $this->response->setTime(); |
| 189 | - $this->response->setMsg($this->{$LEVEL}[$code] . (! empty($append_msg) ? ' - ' . $append_msg : '')); |
|
| 189 | + $this->response->setMsg($this->{$LEVEL}[$code] . (!empty($append_msg) ? ' - ' . $append_msg : '')); |
|
| 190 | 190 | $this->response->setUID($this->getUID()); |
| 191 | 191 | $this->response->setUsername($this->getUsername()); |
| 192 | 192 | $this->response->setContext($context); |
| 193 | 193 | $this->response->setLevel($LEVEL); |
| 194 | 194 | |
| 195 | 195 | $logging = $this->getLogFile(); |
| 196 | - if (! empty($logging) && ! empty($to_file)) |
|
| 196 | + if(!empty($logging) && !empty($to_file)) |
|
| 197 | 197 | $this->logToFile($LEVEL); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $message .= '[msg] ' . $this->getMsg() . ' [/msg]' . "\n"; |
| 212 | 212 | |
| 213 | 213 | $logging = $this->getLogFile(); |
| 214 | - if (empty($logging) || ! is_dir(dirname($logging))) |
|
| 214 | + if(empty($logging) || !is_dir(dirname($logging))) |
|
| 215 | 215 | return false; |
| 216 | 216 | return file_put_contents($logging, $message, FILE_APPEND); |
| 217 | 217 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | public function setLogFile($filepath = false) |
| 236 | 236 | { |
| 237 | 237 | $logfilepath = $this->makeAbsolute($filepath); |
| 238 | - if (empty($filepath) || ! $this->isWritable(dirname($logfilepath))) { |
|
| 238 | + if(empty($filepath) || !$this->isWritable(dirname($logfilepath))) { |
|
| 239 | 239 | $this->error(400, 'setLogFile'); |
| 240 | 240 | return false; |
| 241 | 241 | } |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | */ |
| 327 | 327 | public function getCode() |
| 328 | 328 | { |
| 329 | - return ! is_object($this->response) ? 0 : $this->response->getCode(); |
|
| 329 | + return !is_object($this->response) ? 0 : $this->response->getCode(); |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function setStatus($status) |
| 366 | 366 | { |
| 367 | - if (is_object($this->response)) |
|
| 367 | + if(is_object($this->response)) |
|
| 368 | 368 | $this->response->setStatus($status); |
| 369 | 369 | } |
| 370 | 370 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | public function setCode($code) |
| 377 | 377 | { |
| 378 | - if (is_object($this->response)) |
|
| 378 | + if(is_object($this->response)) |
|
| 379 | 379 | $this->response->setCode($code); |
| 380 | 380 | } |
| 381 | 381 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | public function emergency($code = 1, $append_msg = false, $context = false) |
| 390 | 390 | { |
| 391 | 391 | $to_file = true; |
| 392 | - if ($this->getLogLevel() < 1) |
|
| 392 | + if($this->getLogLevel() < 1) |
|
| 393 | 393 | $to_file = false; |
| 394 | 394 | |
| 395 | 395 | $this->addTrace('EMERGENCY', $code, $context, $append_msg, $to_file); |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | public function alert($code = 2, $append_msg = false, $context = false) |
| 410 | 410 | { |
| 411 | 411 | $to_file = true; |
| 412 | - if ($this->getLogLevel() < 2) |
|
| 412 | + if($this->getLogLevel() < 2) |
|
| 413 | 413 | $to_file = false; |
| 414 | 414 | $this->addTrace('ALERT', $code, $context, $append_msg, $to_file); |
| 415 | 415 | } |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | public function critical($code = 3, $append_msg = false, $context = false) |
| 428 | 428 | { |
| 429 | 429 | $to_file = true; |
| 430 | - if ($this->getLogLevel() < 3) |
|
| 430 | + if($this->getLogLevel() < 3) |
|
| 431 | 431 | $to_file = false; |
| 432 | 432 | $this->addTrace('CRITICAL', $code, $context, $append_msg, $to_file); |
| 433 | 433 | } |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | public function error($code = 4, $append_msg = false, $context = false) |
| 446 | 446 | { |
| 447 | 447 | $to_file = true; |
| 448 | - if ($this->getLogLevel() < 4) |
|
| 448 | + if($this->getLogLevel() < 4) |
|
| 449 | 449 | $to_file = false; |
| 450 | 450 | $this->addTrace('ERROR', $code, $context, $append_msg, $to_file); |
| 451 | 451 | } |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | public function warning($code = 5, $append_msg = false, $context = false) |
| 465 | 465 | { |
| 466 | 466 | $to_file = true; |
| 467 | - if ($this->getLogLevel() < 5) |
|
| 467 | + if($this->getLogLevel() < 5) |
|
| 468 | 468 | $to_file = false; |
| 469 | 469 | $this->addTrace('WARNING', $code, $context, $append_msg, $to_file); |
| 470 | 470 | } |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | public function notice($code = 6, $append_msg = false, $context = false) |
| 482 | 482 | { |
| 483 | 483 | $to_file = true; |
| 484 | - if ($this->getLogLevel() < 6) |
|
| 484 | + if($this->getLogLevel() < 6) |
|
| 485 | 485 | $to_file = false; |
| 486 | 486 | $this->addTrace('NOTICE', $code, $context, $append_msg, $to_file); |
| 487 | 487 | } |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | public function info($code = 7, $append_msg = false, $context = false) |
| 501 | 501 | { |
| 502 | 502 | $to_file = true; |
| 503 | - if ($this->getLogLevel() < 7) |
|
| 503 | + if($this->getLogLevel() < 7) |
|
| 504 | 504 | $to_file = false; |
| 505 | 505 | $this->addTrace('INFO', $code, $context, $append_msg, $to_file); |
| 506 | 506 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | public function debug($code = 8, $append_msg = false, $context = false) |
| 518 | 518 | { |
| 519 | 519 | $to_file = true; |
| 520 | - if ($this->getLogLevel() < 8) |
|
| 520 | + if($this->getLogLevel() < 8) |
|
| 521 | 521 | $to_file = false; |
| 522 | 522 | $this->addTrace('DEBUG', $code, $context, $append_msg, $to_file); |
| 523 | 523 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public static function load($ser_cwd_by_caller = false, $PHP_VERSION_ID = PHP_VERSION_ID) |
| 43 | 43 | { |
| 44 | - if (! empty($ser_cwd_by_caller) && is_bool($ser_cwd_by_caller)) { |
|
| 44 | + if(!empty($ser_cwd_by_caller) && is_bool($ser_cwd_by_caller)) { |
|
| 45 | 45 | $backtrace = debug_backtrace( |
| 46 | 46 | defined("DEBUG_BACKTRACE_IGNORE_ARGS") ? DEBUG_BACKTRACE_IGNORE_ARGS : FALSE); |
| 47 | 47 | $cwd_caller = array_pop($backtrace); |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Minimum version of PHP must be atleast 5.5.11 |
| 52 | 52 | */ |
| 53 | - if ($PHP_VERSION_ID <= 50511) |
|
| 53 | + if($PHP_VERSION_ID <= 50511) |
|
| 54 | 54 | return call_user_func( |
| 55 | - function () { |
|
| 55 | + function() { |
|
| 56 | 56 | $self = new self(); |
| 57 | 57 | $self->emergency(100); |
| 58 | 58 | return $self; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | ), $class); |
| 36 | 36 | |
| 37 | 37 | $class_file = LIBHOWI_ROOT . $library . '.inc'; |
| 38 | - if (file_exists($class_file)) |
|
| 38 | + if(file_exists($class_file)) |
|
| 39 | 39 | require_once ($class_file); |
| 40 | 40 | } |
| 41 | 41 | spl_autoload_register('libhowi_autoloder'); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function flock($operation, &$wouldblock = NULL) |
| 50 | 50 | { |
| 51 | - return ! $wouldblock ? parent::flock($operation) : parent::flock($operation, $wouldblock); |
|
| 51 | + return !$wouldblock ? parent::flock($operation) : parent::flock($operation, $wouldblock); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if(!is_int($size) || $this->getSize() > $size) return false; |
| 91 | 91 | |
| 92 | - $this->fseek($size ,SEEK_SET); |
|
| 92 | + $this->fseek($size, SEEK_SET); |
|
| 93 | 93 | $this->fwrite(' '); |
| 94 | 94 | return true; |
| 95 | 95 | } |
@@ -53,23 +53,23 @@ discard block |
||
| 53 | 53 | public function __construct($pathname = false, $recursive = true, $mode = false, $context = false, $logfile = false, |
| 54 | 54 | $loglevel = false, $UID = false, $username = false) |
| 55 | 55 | { |
| 56 | - if (! empty($logfile) && file_exists($logfile) && ! empty($loglevel)) { |
|
| 56 | + if(!empty($logfile) && file_exists($logfile) && !empty($loglevel)) { |
|
| 57 | 57 | $this->setLogfile($logfile); |
| 58 | 58 | $this->setLoglevel($loglevel); |
| 59 | 59 | $this->setUID($UID); |
| 60 | 60 | $this->setUsername($username); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $pathname = (! empty($pathname) ? $this->makeAbsolute($pathname) : $this->path); |
|
| 63 | + $pathname = (!empty($pathname) ? $this->makeAbsolute($pathname) : $this->path); |
|
| 64 | 64 | |
| 65 | 65 | $HID = md5($pathname); |
| 66 | 66 | |
| 67 | 67 | $this->dirsetPath($pathname, $HID); |
| 68 | - $this->dirsetMode(! empty($mode) ? $mode : $this->mode, $HID); |
|
| 68 | + $this->dirsetMode(!empty($mode) ? $mode : $this->mode, $HID); |
|
| 69 | 69 | |
| 70 | - $this->dirsetRecursive(! empty($recursive) ? true : false, $HID); |
|
| 70 | + $this->dirsetRecursive(!empty($recursive) ? true : false, $HID); |
|
| 71 | 71 | |
| 72 | - $context = ! empty($context) ? $this->dirsetContext($context, $HID) : false; |
|
| 72 | + $context = !empty($context) ? $this->dirsetContext($context, $HID) : false; |
|
| 73 | 73 | |
| 74 | 74 | $this->info(701, $pathname); |
| 75 | 75 | $this->response()->setStatus($this->dirCreate($HID)); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function dirsetPath($pathname = false, $HID = false) |
| 84 | 84 | { |
| 85 | - if (! empty($pathname) && is_string($pathname) && ! empty($HID)) { |
|
| 85 | + if(!empty($pathname) && is_string($pathname) && !empty($HID)) { |
|
| 86 | 86 | |
| 87 | 87 | $this->path = $this->makeAbsolute($pathname); |
| 88 | 88 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function dirsetMode($mode = false, $HID = false) |
| 102 | 102 | { |
| 103 | - if (! empty($HID) && ! empty($mode) && is_int($mode)) { |
|
| 103 | + if(!empty($HID) && !empty($mode) && is_int($mode)) { |
|
| 104 | 104 | $this->mode = $mode; |
| 105 | 105 | return true; |
| 106 | 106 | } else { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function dirsetRecursive($recursive = false, $HID = false) |
| 119 | 119 | { |
| 120 | - if (! empty($HID) && is_bool($recursive)) { |
|
| 120 | + if(!empty($HID) && is_bool($recursive)) { |
|
| 121 | 121 | $this->recursive = $recursive; |
| 122 | 122 | return true; |
| 123 | 123 | } else { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function dirsetContext($context = false, $HID = false) |
| 136 | 136 | { |
| 137 | - if (! empty($HID) && is_resource($context)) { |
|
| 137 | + if(!empty($HID) && is_resource($context)) { |
|
| 138 | 138 | $this->context = $context; |
| 139 | 139 | return true; |
| 140 | 140 | } |
@@ -152,16 +152,16 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function dirCreate($HID = false) |
| 154 | 154 | { |
| 155 | - if ((! is_dir(dirname($this->path)) && $this->recursive === false) || |
|
| 156 | - is_dir(dirname($this->path)) && ! $this->isWritable(dirname($this->path))) { |
|
| 155 | + if((!is_dir(dirname($this->path)) && $this->recursive === false) || |
|
| 156 | + is_dir(dirname($this->path)) && !$this->isWritable(dirname($this->path))) { |
|
| 157 | 157 | $this->warning(502, $this->path); |
| 158 | 158 | $result = false; |
| 159 | 159 | } else { |
| 160 | - if (! empty($HID) && ! $this->exists($this->path) && ! empty($this->context)) { |
|
| 160 | + if(!empty($HID) && !$this->exists($this->path) && !empty($this->context)) { |
|
| 161 | 161 | $result = mkdir($this->path, octdec(str_pad($this->mode, 4, 0, STR_PAD_LEFT)), |
| 162 | 162 | $this->recursive, $this->context); |
| 163 | 163 | } |
| 164 | - if (! empty($HID) && ! $this->exists($this->path) && empty($this->context)) { |
|
| 164 | + if(!empty($HID) && !$this->exists($this->path) && empty($this->context)) { |
|
| 165 | 165 | |
| 166 | 166 | $result = mkdir($this->path, octdec(str_pad($this->mode, 4, 0, STR_PAD_LEFT)), true); |
| 167 | 167 | } |
@@ -42,12 +42,12 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function setTmp($path = false) |
| 44 | 44 | { |
| 45 | - if (! empty($path)) { |
|
| 45 | + if(!empty($path)) { |
|
| 46 | 46 | $tmp = $this->makeAbsolute($path); |
| 47 | 47 | $isWritable = $this->isWritable($tmp); |
| 48 | 48 | $this->tmp_path = $isWritable ? $tmp : $this->tmp_path; |
| 49 | 49 | |
| 50 | - ! empty($isWritable) ? $this->debug(803) : $this->warning(501, $tmp); |
|
| 50 | + !empty($isWritable) ? $this->debug(803) : $this->warning(501, $tmp); |
|
| 51 | 51 | $this->response()->setStatus($isWritable); |
| 52 | 52 | } else { |
| 53 | 53 | $this->tmp_path = sys_get_temp_dir(); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function getTmp() |
| 68 | 68 | { |
| 69 | - if (empty($this->tmp_path)) |
|
| 69 | + if(empty($this->tmp_path)) |
|
| 70 | 70 | $this->tmp_path = $this->setTmp(); |
| 71 | 71 | |
| 72 | 72 | $this->debug(805, $this->tmp_path); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $this->debug(807); |
| 102 | 102 | $tmpfie = tmpfile(); |
| 103 | - $this->response()->setStatus(! empty($tmpfie) ? true : false); |
|
| 103 | + $this->response()->setStatus(!empty($tmpfie) ? true : false); |
|
| 104 | 104 | return $tmpfie; |
| 105 | 105 | } |
| 106 | 106 | } |