REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.83 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Migrator/Repository.php
Text
Base64
<?php declare(strict_types = 1); namespace MailPoet\Migrator; if (!defined('ABSPATH')) exit; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use SplFileInfo; class Repository { /** @var string */ private $migrationsDir; /** @var string */ private $templateFile; public function __construct() { $this->migrationsDir = __DIR__ . '/../Migrations'; $this->templateFile = __DIR__ . '/MigrationTemplate.php'; } public function getMigrationsDir(): string { return $this->migrationsDir; } /** @return array{name: string, path: string} */ public function create(): array { $template = @file_get_contents($this->templateFile); if (!$template) { throw MigratorException::templateFileReadFailed($this->templateFile); } $name = $this->generateName(); $migration = str_replace('class MigrationTemplate ', "class $name ", $template); $path = $this->migrationsDir . "/$name.php"; $result = @file_put_contents($path, $migration); if (!$result) { throw MigratorException::migrationFileWriteFailed($path); } return [ 'name' => $name, 'path' => $path, ]; } public function loadAll(): array { $files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($this->migrationsDir, RecursiveDirectoryIterator::SKIP_DOTS) ); $migrations = []; foreach ($files as $file) { if (!$file instanceof SplFileInfo || !$file->isFile()) { continue; } if (strtolower($file->getFilename()) === 'index.php') { continue; } if (strtolower($file->getExtension()) === 'php') { $migrations[] = $file->getBasename('.' . $file->getExtension()); } } sort($migrations); return $migrations; } private function generateName(): string { return 'Migration_' . gmdate('Ymd_His'); } }
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).