- Beranda
- Website, Webmaster, Webdeveloper
HELP MASTAH! protected function
...
![mentaldisorder](https://s.kaskus.id/user/avatar/2010/01/17/avatar1353549_8.gif)
![Avatar border](https://s.kaskus.id/images/avatarborder/1.gif)
TS
mentaldisorder
HELP MASTAH! protected function
langsung aja ya mastah2, web ane error ada tulisan ![Matabelo emoticon-Matabelo](https://s.kaskus.id/images/smilies/smilies_fb5ohtvdpjkq.gif)
Fatal error: Call to a member function load() on a non-object in EGRS.php
ini file EGRS.php
solusinya gmn ya gan untuk unprotect?
mohon bantuannya mastah2
makasih banyak ya mastah2 sebelumnya![Blue Guy Cendol (L) emoticon-Blue Guy Cendol (L)](https://s.kaskus.id/images/smilies/smilies_fb5ox6pblpkt.gif)
![Matabelo emoticon-Matabelo](https://s.kaskus.id/images/smilies/smilies_fb5ohtvdpjkq.gif)
Fatal error: Call to a member function load() on a non-object in EGRS.php
ini file EGRS.php
Spoiler for "file php yg error":
Code:
final class EGRS {
/**
* Config collection
*
* @var array
*/
public $egrs = array();
/**
* Constructor method
*
*/
public function __construct() {
$this->init();
}
/**
* Init method
*
*/
public function init() {
$this->_loadTheme();
$this->_loadThemeSpecifics();
$this->_loadClasses();
$this->_checkVersion();
$this->_loadConfig();
}
/**
* Check WP version
*
*/
protected function _checkVersion() {
global $wp_version;
if( version_compare($wp_version, EGRS_MINIMUM_WP_VERSION, '<') && is_admin() ) {
$this->getModel('message')
->addMessage( __('You are using an older version of Wordpress.
This theme should not work properly.
Please update your <strong>Wordpress</strong> version to the
latest as soon as possible.', 'egrs'), 'error');
}
}
/**
* Load initial config
*
*/
[B] protected function _loadConfig() {
$config = $this->getModel('config');
$this->egrs['config'] = $config->load();
}
[/B]
/**
* Load classes
*
*/
[B]protected function _loadClasses() {
$corePath = EGRS_CORE_PATH . '/egrs/*.php';
$includesPath = EGRS_THEME_FUNC_DIR . '/egrs/*.php';[/B]
//search overrides within includes folder
foreach( (array)glob($includesPath) as $class ) {
if ( empty( $class ) ) continue;
$className = 'EGRS_' . basename($class, '.php');
require_once($class);
$this->egrs['class'][substr(strtolower($className),4)] = new $className;
if( method_exists( $this->egrs['class'][substr(strtolower($className),4)], 'init' ) ) {
add_action( 'egrs_loaded', array( &$this->egrs['class'][substr(strtolower($className),4)], 'init' ) );
}
}
//load core classes
foreach( (array)glob($corePath) as $class ) {
if ( empty( $class ) ) continue;
$className = 'EGRS_' . basename($class, '.php');
if(!class_exists($className)) {
require_once($class);
$this->egrs['class'][substr(strtolower($className),4)] = new $className;
if( method_exists( $this->egrs['class'][substr(strtolower($className),4)], 'init' ) ) {
add_action( 'egrs_loaded', array( &$this->egrs['class'][substr(strtolower($className),4)], 'init' ), 1 );
}
}
}
}
/**
* Load theme specific panel
*
* @param string $path
*/
[B]protected function _loadThemeSpecifics( $path = null ) {
if( is_null( $path ) )
{ $path = EGRS_THEME_FUNC_DIR . '/panel/*'; }[/B]
foreach( (array)glob( $path ) as $file ) {
if ( empty( $file ) ) continue;
if( is_dir( $file ) ) {
$this->_loadThemeSpecifics( $file . '/*' );
} else {
$file_info = pathinfo($file);
if( $file_info['extension'] == 'php' ) {
require_once $file;
}
}
}
}
/**
* Load theme specific files
*/
[B]protected function _loadTheme() {[/B]
$excluded_files = array( 'metaboxes.php', 'woocommerce.php', 'jigoshop.php' );
$excluded_files = apply_filters( 'egrs_excluded_theme_files', $excluded_files );
foreach( $excluded_files as &$exfile ) {
$exfile = EGRS_THEME_FUNC_DIR . '/' . $exfile;
}
foreach( (array)glob( EGRS_THEME_FUNC_DIR . '/*.php' ) as $file ) {
if ( in_array( $file, $excluded_files ) ) { continue; }
if ( ! empty( $file ) ) require_once $file;
}
}
/**
* Get class instance from $egrs['class'] array
*
* @param $class
*
* @return object
*/
public function getModel($class) {
return $this->egrs['class'][$class];
}
/**
* Set/Get attribute wrapper
*
* @param string $method
* @param array $args
* @return mixed
*/
public function __call($method, $args = null) {
switch (substr($method, 0, 3)) {
case 'get' :
$data = $this->egrs;
$keys = $this->_keys(substr($method,3));
foreach( $keys as $key ) {
$data = $data[strtolower($key)];
}
return $data;
//case 'set' : break;
default: break;
}
}
/**
* Get field names for setters and geters
*
* $this->getConfigFontWebsafe() === $this->egrs['config']['font']['websafe']
*
* @param string $name
*
* @return array
*/
protected function _keys($name)
{
preg_match_all('/([A-Z][a-z0-9]+)/', $name, $matches);
return $matches[0];
}
}
/**
* Get class instance from $egrs['class'] array
*
* @param string $class
* @return object
*
* @since 1.0.0
*/
function egrs_get_model( $class ) {
global $egrs;
return $egrs->getModel( $class );
}
solusinya gmn ya gan untuk unprotect?
mohon bantuannya mastah2
makasih banyak ya mastah2 sebelumnya
![Blue Guy Cendol (L) emoticon-Blue Guy Cendol (L)](https://s.kaskus.id/images/smilies/smilies_fb5ox6pblpkt.gif)
Diubah oleh mentaldisorder 23-11-2012 15:23
0
1.3K
Kutip
8
Balasan
![Guest](https://s.kaskus.id/user/avatar/default.png)
![Avatar border](https://s.kaskus.id/images/avatarborder/1.gif)
Komentar yang asik ya
Mari bergabung, dapatkan informasi dan teman baru!
![Website, Webmaster, Webdeveloper](https://s.kaskus.id/r200x200/ficon/image-13.png)
Website, Webmaster, Webdeveloper![KASKUS Official KASKUS Official](https://s.kaskus.id/kaskus-next/next-assets/images/icon-official-badge.svg)
23.3KThread•4.5KAnggota
Urutkan
Terlama
![Guest](https://s.kaskus.id/user/avatar/default.png)
![Avatar border](https://s.kaskus.id/images/avatarborder/1.gif)
Komentar yang asik ya