Network.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Plugin\Setup; |
| 6 | |
| 7 | use AC\Plugin\InstallCollection; |
| 8 | use AC\Plugin\Setup; |
| 9 | use AC\Plugin\UpdateCollection; |
| 10 | use AC\Plugin\Version; |
| 11 | use AC\Storage\SiteOption; |
| 12 | |
| 13 | final class Network extends Setup |
| 14 | { |
| 15 | public function __construct( |
| 16 | SiteOption $storage, |
| 17 | Version $version, |
| 18 | ?InstallCollection $installers = null, |
| 19 | ?UpdateCollection $updates = null |
| 20 | ) { |
| 21 | parent::__construct($storage, $version, $installers, $updates); |
| 22 | } |
| 23 | |
| 24 | protected function is_new_install(): bool |
| 25 | { |
| 26 | $result = get_site_option('cpupdate_cac-pro'); |
| 27 | |
| 28 | if ($result) { |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | return ! $this->get_stored_version()->is_valid(); |
| 33 | } |
| 34 | |
| 35 | } |
| 36 |