Skip to content

Commit

Permalink
Adding quick_cache\share class. #151
Browse files Browse the repository at this point in the history
  • Loading branch information
JasWSInc committed Jun 12, 2014
1 parent 142ee8f commit a0d725a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions quick-cache/includes/share.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
namespace quick_cache // Root namespace.
{
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));

/**
* Quick Cache (Shared Methods)
*
* @package quick_cache\acp_shared
* @since 14xxxx Reorganizing class members.
*/
class share // Shared between {@link advanced_cache} and {@link plugin}.
{
public function __construct()
{
}
}

$GLOBALS[__NAMESPACE__.'__share'] = new share();
}
12 changes: 12 additions & 0 deletions quick-cache/quick-cache.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
if(!defined('WPINC')) // MUST have WordPress.
exit('Do NOT access this file directly: '.basename(__FILE__));

require_once dirname(__FILE__).'/includes/share.php';

if(!class_exists('\\'.__NAMESPACE__.'\\plugin'))
{
/**
Expand Down Expand Up @@ -107,6 +109,15 @@ class plugin
*/
public $cache_sub_dir = 'cache';

/**
* Easy reference to the {@link share} class instance.
*
* @since 14xxxx Reorganize class members.
*
* @var share References {@link share} class.
*/
public $share; // Set by constructor.

/**
* Quick Cache plugin constructor.
*
Expand All @@ -119,6 +130,7 @@ public function __construct()

$this->file = preg_replace('/\.inc\.php$/', '.php', __FILE__);
$this->text_domain = str_replace('_', '-', __NAMESPACE__);
$this->share = $GLOBALS[__NAMESPACE__.'__share'];

add_action('after_setup_theme', array($this, 'setup'));
register_activation_hook($this->file, array($this, 'activate'));
Expand Down

0 comments on commit a0d725a

Please sign in to comment.