diff --git a/htdocs/.DS_Store b/htdocs/.DS_Store index 47c584c2..45f4eef9 100644 Binary files a/htdocs/.DS_Store and b/htdocs/.DS_Store differ diff --git a/htdocs/app/Http/Controllers/JsonTransferController.php b/htdocs/app/Http/Controllers/JsonTransferController.php index 29afede3..46caf578 100644 --- a/htdocs/app/Http/Controllers/JsonTransferController.php +++ b/htdocs/app/Http/Controllers/JsonTransferController.php @@ -95,40 +95,39 @@ class JsonTransferController extends Controller return response()->download($zipFile); } public function importTable($table) { + $path = base_path($this->exportPath . $table . '.json'); if (!file_exists($path)) { return back()->with('error', "File JSON untuk tabel $table tidak ditemukan."); } - try { - DB::beginTransaction(); - DB::table($table)->truncate(); + DB::statement("TRUNCATE TABLE $table RESTART IDENTITY CASCADE"); - $items = Items::fromFile($path); + $items = Items::fromFile($path); + $chunk = []; - $chunk = []; - foreach ($items as $row) { - $row = json_decode(json_encode($row), true); - $chunk[] = $row; + foreach ($items as $row) { + $data = (array) $row; + unset($data['id']); + $chunk[] = (array) $row; - if (count($chunk) >= 200) { - DB::table($table)->insert($chunk); - $chunk = []; - } - } - - if (!empty($chunk)) { + if (count($chunk) >= 50) { + DB::table($table)->insert($chunk); + $chunk = []; } - DB::commit(); - return back()->with('success', "Import berhasil!"); - } catch (\Exception $e) { - DB::rollBack(); - return back()->with('error', $e->getMessage()); + unset($row); } + + if (!empty($chunk)) { + DB::table($table)->insert($chunk); + } + + return back()->with('success', 'Import berhasil!'); } + public function pull(Request $request){ if (session('previlage') !== 'developer') { abort(403, 'Akses ditolak. Anda tidak memiliki izin untuk menjalankan git pull.'); diff --git a/htdocs/config/database.php b/htdocs/config/database.php index db971831..fca95fe4 100644 --- a/htdocs/config/database.php +++ b/htdocs/config/database.php @@ -59,7 +59,7 @@ return [ 'strict' => false, 'engine' => null, 'options' => extension_loaded('pdo_mysql') ? array_filter([ - PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), + Pdo\Mysql::ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], diff --git a/htdocs/config/log-viewer.php b/htdocs/config/log-viewer.php deleted file mode 100644 index b0816e22..00000000 --- a/htdocs/config/log-viewer.php +++ /dev/null @@ -1,146 +0,0 @@ - storage_path('logs'), - - /* ----------------------------------------------------------------- - | Log files pattern - | ----------------------------------------------------------------- - */ - - 'pattern' => [ - 'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-' - 'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' - 'extension' => Filesystem::PATTERN_EXTENSION, // '.log' - ], - - /* ----------------------------------------------------------------- - | Locale - | ----------------------------------------------------------------- - | Supported locales : - | 'auto', 'ar', 'bg', 'de', 'en', 'es', 'et', 'fa', 'fr', 'hu', 'hy', 'id', 'it', 'ja', 'ko', 'nl', - | 'pl', 'pt-BR', 'ro', 'ru', 'sv', 'th', 'tr', 'zh-TW', 'zh' - */ - - 'locale' => 'auto', - - /* ----------------------------------------------------------------- - | Theme - | ----------------------------------------------------------------- - | Supported themes : - | 'bootstrap-5' - | 'bootstrap-4' - | 'bootstrap-3' - | - | You can make your own theme by adding a folder to the views directory and specifying it here. - */ - - 'theme' => 'bootstrap-5', - - /* ----------------------------------------------------------------- - | Route settings - | ----------------------------------------------------------------- - */ - - 'route' => [ - 'enabled' => true, - - 'attributes' => [ - 'prefix' => 'log-viewer', - - 'middleware' => env('ARCANEDEV_LOGVIEWER_MIDDLEWARE') ? explode(',', env('ARCANEDEV_LOGVIEWER_MIDDLEWARE')) : null, - ], - - 'show' => 'log-viewer::logs.show' - ], - - /* ----------------------------------------------------------------- - | Log entries per page - | ----------------------------------------------------------------- - | This defines how many logs & entries are displayed per page. - */ - - 'per-page' => 30, - - /* ----------------------------------------------------------------- - | Download settings - | ----------------------------------------------------------------- - */ - - 'download' => [ - 'prefix' => 'laravel-', - - 'extension' => 'log', - ], - - /* ----------------------------------------------------------------- - | Menu settings - | ----------------------------------------------------------------- - */ - - 'menu' => [ - 'filter-route' => 'log-viewer::logs.filter', - - 'icons-enabled' => true, - ], - - /* ----------------------------------------------------------------- - | Icons - | ----------------------------------------------------------------- - */ - - 'icons' => [ - /** - * Font awesome >= 4.3 - * http://fontawesome.io/icons/ - */ - 'all' => 'fa fa-fw fa-list', // http://fontawesome.io/icon/list/ - 'emergency' => 'fa fa-fw fa-bug', // http://fontawesome.io/icon/bug/ - 'alert' => 'fa fa-fw fa-bullhorn', // http://fontawesome.io/icon/bullhorn/ - 'critical' => 'fa fa-fw fa-heartbeat', // http://fontawesome.io/icon/heartbeat/ - 'error' => 'fa fa-fw fa-times-circle', // http://fontawesome.io/icon/times-circle/ - 'warning' => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/ - 'notice' => 'fa fa-fw fa-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/ - 'info' => 'fa fa-fw fa-info-circle', // http://fontawesome.io/icon/info-circle/ - 'debug' => 'fa fa-fw fa-life-ring', // http://fontawesome.io/icon/life-ring/ - ], - - /* ----------------------------------------------------------------- - | Colors - | ----------------------------------------------------------------- - */ - - 'colors' => [ - 'levels' => [ - 'empty' => '#D1D1D1', - 'all' => '#8A8A8A', - 'emergency' => '#B71C1C', - 'alert' => '#D32F2F', - 'critical' => '#F44336', - 'error' => '#FF5722', - 'warning' => '#FF9100', - 'notice' => '#4CAF50', - 'info' => '#1976D2', - 'debug' => '#90CAF9', - ], - ], - - /* ----------------------------------------------------------------- - | Strings to highlight in stack trace - | ----------------------------------------------------------------- - */ - - 'highlight' => [ - '^#\d+', - '^Stack trace:', - ], - -]; diff --git a/htdocs/public/adminer.php b/htdocs/public/adminer.php index 762aaafb..114de5d9 100644 --- a/htdocs/public/adminer.php +++ b/htdocs/public/adminer.php @@ -5,211 +5,281 @@ * @copyright 2007 Jakub Vrana * @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other) -* @version 4.8.1 -*/function -adminer_errors($Cc,$Ec){return!!preg_match('~^(Trying to access array offset on value of type null|Undefined array key)~',$Ec);}error_reporting(6135);set_error_handler('adminer_errors',E_WARNING);$ad=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($ad||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$Ii=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($Ii)$$X=$Ii;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function -connection(){global$g;return$g;}function -adminer(){global$b;return$b;}function -version(){global$ia;return$ia;}function -idf_unescape($v){if(!preg_match('~^[`\'"]~',$v))return$v;$qe=substr($v,-1);return -str_replace($qe.$qe,$qe,substr($v,1,-1));}function +* @version 5.4.1 +*/namespace +Adminer;const +VERSION="5.4.1";error_reporting(24575);set_error_handler(function($Ec,$Gc){return!!preg_match('~^Undefined (array key|offset|index)~',$Gc);},E_WARNING|E_NOTICE);$cd=!preg_match('~^(unsafe_raw)?$~',ini_get("filter.default"));if($cd||ini_get("filter.default_flags")){foreach(array('_GET','_POST','_COOKIE','_SERVER')as$X){$xj=filter_input_array(constant("INPUT$X"),FILTER_UNSAFE_RAW);if($xj)$$X=$xj;}}if(function_exists("mb_internal_encoding"))mb_internal_encoding("8bit");function +connection($h=null){return($h?:Db::$instance);}function +adminer(){return +Adminer::$instance;}function +driver(){return +Driver::$instance;}function +connect(){$Hb=adminer()->credentials();$J=Driver::connect($Hb[0],$Hb[1],$Hb[2]);return(is_object($J)?$J:null);}function +idf_unescape($v){if(!preg_match('~^[`\'"[]~',$v))return$v;$Le=substr($v,-1);return +str_replace($Le.$Le,$Le,substr($v,1,-1));}function +q($Q){return +connection()->quote($Q);}function escape_string($X){return substr(q($X),1,-1);}function +idx($xa,$y,$l=null){return($xa&&array_key_exists($y,$xa)?$xa[$y]:$l);}function number($X){return preg_replace('~[^0-9]+~','',$X);}function number_type(){return'((?$W){unset($tg[$z][$he]);if(is_array($W)){$tg[$z][stripslashes($he)]=$W;$tg[]=&$tg[$z][stripslashes($he)];}else$tg[$z][stripslashes($he)]=($ad?$W:stripslashes($W));}}}}function -bracket_escape($v,$Na=false){static$ui=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return -strtr($v,($Na?array_flip($ui):$ui));}function -min_version($Zi,$De="",$h=null){global$g;if(!$h)$h=$g;$nh=$h->server_info;if($De&&preg_match('~([\d.]+)-MariaDB~',$nh,$C)){$nh=$C[1];$Zi=$De;}return(version_compare($nh,$Zi)>=0);}function -charset($g){return(min_version("5.5.3",0,$g)?"utf8mb4":"utf8");}function -script($yh,$ti="\n"){return"$yh$ti";}function -script_src($Ni){return"\n";}function -nonce(){return' nonce="'.get_nonce().'"';}function -target_blank(){return' target="_blank" rel="noreferrer noopener"';}function -h($P){return -str_replace("\0","�",htmlspecialchars($P,ENT_QUOTES,'utf-8'));}function -nl_br($P){return -str_replace("\n","
",$P);}function -checkbox($D,$Y,$db,$me="",$uf="",$hb="",$ne=""){$I="".($uf?script("qsl('input').onclick = function () { $uf };",""):"");return($me!=""||$hb?"$I".h($me)."":$I);}function -optionlist($_f,$gh=null,$Ri=false){$I="";foreach($_f -as$he=>$W){$Af=array($he=>$W);if(is_array($W)){$I.='';$Af=$W;}foreach($Af -as$z=>$X)$I.=''.h($X);if(is_array($W))$I.='';}return$I;}function -html_select($D,$_f,$Y="",$tf=true,$ne=""){if($tf)return"".(is_string($tf)?script("qsl('select').onchange = function () { $tf };",""):"");$I="";foreach($_f -as$z=>$X)$I.="";return$I;}function -select_input($Ia,$_f,$Y="",$tf="",$fg=""){$Yh=($_f?"select":"input");return"<$Yh$Ia".($_f?">