REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.53 KB
Close
/home/nshryvcy/himaltourism.com/wp-content/plugins/mailpoet/lib/Settings/SettingsRepository.php
Text
Base64
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Settings; if (!defined('ABSPATH')) exit; use MailPoet\Doctrine\Repository; use MailPoet\Entities\SettingEntity; use MailPoet\WP\Functions as WPFunctions; use MailPoetVendor\Carbon\Carbon; /** * @extends Repository<SettingEntity> */ class SettingsRepository extends Repository { public function findOneByName($name) { return $this->doctrineRepository->findOneBy(['name' => $name]); } public function createOrUpdateByName($name, $value) { // Temporarily use low-level INSERT ... ON DUPLICATE KEY UPDATE query to avoid race conditions // between entity fetch and creation with multiple concurrent requests. This will be replaced // by a code solving atomicity of create-or-update on entity (ORM) level in a follow-up ticket. $now = Carbon::createFromTimestamp(WPFunctions::get()->currentTime('timestamp')); $tableName = $this->entityManager->getClassMetadata(SettingEntity::class)->getTableName(); $this->entityManager->getConnection()->executeStatement(" INSERT INTO $tableName (name, value, created_at, updated_at) VALUES (:name, :value, :now, :now) ON DUPLICATE KEY UPDATE value = :value, updated_at = :now ", [ 'name' => $name, 'value' => is_array($value) ? serialize($value) : $value, 'now' => $now, ]); $this->entityManager->getUnitOfWork()->clear(SettingEntity::class); } protected function getEntityClassName() { return SettingEntity::class; } }
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
Charsets.php
538 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
Hosts.php
5.67 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
Pages.php
3.30 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
SettingsChangeHandler.php
2.99 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
SettingsController.php
5.21 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
SettingsRepository.php
1.53 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
TrackingConfig.php
1.06 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
UserFlagsController.php
2.56 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
UserFlagsRepository.php
415 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).