| 1 |
<?php |
| 2 |
|
| 3 |
namespace ShopEngine\Base; |
| 4 |
|
| 5 |
defined('ABSPATH') || exit; |
| 6 |
|
| 7 |
/** |
| 8 |
* Common abstract Class. |
| 9 |
* Get common plugin information for name, title, dir, base, url etc |
| 10 |
* |
| 11 |
* @since 1.0.0 |
| 12 |
*/ |
| 13 |
abstract class Common { |
| 14 |
|
| 15 |
public function get_name() { |
| 16 |
return null; |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
public function get_title() { |
| 21 |
return $this->get_name(); |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
public function get_dir() { |
| 26 |
return dirname(__FILE__); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
public function get_base() { |
| 31 |
return str_replace(\ShopEngine::plugin_dir(), '', $this->get_dir()); |
| 32 |
|
| 33 |
return $this->get_dir(); |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
public function get_url() { |
| 38 |
return \ShopEngine::plugin_url() . $this->get_base(); |
| 39 |
} |
| 40 |
|
| 41 |
|
| 42 |
abstract public function init(); |
| 43 |
|
| 44 |
} |