-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Labels
Description
As title, please look at following code about getFileContent
method implementation approach:
.......
if (function_exists('file_get_contents')) {
return file_get_contents($filename);
} elseif (function_exists('file')) {
$ini = file($filename);
if ($ini !== false) {
return implode("\n", $ini);
}
} elseif (function_exists('fopen') && function_exists('fread')) {
$handle = fopen($filename, 'r');
if (!$handle) {
return false;
}
$ini = fread($handle, filesize($filename));
fclose($handle);
return $ini;
}
return false;
......
It looks like the file_get_contents
will be included on PHP version and it seems that using the function_exists
is unnecessary.
To improve this approach, please consider following code:
......
return file_get_contents($filename);
.......