1 | <?php |
||
18 | class BigFileTools { |
||
19 | |||
20 | /** |
||
21 | * Create BigFileTools from $path |
||
22 | * @param string $path |
||
23 | * @return File |
||
24 | * @deprecated |
||
25 | */ |
||
26 | static function fromPath($path) { |
||
29 | |||
30 | /** |
||
31 | * @var SizeDriverAggregator |
||
32 | */ |
||
33 | private $sizeDriver; |
||
34 | |||
35 | /** |
||
36 | * Create new instance of BigFileTools by providing list of drivers. |
||
37 | * Those that cannot be initialized on given platform will be skipped. |
||
38 | * @param string[] $drivers |
||
39 | * @return static |
||
40 | */ |
||
41 | public static function createFrom(array $drivers) { |
||
48 | |||
49 | /** |
||
50 | * Create new instance of BigFileTools using default configuration. |
||
51 | * This uses default drivers ordered by speed. |
||
52 | * @return static |
||
53 | */ |
||
54 | public static function createDefault() { |
||
63 | |||
64 | /** |
||
65 | * Constructor - do not call directly |
||
66 | * @param ISizeDriver $sizeDriver |
||
67 | */ |
||
68 | function __construct(ISizeDriver $sizeDriver) |
||
72 | |||
73 | /** |
||
74 | * Get file resource for further manipulation |
||
75 | * @param string $path **full** path to file |
||
76 | * @return File |
||
77 | */ |
||
78 | public function getFile($path) |
||
82 | } |
||
83 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.