| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package GDPRess |
| 4 |
* @author Daan van den Bergh |
| 5 |
* https://daan.dev |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace GDPRess; |
| 9 |
|
| 10 |
class Setup { |
| 11 |
|
| 12 |
/** |
| 13 |
* Set Fields |
| 14 |
* |
| 15 |
* @return void |
| 16 |
*/ |
| 17 |
public function __construct() { |
| 18 |
$this->init_hooks(); |
| 19 |
} |
| 20 |
|
| 21 |
/** |
| 22 |
* Actions and Filters |
| 23 |
* |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
private function init_hooks() { |
| 27 |
register_activation_hook( GDPRESS_PLUGIN_FILE, [ $this, 'create_cache_dir' ] ); |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Create cache directory structure, if it doesn't exist yet. |
| 32 |
* |
| 33 |
* @return void |
| 34 |
*/ |
| 35 |
public function create_cache_dir() { |
| 36 |
if ( ! is_dir( GDPRESS_CACHE_ABSPATH ) ) { |
| 37 |
wp_mkdir_p( GDPRESS_CACHE_ABSPATH ); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|