| 1 |
<?php |
| 2 |
if (PHP_SAPI !== 'cli' || !getenv('MATRIX_TOKEN')) throw new RuntimeException('Disposable matrix CLI only.'); |
| 3 |
define('WP_INSTALLING', true); |
| 4 |
require '/var/www/html/wp-load.php'; |
| 5 |
if (wp_get_environment_type() !== 'local') throw new RuntimeException('Local matrix only.'); |
| 6 |
require_once ABSPATH . 'wp-admin/includes/upgrade.php'; |
| 7 |
if (!is_blog_installed()) { |
| 8 |
wp_install('Async worker matrix', 'matrix-admin', '[email protected]', true, '', 'disposable-local-only'); |
| 9 |
} |
| 10 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 11 |
foreach (['woocommerce/woocommerce.php', 'sync-basalam/sync-basalam.php'] as $plugin) { |
| 12 |
$result = activate_plugin($plugin); |
| 13 |
if (is_wp_error($result)) throw new RuntimeException($result->get_error_message()); |
| 14 |
} |
| 15 |
update_option('sync_basalam_settings', ['tasks_per_minute' => 600, 'tasks_per_minute_auto' => false]); |
| 16 |
update_option('sync_basalam_version', '1.10.29'); |
| 17 |
echo "Disposable WordPress installed.\n"; |
| 18 |
|