File Editor
Directories:
.. (Back)
Admin
Aggregator
Ajax
Collections
Customizer
Dates
Editor
Event_Status
Event_Tickets
Featured_Events
Google
Importer
Integrations
JSON_LD
Linked_Posts
Meta
Models
REST
Repositories
Revisions
Service_Providers
Shortcode
Taxonomy
Template
Utils
Validator
Views
Files:
API.php
Adjacent_Events.php
Admin_List.php
Aggregator.php
Amalgamator.php
Assets.php
Capabilities.php
Constants.php
Cost_Utils.php
Deactivation.php
Default_Values.php
Editor.php
Embedded_Maps.php
Event_Cleaner.php
Event_Cleaner_Scheduler.php
Featured_Events.php
Front_Page_View.php
Gutenberg.php
I18n.php
Ignored_Events.php
Linked_Posts.php
Main.php
Options_Exception.php
Organizer.php
Plugin_Register.php
Post_Exception.php
Privacy.php
Query.php
Rewrite.php
Template_Factory.php
Templates.php
Timezones.php
Updater.php
Venue.php
iCal.php
Create New File
Create
Edit File: Constants.php
<?php class Tribe__Events__Constants implements ArrayAccess { /** * @var bool Whether the class will define and read real constants or not. */ protected $volatile; /** * @var array An array that will store volatile values if the class is used in volatile mode. */ protected $volatile_values; /** * Tribe__Events__Constants constructor. * * @param bool $volatile If `true` the class will not define and read real constants. */ #[\ReturnTypeWillChange] public function __construct( $volatile = false ) { $this->volatile = $volatile; $this->volatile_values = []; } /** * Whether a constant is defined or not. * * @param string $offset * * @return bool */ #[\ReturnTypeWillChange] public function offsetExists( $offset ): bool { return $this->volatile ? isset( $this->volatile_values[ $offset ] ) : defined( $offset ); } /** * Gets a constant value. * * @param string $offset * * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet( $offset ) { return $this->volatile ? $this->volatile_values[ $offset ] : constant( $offset ); } /** * Sets the value of a constant if not already defined. * * @param string $offset * @param mixed $value */ #[\ReturnTypeWillChange] public function offsetSet( $offset, $value ): void { if ( $this->volatile && ! isset( $this->volatile_values[ $offset ] ) ) { $this->volatile_values[ $offset ] = $value; } else { if ( ! defined( $offset ) ) { define( $offset, $value ); } } } /** * Unsets a constant if in volatile mode. * * @param string $offset */ #[\ReturnTypeWillChange] public function offsetUnset( $offset ): void { if ( $this->volatile ) { $this->volatile_values = array_diff( $this->volatile_values, [ $offset ] ); } else { // no op } } }
Save Changes
Rename File
Rename