Initial commit

This commit is contained in:
Felix Förtsch
2020-10-20 14:39:50 +02:00
commit 648ded8896
1225 changed files with 216511 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
<?php
if ( ! function_exists( 'get_main_network_id' ) )
{
/**
* Get the main network ID.
*
* @since 4.3.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @return int The ID of the main network.
*/
function get_main_network_id() {
global $wpdb;
if ( ! is_multisite() ) {
return 1;
}
if ( defined( 'PRIMARY_NETWORK_ID' ) ) {
$main_network_id = PRIMARY_NETWORK_ID;
} elseif ( 1 === (int) get_current_site()->id ) {
// If the current network has an ID of 1, assume it is the main network.
$main_network_id = 1;
} else {
$main_network_id = wp_cache_get( 'primary_network_id', 'site-options' );
if ( false === $main_network_id ) {
$main_network_id = (int) $wpdb->get_var( "SELECT id FROM {$wpdb->site} ORDER BY id LIMIT 1" );
wp_cache_add( 'primary_network_id', $main_network_id, 'site-options' );
}
}
/**
* Filter the main network ID.
*
* @since 4.3.0
*
* @param int $main_network_id The ID of the main network.
*/
return (int) apply_filters( 'get_main_network_id', $main_network_id );
}
}

View File

@@ -0,0 +1,94 @@
<?php
/**
*
*/
namespace WCFE;
/**
*
*/
class CompatibleWordpress
{
/**
* put your comment there...
*
* @var mixed
*/
private static $instance;
/**
* put your comment there...
*
* @var mixed
*/
private $checkPoints = array
(
'4.3.0',
);
/**
* put your comment there...
*
* @var mixed
*/
private $versionBase;
/**
* put your comment there...
*
* @param mixed $versionBase
* @return CompatibleWordpress
*/
private function __construct( $versionBase )
{
$this->versionBase =& $versionBase;
}
/**
* put your comment there...
*
*/
protected function load()
{
foreach ( $this->checkPoints as $chkPointVersion )
{
// Include all versions that are newer than current version
if ( version_compare( $this->versionBase, $chkPointVersion ) == -1 )
{
$versionFile = __DIR__ . DIRECTORY_SEPARATOR . "{$chkPointVersion}.php";
if ( file_exists( $versionFile ) )
{
require $versionFile;
}
}
}
}
/**
* put your comment there...
*
* @param mixed $versionBase
* @return CompatibleWordpress
*/
public static function loadCompatibilityLayers( $versionBase )
{
if ( ! self::$instance )
{
self::$instance = new CompatibleWordpress( $versionBase );
// Load layers
self::$instance->load();
}
return self::$instance;
}
}