155. public function __construct(array $config = []) 156. { 157. $this->defaultConfig = Config::default('ZN\Database\DatabaseDefaultConfiguration') 158. ::get('Database', 'database'); 159. $this->config = array_merge($this->defaultConfig, $config); 160. $this->db = $this->runDriver(); 161. $this->prefix = $this->config['prefix']; 162. Properties::$prefix = $this->prefix; 163. 164. $this->db->connect($this->config); 165. } 166. 167. /** 168. * Magic Debug Info 169. */ 170. public function __debugInfo() 171. { 172. return ['return' => $this->stringQuery ?: 'This is a general object, please call the sub method!']; 173. } 174.
1. {[ 2. 3. class InternalAyarModel extends Model 4. { 5. 6. // Ayarları Çek 7. public function get(){ 8. return DB::where('id', 1)->ayarlar()->row(); 9. } 10. 11. // Ayarlar kayıt 12. public function save($data = null) { 13. return DB::where('id',1)->update('ignore:ayarlar', $data); 14. } 15. 16. 17. // TAblo oluşturma 18. public function createTable()
41. * protected use class name 42. * 43. * @param string $method 44. * @param array $parameters 45. * 46. * @return mixed 47. */ 48. protected static function useClassName($method, $parameters) 49. { 50. return Singleton::class(INTERNAL_ACCESS . static::getClassName())->$method(...$parameters); 51. } 52. }
15. * Magic call static 16. * 17. * @param string $method 18. * @param array $parameters 19. * 20. * @return mixed 21. */ 22. public static function __callStatic($method, $parameters) 23. { 24. return self::useClassName($method, $parameters); 25. } 26. 27. /** 28. * Magic call 29. * 30. * @param string $method 31. * @param array $parameters 32. * 33. * @return mixed 34. */
231. } 232. 233. 234. 235. 236. 237. public function s404() 238. { 239. 240. $data = AyarModel::get(); 241. $kapak = URL::base().UPLOADS_DIR."files/".$data->notfound_hero; 242. Masterpage::title(ML::select('not_found')); 243. View::kapak($kapak); 244. View::page('s404'); 245. } 246. 247. 248. }
139. $this->connect = new MySQLi; 140. 141. $this->connect->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true); 142. $this->connect->ssl_set($ssl['key'] ?? NULL, $ssl['cert'] ?? NULL, $ssl['ca'] ?? NULL, $ssl['capath'] ?? NULL, $ssl['cipher'] ?? NULL); 143. $this->connect->real_connect($host, $user, $pass, $db, $port, NULL, MYSQLI_CLIENT_SSL); 144. } 145. // @codeCoverageIgnoreEnd 146. else 147. { 148. $this->connect = new MySQLi($host, $user, $pass, $db, $port); 149. } 150. restore_error_handler(); 151. 152. if( $this->connect->connect_errno ) 153. { 154. throw new ConnectionErrorException(NULL, $this->connect->connect_error); // @codeCoverageIgnore 155. } 156. 157. mysqli_report(MYSQLI_REPORT_OFF); 158.