From 89338828264a6b50e0eb63c449a96f14f0f84076 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:03:37 +0700 Subject: Path helper improvement --- user_guide_src/source/helpers/path_helper.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'user_guide_src/source/helpers/path_helper.rst') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 1a70af458..6efd93cc1 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -28,10 +28,13 @@ cannot be resolved. :: + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved + echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd" + echo set_realpath($directory); // returns "/etc/passwd/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" - - + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 311b230cf32dda94102866e56e8dd1ef81b5685b Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:49:55 +0700 Subject: Doc --- user_guide_src/source/helpers/path_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src/source/helpers/path_helper.rst') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 6efd93cc1..4a2252834 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -33,8 +33,8 @@ cannot be resolved. $non_existent_file = '/path/to/non-exist-file.txt'; echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" - $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd/" + $directory = '/etc/php5'; + echo set_realpath($directory); // returns "/etc/php5/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From f2915f2787170d681a50db39a6650f48eefc8d7b Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Wed, 14 Mar 2012 00:02:39 +0700 Subject: New line and changelog correction --- user_guide_src/source/helpers/path_helper.rst | 3 +++ 1 file changed, 3 insertions(+) (limited to 'user_guide_src/source/helpers/path_helper.rst') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 4a2252834..43caffec2 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -30,11 +30,14 @@ cannot be resolved. $file = '/etc/php5/apache2/php.ini'; echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $non_existent_file = '/path/to/non-exist-file.txt'; echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" + $directory = '/etc/php5'; echo set_realpath($directory); // returns "/etc/php5/" + $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ce707b4cafd64b95031690cf927584b1d60c7ad7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 14 Mar 2012 10:26:08 +0200 Subject: Further improve the path helper --- user_guide_src/source/helpers/path_helper.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'user_guide_src/source/helpers/path_helper.rst') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 43caffec2..847f5a08b 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -28,16 +28,16 @@ cannot be resolved. :: - $file = '/etc/php5/apache2/php.ini'; - echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" - $non_existent_file = '/path/to/non-exist-file.txt'; - echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // shows an error, as the path cannot be resolved + echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" - $directory = '/etc/php5'; - echo set_realpath($directory); // returns "/etc/php5/" + $directory = '/etc/php5'; + echo set_realpath($directory); // returns "/etc/php5/" - $non_existent_directory = '/path/to/nowhere'; - echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file + $non_existent_directory = '/path/to/nowhere'; + echo set_realpath($non_existent_directory, TRUE); // shows an error, as the path cannot be resolved + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" -- cgit v1.2.3-24-g4f1b