balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

class.mtekk_adminkit_uninstaller.php (2224B)


      1 <?php
      2 /*
      3 	Copyright 2015-2018  John Havlik  (email : john.havlik@mtekk.us)
      4 
      5     This program is free software; you can redistribute it and/or modify
      6     it under the terms of the GNU General Public License as published by
      7     the Free Software Foundation; either version 2 of the License, or
      8     (at your option) any later version.
      9 
     10     This program is distributed in the hope that it will be useful,
     11     but WITHOUT ANY WARRANTY; without even the implied warranty of
     12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13     GNU General Public License for more details.
     14 
     15     You should have received a copy of the GNU General Public License
     16     along with this program; if not, write to the Free Software
     17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     18 */
     19 require_once(dirname(__FILE__) . '/block_direct_access.php');
     20 /**
     21  * Breadcrumb NavXT abstract plugin uninstaller class
     22  * 
     23  * @author Tom Klingenberg
     24  */
     25 abstract class mtekk_adminKit_uninstaller
     26 {
     27 	protected $unique_prefix = '';
     28 	protected $plugin_basename = null;
     29 	protected $_uninstall_result = false;
     30 	/**
     31 	 * get plugin path
     32 	 * 
     33 	 * @return string full path to plugin file
     34 	 */
     35 	protected function _get_plugin_path()
     36 	{
     37 		return sprintf('%s/%s', dirname(dirname(__FILE__)), $this->plugin_basename);		
     38 	}
     39 
     40 	/**
     41 	 * constructor 
     42 	 * 
     43 	 * @param  array $options class options
     44 	 * 				plugin => 
     45 	 */
     46 	public function __construct()
     47 	{
     48 		$this->_uninstall_result = $this->uninstall();				
     49 	}
     50 	
     51 	/**
     52 	 * Result Getter
     53 	 * 
     54 	 * @return bool wether or not uninstall did run successfull.
     55 	 */
     56 	public function get_result()
     57 	{
     58 		return $this->_uninstall_result;	
     59 	}
     60 	
     61 	public function is_installed()
     62 	{
     63 		return ((get_option($this->unique_prefix . '_options') !== false)
     64 				&& (get_option($this->unique_prefix . '_options_bk') !== false)
     65 				&& (get_option($this->unique_prefix . '_version') !== false)
     66 				&& (get_site_option($this->unique_prefix . '_options') !== false)
     67 				&& (get_site_option($this->unique_prefix . '_options_bk') !== false)
     68 				&& (get_site_option($this->unique_prefix . '_version') !== false));
     69 	}
     70 } /// class bcn_uninstaller_abstract