docs: file_exists to is_file

This commit is contained in:
ytetsuro 2018-11-28 01:48:41 +09:00
parent 2b0af13348
commit 93a1c4dfeb
No known key found for this signature in database
GPG Key ID: 626F2181557E58A9
2 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ Classmap
========
The classmap is used extensively by CodeIgniter to eke the last ounces of performance out of the system
by not hitting the file-system with extra ``file_exists()`` calls. You can use the classmap to link to
by not hitting the file-system with extra ``is_file()`` calls. You can use the classmap to link to
third-party libraries that are not namespaced::
$classmap = [

View File

@ -98,7 +98,7 @@ page actually exists:
public function view($page = 'home')
{
if ( ! file_exists(APPPATH.'/Views/pages/'.$page.'.php'))
if ( ! is_file(APPPATH.'/Views/pages/'.$page.'.php'))
{
// Whoops, we don't have a page for that!
throw new \CodeIgniter\Exceptions\PageNotFoundException($page);
@ -116,7 +116,7 @@ footer, and displayed to the user. If the page doesn't exist, a "404
Page not found" error is shown.
The first line in this method checks whether the page actually exists.
PHP's native ``file_exists()`` function is used to check whether the file
PHP's native ``is_file()`` function is used to check whether the file
is where it's expected to be. The ``PageNotFoundException`` is a CodeIgniter
exception that causes the default error page to show.