REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.25 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Migrator/Store.php
Text
Base64
<?php declare(strict_types = 1); namespace MailPoet\Migrator; if (!defined('ABSPATH')) exit; use MailPoet\Config\Env; use MailPoetVendor\Doctrine\DBAL\Connection; class Store { /** @var Connection */ private $connection; /** @var string */ private $table; public function __construct( Connection $connection ) { $this->connection = $connection; $this->table = Env::$dbPrefix . 'migrations'; } public function getMigrationsTable(): string { return $this->table; } public function startMigration(string $name): void { $this->connection->executeStatement(" INSERT INTO {$this->table} (name, started_at) VALUES (?, current_timestamp()) ON DUPLICATE KEY UPDATE started_at = current_timestamp(), completed_at = NULL, retries = retries + 1, error = NULL ", [$name]); } public function completeMigration(string $name): void { $this->connection->executeStatement(" UPDATE {$this->table} SET completed_at = current_timestamp() WHERE name = ? ", [$name]); } public function failMigration(string $name, string $error): void { $this->connection->executeStatement(" UPDATE {$this->table} SET completed_at = current_timestamp(), error = ? WHERE name = ? ", [$error ?: 'Unknown error', $name]); } public function getAll(): array { // Some backup plugins may convert NULL values to empty strings, // in which case we need to cast the error column value to NULL. return $this->connection->fetchAllAssociative(" SELECT id, name, started_at, completed_at, retries, IF(error = '', NULL, error) AS error FROM {$this->table} ORDER BY id ASC "); } public function ensureMigrationsTable(): void { $collate = Env::$dbCharsetCollate; $this->connection->executeStatement(" CREATE TABLE IF NOT EXISTS {$this->table} ( id int(11) unsigned NOT NULL AUTO_INCREMENT, name varchar(191) NOT NULL, started_at timestamp NOT NULL, completed_at timestamp NULL, retries int(11) unsigned NOT NULL DEFAULT 0, error text NULL, PRIMARY KEY (id), UNIQUE KEY (name) ) {$collate}; "); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 10
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Cli.php
4.47 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.php
0 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Logger.php
796 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Migration.php
1.72 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MigrationTemplate.php
543 B
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Migrator.php
2.54 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MigratorException.php
1.24 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Repository.php
1.83 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Runner.php
1.39 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Store.php
2.25 KB
lrw-r--r--
2023-04-04 05:35:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).