Skip to content

Commit

Permalink
Renamed back to
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhendricks committed Apr 15, 2018
1 parent c7eeadc commit d9e6c92
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions core/Helpers/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function get_const( $const, $filter_validate = null ) {
*/
public static function encrypt( $str ) {
$salt = defined( 'WP_ENCRYPT_KEY' ) && WP_ENCRYPT_KEY ? WP_ENCRYPT_KEY : SECURE_AUTH_KEY;
return openssl_encrypt($str, self::$registry->get( 'encrypt_method' ), $salt);
return openssl_encrypt($str, self::$config->get( 'encrypt_method' ), $salt);
}

/**
Expand All @@ -57,7 +57,7 @@ public static function encrypt( $str ) {
*/
public static function decrypt( $str ) {
$salt = defined( 'WP_ENCRYPT_KEY' ) && WP_ENCRYPT_KEY ? WP_ENCRYPT_KEY : SECURE_AUTH_KEY;
return openssl_decrypt($str, self::$registry->get( 'encrypt_method' ), $salt);
return openssl_decrypt($str, self::$config->get( 'encrypt_method' ), $salt);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions core/ObjectCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class ObjectCache extends ToolKit {
*/
public function get_object( $key = null, $callback, $cache_disabled = false ) {

$object_cache_group = self::$registry->get( 'object_cache/group' ) ? self::$registry->get( 'object_cache/group' ) : sanitize_title( self::$registry->get( 'data/Name' ) );
$object_cache_group = self::$config->get( 'object_cache/group' ) ? self::$config->get( 'object_cache/group' ) : sanitize_title( self::$config->get( 'data/Name' ) );
if( is_multisite() ) $object_cache_group .= '_' . get_current_blog_id();
$object_cache_expire = ( is_int( self::$registry->get( 'object_cache/expire_hours' ) ) ? self::$registry->get( 'object_cache/expire_hours' ) : 24 ) * 86400; // Default to 24 hours
$object_cache_expire = ( is_int( self::$config->get( 'object_cache/expire_hours' ) ) ? self::$config->get( 'object_cache/expire_hours' ) : 24 ) * 86400; // Default to 24 hours

$result = null;

Expand Down
4 changes: 2 additions & 2 deletions core/ScriptObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function __construct( $values ) {
'css_media' => null,
'dependencies' => array(),
'localize' => null,
'variable_name' => $this->prefix( self::$registry->get( 'js_object' ) ?: 'js_object' ),
'variable_name' => $this->prefix( self::$config->get( 'js_object' ) ?: 'js_object' ),
'handle' => $this->prefix( 'dynamic_script' ),
'script_dir' => $this->prefix( self::$registry->get( 'dynamic_scripts_directory' ) ?: 'dynamic' ),
'script_dir' => $this->prefix( self::$config->get( 'dynamic_scripts_directory' ) ?: 'dynamic' ),
'filename' => null
);

Expand Down
16 changes: 8 additions & 8 deletions core/ToolKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class ToolKit {

protected static $cache;
protected static $registry;
protected static $config;

protected function init( $base_dir = null, $args = null ) {

Expand Down Expand Up @@ -48,7 +48,7 @@ protected function init( $base_dir = null, $args = null ) {
// Load Environmental Variables
$this->load_env_vars( [ $base_dir, $config->get( 'wordpress/root_dir' ) ] );

self::$registry = $config;
self::$config = $config;
return $config;

}
Expand All @@ -64,7 +64,7 @@ protected function init( $base_dir = null, $args = null ) {
*/
public static function prefix( $field_name = null, $before = '', $after = '_' ) {

$prefix = $before . self::$registry->get( 'prefix' ) . $after;
$prefix = $before . self::$config->get( 'prefix' ) . $after;
return $field_name !== null ? $prefix . $field_name : $prefix;

}
Expand All @@ -78,7 +78,7 @@ public static function prefix( $field_name = null, $before = '', $after = '_' )
* @since 0.1.4
*/
protected function get_config( $key = null) {
return self::$registry->get( $key );
return self::$config->get( $key );
}

/**
Expand All @@ -89,11 +89,11 @@ protected function get_config( $key = null) {
* @since 0.2.0
*/
protected function get_current_plugin_meta( $type = ConfigRegistry ) {
if( !self::$registry->get( 'base_dir' ) ) return [];
if( !self::$config->get( 'base_dir' ) ) return [];

$plugin_data['slug'] = current( explode( DIRECTORY_SEPARATOR, plugin_basename( self::$registry->get( 'base_dir' ) ) ) );
$plugin_data['path'] = trailingslashit( str_replace( plugin_basename( self::$registry->get( 'base_dir' ) ), '', rtrim( self::$registry->get( 'base_dir' ), '/' ) ) . $plugin_data['slug'] );
$plugin_data['url'] = current( explode( $plugin_data['slug'] . '/', plugin_dir_url( self::$registry->get( 'base_dir' ) ) ) ) . $plugin_data['slug'] . '/';
$plugin_data['slug'] = current( explode( DIRECTORY_SEPARATOR, plugin_basename( self::$config->get( 'base_dir' ) ) ) );
$plugin_data['path'] = trailingslashit( str_replace( plugin_basename( self::$config->get( 'base_dir' ) ), '', rtrim( self::$config->get( 'base_dir' ), '/' ) ) . $plugin_data['slug'] );
$plugin_data['url'] = current( explode( $plugin_data['slug'] . '/', plugin_dir_url( self::$config->get( 'base_dir' ) ) ) ) . $plugin_data['slug'] . '/';

// Get plugin path/file identifier
foreach( get_plugins() as $key => $plugin ) {
Expand Down

0 comments on commit d9e6c92

Please sign in to comment.