1 | <?php |
||
14 | class upload |
||
15 | { |
||
16 | /** @var \phpbb\auth\auth */ |
||
17 | protected $auth; |
||
18 | |||
19 | /** @var \phpbb\files\factory */ |
||
20 | protected $files_factory; |
||
21 | |||
22 | /** @var \phpbb\filesystem\filesystem */ |
||
23 | protected $filesystem; |
||
24 | |||
25 | /** @var \phpbb\language\language */ |
||
26 | protected $language; |
||
27 | |||
28 | /** @var \phpbb\user */ |
||
29 | protected $user; |
||
30 | |||
31 | /** @var string */ |
||
32 | protected $phpbb_root_path; |
||
33 | |||
34 | /** @var string */ |
||
35 | protected $upload_dir = 'images/sitemaker_uploads/source/'; |
||
36 | |||
37 | /** @var array */ |
||
38 | protected $allowed_extensions = array('jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'svg'); |
||
39 | 5 | ||
40 | /** |
||
41 | 5 | * Constructor |
|
42 | 5 | * |
|
43 | 5 | * @param \phpbb\auth\auth $auth Auth object |
|
44 | 5 | * @param \phpbb\files\factory $files_factory Files factory object |
|
45 | 5 | * @param \phpbb\filesystem\filesystem $filesystem File system |
|
46 | * @param \phpbb\language\language $language Language object |
||
47 | * @param \phpbb\user $user User object |
||
48 | * @param string $phpbb_root_path phpBB root path |
||
49 | */ |
||
50 | 5 | public function __construct(\phpbb\auth\auth $auth, \phpbb\files\factory $files_factory, \phpbb\filesystem\filesystem $filesystem, \phpbb\language\language $language, \phpbb\user $user, $phpbb_root_path) |
|
59 | 1 | ||
60 | 1 | /** |
|
61 | * @return \Symfony\Component\HttpFoundation\Response |
||
62 | */ |
||
63 | 4 | public function handle() |
|
80 | |||
81 | /** |
||
82 | 5 | * @param array $json_data |
|
83 | * @return void |
||
84 | 5 | */ |
|
85 | 5 | protected function handle_upload(array &$json_data) |
|
108 | 4 | ||
109 | /** |
||
110 | 4 | * @return string |
|
111 | */ |
||
112 | 4 | protected function get_user_dir() |
|
131 | |||
132 | /** |
||
133 | * @param \phpbb\files\filespec $file |
||
134 | * @return void |
||
135 | */ |
||
136 | protected function set_filename(\phpbb\files\filespec &$file) |
||
149 | |||
150 | /** |
||
151 | * @param array $allowed_extensions |
||
152 | * @return void |
||
153 | */ |
||
154 | public function set_allowed_extensions(array $allowed_extensions) |
||
158 | } |
||
159 |