REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.72 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Migrator/Migration.php
Text
Base64
<?php declare(strict_types = 1); namespace MailPoet\Migrator; if (!defined('ABSPATH')) exit; use MailPoet\Config\Env; use MailPoet\DI\ContainerWrapper; use MailPoetVendor\Doctrine\DBAL\Connection; use MailPoetVendor\Doctrine\ORM\EntityManager; abstract class Migration { /** @var ContainerWrapper */ protected $container; /** @var Connection */ protected $connection; /** @var EntityManager */ protected $entityManager; public function __construct( ContainerWrapper $container ) { $this->container = $container; $this->connection = $container->get(Connection::class); $this->entityManager = $container->get(EntityManager::class); } abstract public function run(): void; protected function getTableName(string $entityClass): string { return $this->entityManager->getClassMetadata($entityClass)->getTableName(); } protected function createTable(string $tableName, array $attributes): void { $prefix = Env::$dbPrefix; $charsetCollate = Env::$dbCharsetCollate; $sql = implode(",\n", $attributes); $this->connection->executeStatement(" CREATE TABLE IF NOT EXISTS {$prefix}{$tableName} ( $sql ) {$charsetCollate}; "); } protected function columnExists(string $tableName, string $columnName): bool { // We had a problem with the dbName value in ENV for some customers, because it doesn't match DB name in information schema. // So we decided to use the DATABASE() value instead. return $this->connection->executeQuery(" SELECT 1 FROM information_schema.columns WHERE table_schema = COALESCE(DATABASE(), ?) AND table_name = ? AND column_name = ? ", [Env::$dbName, $tableName, $columnName])->fetchOne() !== false; } }
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).