| Server IP : 47.82.179.145 / Your IP : 216.73.216.89 Web Server : nginx/1.26.3 System : Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64 User : www ( 1001) PHP Version : 8.3.30 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/easy-digital-downloads/src/ |
Upload File : |
<?php
/**
* Component Class.
*
* @package EDD
* @copyright Copyright (c) 2018, Sandhills Development, LLC
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
namespace EDD;
use EDD\Database;
/**
* Component Class.
*
* @since 3.0
*/
class Component extends Base_Object {
/**
* Name of this component
*
* @since 3.0
*
* @var string
*/
public $name = '';
/**
* Database schema definition
*
* @since 3.0
*
* @var Database\Schema
*/
public $schema = false;
/**
* Database table interface
*
* @since 3.0
*
* @var Database\Table
*/
public $table = false;
/**
* Database single object interface
*
* @since 3.0
*
* @var Database\Table
*/
public $meta = false;
/**
* Database query interface
*
* @since 3.0
*
* @var Database\Query
*/
public $query = false;
/**
* Database single object interface
*
* @since 3.0
*
* @var Database\Row|object
*/
public $object = false;
/**
* Array of interface objects instantiated during init
*
* @since 3.0
*
* @var array
*/
private $interfaces = array();
/**
* Array of interface keys
*
* @since 3.0
*
* @var array
*/
private $interface_keys = array(
'schema' => false,
'table' => false,
'query' => false,
'object' => false,
'meta' => false,
);
/**
* Construct an EDD component
*
* @since 3.0
*
* @param array $args The arguments to set.
*/
public function __construct( $args = array() ) {
parent::__construct( $args );
}
/**
* Return an interface object
*
* @since 3.0
*
* @param string $name The name of the interface to return.
*
* @return object
*/
public function get_interface( $name = '' ) {
return isset( $this->interfaces[ $name ] )
? $this->interfaces[ $name ]
: false;
}
/**
* Setup an EDD component based on parsing in constructor
*
* @since 3.0
*
* @param array $args The arguments to set.
*/
protected function set_vars( $args = array() ) {
// Get the interface keys.
$keys = array_keys( $this->interface_keys );
// Loop through args...
foreach ( $args as $key => $value ) {
// Set arg as a Component Interface.
if ( in_array( $key, $keys, true ) && class_exists( $value ) ) {
$this->interfaces[ $key ] = new $value;
// Set arg as a Component property.
} else {
$this->{$key} = $value;
}
}
}
}