���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/tie.cx/app/models/Settings.php
���ѧ٧ѧ�
<?php namespace Altum\Models; class Settings extends Model { public function get() { $cache_instance = \Altum\Cache::$adapter->getItem('settings'); /* Set cache if not existing */ if(!$cache_instance->get()) { $result = database()->query("SELECT * FROM `settings`"); $data = new \StdClass(); while($row = $result->fetch_object()) { /* Put the value in a variable so we can check if its json or not */ $value = json_decode($row->value); $data->{$row->key} = is_null($value) ? $row->value : $value; } \Altum\Cache::$adapter->save($cache_instance->set($data)->expiresAfter(86400)); } else { /* Get cache */ $data = $cache_instance->get('settings'); } /* Define some stuff from the database */ if(!defined('PRODUCT_VERSION')) define('PRODUCT_VERSION', $data->product_info->version); if(!defined('PRODUCT_CODE')) define('PRODUCT_CODE', $data->product_info->code); return $data; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.69 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�