REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.43 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Features/FeatureFlagsController.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Features; if (!defined('ABSPATH')) exit; use MailPoet\Entities\FeatureFlagEntity; class FeatureFlagsController { /** @var FeaturesController */ private $featuresController; /** @var FeatureFlagsRepository */ private $featureFlagsRepository; public function __construct( FeaturesController $featuresController, FeatureFlagsRepository $featureFlagsRepository ) { $this->featuresController = $featuresController; $this->featureFlagsRepository = $featureFlagsRepository; } public function set($name, $value) { if (!$this->featuresController->exists($name)) { throw new \RuntimeException("Feature '$name' does not exist'"); } $this->featureFlagsRepository->createOrUpdate(['name' => $name, 'value' => $value]); } public function getAll() { $flags = $this->featureFlagsRepository->findAll(); $flagsMap = array_combine( array_map( function (FeatureFlagEntity $flag) { return $flag->getName(); }, $flags ), $flags ); $output = []; foreach ($this->featuresController->getDefaults() as $name => $default) { $output[] = [ 'name' => $name, 'value' => isset($flagsMap[$name]) ? (bool)$flagsMap[$name]->getValue() : $default, 'default' => $default, ]; } return $output; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
FeatureFlagsController.php
1.43 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
FeatureFlagsRepository.php
1.16 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
FeaturesController.php
2.16 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
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).