PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Services / StorageService.php

StorageService.php in Depicter — Popup & Slider Builder 1.9.2, at app/src/Services/StorageService.php

74 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Services;
3
4
5 use Averta\WordPress\File\FileSystem;
6 use Averta\WordPress\File\UploadsDirectory;
7
8 class StorageService
9 {
10 const UPLOADS_FOLDER_NAME = 'depicter';
11
12 /**
13 * @var FileSystem
14 */
15 private $filesystem;
16
17 /**
18 * @var UploadsDirectory
19 */
20 private $uploads;
21
22
23 public function __construct(){
24 $this->filesystem = new FileSystem();
25 $this->uploads = new UploadsDirectory();
26 }
27
28 /**
29 * Access to filesystem module
30 *
31 * @return FileSystem
32 */
33 public function filesystem(){
34 return $this->filesystem;
35 }
36
37 /**
38 * Access to uploads directory info
39 *
40 * @return UploadsDirectory
41 */
42 public function uploads(){
43 return $this->uploads;
44 }
45
46 /**
47 * Retrieves the special plugin's folder in uploads directory
48 *
49 * @return string
50 */
51 public function getPluginUploadsDirectory(){
52 return $this->uploads()->getBaseDirectory() . '/'. self::UPLOADS_FOLDER_NAME;
53 }
54
55 /**
56 * Retrieves the special plugin's folder in uploads directory for CSS files
57 *
58 * @return string
59 */
60 public function getCssUploadsDirectory(){
61 return $this->uploads()->getBaseDirectory() . '/'. self::UPLOADS_FOLDER_NAME . '/css';
62 }
63
64 /**
65 * Retrieves the url of special plugin's folder in uploads directory for CSS files
66 *
67 * @return string
68 */
69 public function getCssUploadsUrl(){
70 return $this->uploads()->getBaseUrl() . '/'. self::UPLOADS_FOLDER_NAME . '/css';
71 }
72
73 }
74