global.php ➔ uploadFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
cc 1
eloc 3
c 3
b 1
f 1
nc 1
nop 3
dl 0
loc 8
rs 9.4285
1
<?php
2
/**
3
 * Created by Maxim Omelchenko <[email protected]>
4
 * on 11.11.2014 at 17:17
5
 */
6
7
use \samsonphp\upload\Upload;
8
9
/**
10
 * Perform file uploading.
11
 * This function is a shortcut that avoids new Upload() object creation.
12
 * @param Upload $upload Waiting for upload object to be returned
13
 * @param mixed $extensions Collection of supported extensions, one extension is also supported
14
 * @param mixed $relativePathParameters Collection of parameters to be passed to external rel. path builder
15
 * @return bool True if file was successfully uploaded
16
 */
17
function uploadFile(&$upload, $extensions = array(), $relativePathParameters = null)
18
{
19
    // Create new Upload object
20
    $upload = new Upload($extensions, $relativePathParameters);
21
22
    // Return upload result
23
    return $upload->upload();
24
}
25