Skip to content

Commit ac82913

Browse files
committed
docs: remove <?php in sample code
1 parent 1192b91 commit ac82913

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

user_guide_src/source/libraries/files.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ By default, the file does not need to exist. However, you can pass an additional
1818
to check that the file exists and throw ``FileNotFoundException()`` if it does not.
1919

2020
.. literalinclude:: files/001.php
21+
:lines: 2-
2122

2223
Taking Advantage of Spl
2324
***********************
2425

2526
Once you have an instance, you have the full power of the SplFileInfo class at the ready, including:
2627

2728
.. literalinclude:: files/002.php
29+
:lines: 2-
2830

2931
New Features
3032
************
@@ -38,13 +40,15 @@ You can generate a cryptographically secure random filename, with the current ti
3840
method. This is especially useful to rename files when moving it so that the filename is unguessable:
3941

4042
.. literalinclude:: files/003.php
43+
:lines: 2-
4144

4245
getSize()
4346
=========
4447

4548
Returns the size of the uploaded file in bytes:
4649

4750
.. literalinclude:: files/004.php
51+
:lines: 2-
4852

4953
getSizeByUnit()
5054
===============
@@ -53,6 +57,7 @@ Returns the size of the uploaded file default in bytes. You can pass in either '
5357
the results in kilobytes or megabytes, respectively:
5458

5559
.. literalinclude:: files/005.php
60+
:lines: 2-
5661

5762
getMimeType()
5863
=============
@@ -61,6 +66,7 @@ Retrieve the media type (mime type) of the file. Uses methods that are considere
6166
the type of file:
6267

6368
.. literalinclude:: files/006.php
69+
:lines: 2-
6470

6571
guessExtension()
6672
================
@@ -70,6 +76,7 @@ will return null. This is often a more trusted source than simply using the exte
7076
the values in **app/Config/Mimes.php** to determine extension:
7177

7278
.. literalinclude:: files/007.php
79+
:lines: 2-
7380

7481
Moving Files
7582
============
@@ -78,12 +85,15 @@ Each file can be moved to its new location with the aptly named ``move()`` metho
7885
the file to as the first parameter:
7986

8087
.. literalinclude:: files/008.php
88+
:lines: 2-
8189

8290
By default, the original filename was used. You can specify a new filename by passing it as the second parameter:
8391

8492
.. literalinclude:: files/009.php
93+
:lines: 2-
8594

8695
The move() method returns a new File instance that for the relocated file, so you must capture the result if the
8796
resulting location is needed:
8897

8998
.. literalinclude:: files/010.php
99+
:lines: 2-

0 commit comments

Comments
 (0)