PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 152
Lasso Lite – Affiliate Link Manager & Product Displays v152
157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 116 All 56 releases
simple-urls / classes / class-init.php

class-init.php in Lasso Lite – Affiliate Link Manager & Product Displays 152, at classes/class-init.php

133 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Declare class Helper
4 *
5 * @package Helper
6 */
7
8 namespace LassoLite\Classes;
9
10 /**
11 * Init
12 */
13 class Init {
14 /**
15 * Declare vars of Lasso_Init
16 *
17 * @var array $classes List of classes
18 */
19 private $classes;
20
21 /**
22 * Declare vars of Lasso_Init
23 *
24 * @var array $ajaxes List of ajaxes
25 */
26 private $ajaxes;
27
28 /**
29 * Declare vars of Lasso_Init
30 *
31 * @var array $hooks List of hooks
32 */
33 private $hooks;
34
35 /**
36 * Declare vars of Lasso_Init
37 *
38 * @var array $processes List of processes
39 */
40 private $processes;
41
42 /**
43 * Init constructor.
44 */
45 public function __construct() {
46 $this->ajaxes = array(
47 '\LassoLite\Pages\Ajax',
48 '\LassoLite\Pages\Dashboard\Ajax',
49 '\LassoLite\Pages\Import_Urls\Ajax',
50 '\LassoLite\Pages\Url_Details\Ajax',
51 '\LassoLite\Pages\Settings\Ajax',
52 '\LassoLite\Pages\Groups\Ajax',
53 '\LassoLite\Pages\Install\Ajax',
54 );
55
56 $this->hooks = array(
57 '\LassoLite\Pages\Hook',
58 '\LassoLite\Pages\Url_Details\Hook',
59 '\LassoLite\Pages\Import_Urls\Hook',
60 '\LassoLite\Classes\Cron',
61 );
62
63 $this->classes = array();
64
65 $this->processes = array(
66 '\LassoLite\Classes\Processes\Amazon',
67 '\LassoLite\Classes\Processes\Amazon_Shortlink',
68 '\LassoLite\Classes\Processes\Import_All',
69 '\LassoLite\Classes\Processes\Revert_All',
70 );
71
72 $this->load_classes();
73 $this->update_db();
74 }
75
76 /**
77 * Load classes
78 */
79 public function load_classes() {
80 $this->initalize_ajaxes();
81 $this->initalize_hooks();
82 $this->initalize_classes();
83 $this->initalize_processes();
84 }
85
86 /**
87 * Register hooks
88 */
89 public function initalize_hooks() {
90 foreach ( $this->hooks as $hook_class ) {
91 $hook_object = new $hook_class();
92 $hook_object->register_hooks();
93 }
94 }
95
96 /**
97 * Register Ajax hooks
98 */
99 public function initalize_ajaxes() {
100 foreach ( $this->ajaxes as $ajax_class ) {
101 $ajax_object = new $ajax_class();
102 $ajax_object->register_hooks();
103 }
104 }
105
106 /**
107 * Create an object of class
108 */
109 public function initalize_classes() {
110 foreach ( $this->classes as $class ) {
111 new $class();
112 }
113 }
114
115 /**
116 * Create an object of class
117 */
118 public function initalize_processes() {
119 foreach ( $this->processes as $process ) {
120 new $process();
121 }
122 }
123
124 /**
125 * Execute Update Database
126 *
127 * @return void
128 */
129 public function update_db() {
130 new Update_DB();
131 }
132 }
133