Skip to content

Commit 93a1c4d

Browse files
committed
docs: file_exists to is_file
1 parent 2b0af13 commit 93a1c4d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

user_guide_src/source/concepts/autoloader.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Classmap
6767
========
6868

6969
The classmap is used extensively by CodeIgniter to eke the last ounces of performance out of the system
70-
by not hitting the file-system with extra ``file_exists()`` calls. You can use the classmap to link to
70+
by not hitting the file-system with extra ``is_file()`` calls. You can use the classmap to link to
7171
third-party libraries that are not namespaced::
7272

7373
$classmap = [

user_guide_src/source/tutorial/static_pages.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ page actually exists:
9898

9999
public function view($page = 'home')
100100
{
101-
if ( ! file_exists(APPPATH.'/Views/pages/'.$page.'.php'))
101+
if ( ! is_file(APPPATH.'/Views/pages/'.$page.'.php'))
102102
{
103103
// Whoops, we don't have a page for that!
104104
throw new \CodeIgniter\Exceptions\PageNotFoundException($page);
@@ -116,7 +116,7 @@ footer, and displayed to the user. If the page doesn't exist, a "404
116116
Page not found" error is shown.
117117

118118
The first line in this method checks whether the page actually exists.
119-
PHP's native ``file_exists()`` function is used to check whether the file
119+
PHP's native ``is_file()`` function is used to check whether the file
120120
is where it's expected to be. The ``PageNotFoundException`` is a CodeIgniter
121121
exception that causes the default error page to show.
122122

0 commit comments

Comments
 (0)