PluginProbe ʕ •ᴥ•ʔ
JetBackup – Backup, Restore & Migrate / 3.1.18.8
JetBackup – Backup, Restore & Migrate v3.1.18.8
3.1.22.3 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.8.1 1.4.9 1.5.0 1.5.1 1.5.1.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.10 1.6.11 1.6.12 1.6.13 1.6.15 1.6.5.1 1.6.8.8 1.6.9 1.6.9.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7.5 2.0.8.7 2.0.9.11 2.0.9.14 2.0.9.15 2.0.9.6 2.0.9.7 2.0.9.9 3.1.10.7 3.1.11.1 3.1.12.3 3.1.13.4 3.1.14.17 3.1.15.4 3.1.16.1 3.1.17.5 3.1.18.10 3.1.18.8 3.1.18.9 3.1.19.8 3.1.20.3 3.1.21.3 3.1.7.9 3.1.9.2 trunk 1.1.90 1.1.91 1.2.0 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2
backup / src / JetBackup / Wordpress / Blog.php
backup / src / JetBackup / Wordpress Last commit date
.htaccess 5 months ago Blog.php 5 months ago Helper.php 5 months ago Init.php 5 months ago Installer.php 5 months ago MySQL.php 5 months ago UI.php 5 months ago Update.php 5 months ago Wordpress.php 5 months ago index.html 5 months ago web.config 5 months ago
Blog.php
47 lines
1 <?php
2
3 namespace JetBackup\Wordpress;
4
5 use JetBackup\Data\ArrayData;
6
7 if (!defined( '__JETBACKUP__')) die('Direct access is not allowed');
8
9 class Blog extends ArrayData {
10
11 const ID = 'id';
12 const DOMAIN = 'domain';
13 const DATABASE_TABLES = 'database_tables';
14
15 const MAIN_BLOG_ID = 1;
16
17 public function __construct($data=[]) {
18 $this->setData($data);
19 }
20
21 public function setId(int $id):void { $this->set(self::ID, $id); }
22 public function getId():int { return $this->get(self::ID, 0); }
23
24 public function setDomain(string $domain):void { $this->set(self::DOMAIN, $domain); }
25 public function getDomain():string { return $this->get(self::DOMAIN); }
26
27 public function setDatabaseTables(array $tables):void { $this->set(self::DATABASE_TABLES, $tables); }
28 public function getDatabaseTables():array { return $this->get(self::DATABASE_TABLES, []); }
29 public function addDatabaseTable(string $table):void {
30 $tables = $this->getDatabaseTables();
31 $tables[] = $table;
32 $this->setDatabaseTables($tables);
33 }
34
35 public function getPaths():array {
36 if(!$this->isMain()) return [];
37 return [
38 "wp-content/blogs.dir/{$this->getId()}/files", // Legacy
39 "wp-content/uploads/sites/{$this->getId()}",
40 "wp-content/uploads/{$this->getId()}",
41 "wp-content/{$this->getId()}",
42 ];
43 }
44
45 public function isMain():bool { return $this->getId() == self::MAIN_BLOG_ID; }
46 }
47