@@ -39,6 +39,14 @@ class Manager extends Constants{
3939 'view ' => 'simple ' ,
4040 ];
4141
42+ /**
43+ * @var array
44+ */
45+ static public $ pagination_views = [
46+ 'bootstrap ' => 'bootstrap ' ,
47+ 'simple ' => 'simple ' ,
48+ ];
49+
4250 /**
4351 * @var array
4452 */
@@ -65,14 +73,19 @@ class Manager extends Constants{
6573 'latin1_bin ' ,
6674 ];
6775
68- /**
76+ /**
6977 * @var array
7078 */
7179 static private $ charsets = [
7280 'utf8mb4 ' ,
7381 'utf8 ' ,
7482 'latin1 ' ,
7583 ];
84+
85+ /**
86+ * @var string
87+ */
88+ static public $ default_bg = 'dark ' ;
7689
7790 /**
7891 * Initilize and Set the Database Configuration on constructor
@@ -91,18 +104,18 @@ class Manager extends Constants{
91104 */
92105 static public function initConfiguration (?array $ options = [])
93106 {
94- $ defaultOption = [
95- 'APP_DEBUG ' => $ options [ ' APP_DEBUG ' ] ?? true ,
96- 'APP_DEBUG_BG ' => $ options [ ' APP_DEBUG_BG ' ] ?? ' default ' ,
97- 'DRIVER_NAME ' => $ options [ ' DRIVER_NAME ' ]?? 'mysql ' ,
98- 'DB_HOST ' => $ options [ ' DB_HOST ' ] ?? 'localhost ' ,
99- 'DB_DATABASE ' => $ options [ ' DB_DATABASE ' ] ?? '' ,
100- 'DB_USERNAME ' => $ options [ ' DB_USERNAME ' ] ?? '' ,
101- 'DB_PASSWORD ' => $ options [ ' DB_PASSWORD ' ] ?? '' ,
102- 'DB_PORT ' => $ options [ ' DB_PORT ' ] ?? 3306 ,
103- 'DB_COLLATION ' => $ options [ ' DB_COLLATION ' ] ?? 'utf8mb4_unicode_ci ' ,
104- 'DB_CHARSET ' => $ options [ ' DB_CHARSET ' ] ?? 'utf8mb4 ' ,
105- ];
107+ $ defaultOption = array_merge ( [
108+ 'APP_DEBUG ' => true ,
109+ 'APP_DEBUG_BG ' => self :: $ default_bg ,
110+ 'DRIVER_NAME ' => 'mysql ' ,
111+ 'DB_HOST ' => 'localhost ' ,
112+ 'DB_DATABASE ' => '' ,
113+ 'DB_USERNAME ' => '' ,
114+ 'DB_PASSWORD ' => '' ,
115+ 'DB_PORT ' => 3306 ,
116+ 'DB_COLLATION ' => 'utf8mb4_unicode_ci ' ,
117+ 'DB_CHARSET ' => 'utf8mb4 ' ,
118+ ], $ options ) ;
106119
107120 // get accepted data
108121 $ defaultOption ['DB_COLLATION ' ] = self ::findCollation ($ defaultOption ['DB_COLLATION ' ]);
@@ -171,7 +184,7 @@ static public function getConfig($key = 'DB_HOST')
171184 {
172185 $ data = [
173186 'APP_DEBUG ' => defined ('APP_DEBUG ' ) ? APP_DEBUG : true ,
174- 'APP_DEBUG_BG ' => defined ('APP_DEBUG_BG ' ) ? APP_DEBUG_BG : ' default ' ,
187+ 'APP_DEBUG_BG ' => defined ('APP_DEBUG_BG ' ) ? APP_DEBUG_BG : self :: $ default_bg ,
175188 'DRIVER_NAME ' => defined ('DRIVER_NAME ' ) ? DRIVER_NAME : 'mysql ' ,
176189 'DB_HOST ' => defined ('DB_HOST ' ) ? DB_HOST : 'localhost ' ,
177190 'DB_DATABASE ' => defined ('DB_DATABASE ' ) ? DB_DATABASE : null ,
@@ -218,7 +231,7 @@ static public function setHeaders()
218231 flush ();
219232
220233 // Exit with response 404
221- exit ();
234+ exit (1 );
222235 }
223236
224237 /**
@@ -588,31 +601,4 @@ static public function convertOptimizeErrorTemp($result)
588601 ];
589602 }
590603
591- /**
592- * Create String Template of all possible error
593- * @param Exception $exception
594- *
595- * @return string
596- */
597- static public function convertExceptionErrorTemp (Exception $ exception )
598- {
599- $ temp = '' ;
600- $ getTrace = ($ exception )->getTrace ();
601- unset($ getTrace [0 ]);
602-
603- foreach ($ getTrace as $ key => $ error ){
604- if (!in_array ($ error ['function ' ], self ::$ disallow_method )){
605- $ temp .= "
606- << \\File>> {$ error ['file ' ]}
607- << \\Line>> {$ error ['line ' ]}
608- << \\Function>> {$ error ['function ' ]}
609- << \\Class>> {$ error ['class ' ]}
610- ====================================================
611- " ;
612- }
613- }
614-
615- return $ temp ;
616- }
617-
618604}
0 commit comments