1 | <?php |
||
10 | trait FileTrait |
||
11 | { |
||
12 | use BasePathTrait; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $directory; |
||
18 | |||
19 | /** |
||
20 | * @var bool |
||
21 | */ |
||
22 | private $appendQuery; |
||
23 | |||
24 | /** |
||
25 | * Set the storage directory of the file. |
||
26 | * |
||
27 | * @param string $directory |
||
28 | */ |
||
29 | public function __construct($directory) |
||
33 | |||
34 | /** |
||
35 | * Set whether use or not the uri query to generate the filenames. |
||
36 | * |
||
37 | * @param bool $appendQuery |
||
38 | * |
||
39 | * @return self |
||
40 | */ |
||
41 | public function appendQuery($appendQuery = true) |
||
47 | |||
48 | /** |
||
49 | * Returns the filename of the response file. |
||
50 | * |
||
51 | * @param RequestInterface $request |
||
52 | * @param string $indexExt |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | private function getFilename(RequestInterface $request, $indexExt = 'html') |
||
75 | } |
||
76 |