3rdparty
1 year ago
Ajax
1 year ago
Alert
1 year ago
Archive
1 year ago
Backup
1 year ago
BackupJob
1 year ago
CLI
1 year ago
Cache
1 year ago
Config
1 year ago
Cron
1 year ago
Crontab
1 year ago
Data
1 year ago
Destination
1 year ago
DirIterator
1 year ago
Download
1 year ago
Downloader
1 year ago
Encryption
1 year ago
Entities
1 year ago
Exception
1 year ago
Export
1 year ago
Filesystem
1 year ago
IO
1 year ago
Integrations
1 year ago
JetBackupLinux
1 year ago
License
1 year ago
Log
1 year ago
MFA
1 year ago
Notification
1 year ago
Queue
1 year ago
Restore
1 year ago
ResumableTask
1 year ago
SGB
1 year ago
Schedule
1 year ago
Settings
1 year ago
Showcase
1 year ago
Snapshot
1 year ago
Upload
1 year ago
UserInput
1 year ago
Web
1 year ago
Wordpress
1 year ago
.htaccess
1 year ago
Factory.php
1 year ago
JetBackup.php
1 year ago
autoload.php
1 year ago
functions.php
1 year ago
index.html
1 year ago
web.config
1 year ago
Factory.php
112 lines
| 1 | <?php |
| 2 | |
| 3 | namespace JetBackup; |
| 4 | |
| 5 | use JetBackup\Config\Config; |
| 6 | use JetBackup\Config\Locations; |
| 7 | use JetBackup\Settings\Automation; |
| 8 | use JetBackup\Settings\General; |
| 9 | use JetBackup\Settings\Integrations; |
| 10 | use JetBackup\Settings\Logging; |
| 11 | use JetBackup\Settings\Maintenance; |
| 12 | use JetBackup\Settings\Notifications; |
| 13 | use JetBackup\Settings\Performance; |
| 14 | use JetBackup\Settings\Restore; |
| 15 | use JetBackup\Settings\Security; |
| 16 | use JetBackup\Settings\Updates; |
| 17 | use JetBackup\Wordpress\Helper; |
| 18 | |
| 19 | if (!defined( '__JETBACKUP__')) die('Direct access is not allowed'); |
| 20 | |
| 21 | class Factory { |
| 22 | |
| 23 | private function __construct() {} |
| 24 | |
| 25 | /** |
| 26 | * @return Config |
| 27 | */ |
| 28 | public static function getConfig():Config { |
| 29 | static $i; |
| 30 | if(!$i) $i = new Config(); |
| 31 | return $i; |
| 32 | } |
| 33 | |
| 34 | public static function getSettingsAutomation():Automation { |
| 35 | static $i; |
| 36 | if(!$i) $i = new Automation(); |
| 37 | return $i; |
| 38 | } |
| 39 | |
| 40 | public static function getSettingsGeneral($reload=false):General { |
| 41 | static $i; |
| 42 | if(!$i || $reload) $i = new General(); |
| 43 | return $i; |
| 44 | } |
| 45 | |
| 46 | public static function getSettingsSecurity():Security { |
| 47 | static $i; |
| 48 | if(!$i) $i = new Security(); |
| 49 | return $i; |
| 50 | } |
| 51 | |
| 52 | public static function getSettingsPerformance():Performance { |
| 53 | static $i; |
| 54 | if(!$i) $i = new Performance(); |
| 55 | return $i; |
| 56 | } |
| 57 | |
| 58 | public static function getSettingsLogging():Logging { |
| 59 | static $i; |
| 60 | if(!$i) $i = new Logging(); |
| 61 | return $i; |
| 62 | } |
| 63 | |
| 64 | public static function getSettingsNotifications():Notifications { |
| 65 | static $i; |
| 66 | if(!$i) $i = new Notifications(); |
| 67 | return $i; |
| 68 | } |
| 69 | |
| 70 | public static function getSettingsMaintenance():Maintenance { |
| 71 | static $i; |
| 72 | if(!$i) $i = new Maintenance(); |
| 73 | return $i; |
| 74 | } |
| 75 | |
| 76 | public static function getSettingsUpdates():Updates { |
| 77 | static $i; |
| 78 | if(!$i) $i = new Updates(); |
| 79 | return $i; |
| 80 | } |
| 81 | |
| 82 | public static function getSettingsRestore():Restore { |
| 83 | static $i; |
| 84 | if(!$i) $i = new Restore(); |
| 85 | return $i; |
| 86 | } |
| 87 | |
| 88 | public static function getSettingsIntegrations():Integrations { |
| 89 | static $i; |
| 90 | if(!$i) $i = new Integrations(); |
| 91 | return $i; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @return Locations |
| 96 | */ |
| 97 | public static function getLocations():Locations { |
| 98 | static $i; |
| 99 | if(!$i) $i = new Locations(); |
| 100 | return $i; |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * @return Helper |
| 105 | */ |
| 106 | public static function getWPHelper():Helper { |
| 107 | static $i; |
| 108 | if(!$i) $i = new Helper(); |
| 109 | return $i; |
| 110 | } |
| 111 | } |
| 112 |