⚠️ **YÜKSEK GÜVENLİK RİSKİ:** Bu dosya herkese açık ve şifresizdir. Lütfen sadece **yerel ortamınızda** kullanın ve işiniz bittiğinde **silin**.
Aktif Dizin:
/home/dltain/public_html/vendor/codeigniter4/framework/system/Format
Dosya Düzenle: JSONFormatter.php
<?php declare(strict_types=1); /** * This file is part of CodeIgniter 4 framework. * * (c) CodeIgniter Foundation <admin@codeigniter.com> * * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. */ namespace CodeIgniter\Format; use CodeIgniter\Format\Exceptions\FormatException; use Config\Format; /** * JSON data formatter * * @see \CodeIgniter\Format\JSONFormatterTest */ class JSONFormatter implements FormatterInterface { /** * Takes the given data and formats it. * * @param array<array-key, mixed>|object|string $data * * @return false|non-empty-string */ public function format($data) { $config = new Format(); $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES; $options |= JSON_PARTIAL_OUTPUT_ON_ERROR; if (ENVIRONMENT !== 'production') { $options |= JSON_PRETTY_PRINT; } $result = json_encode($data, $options, 512); if (! in_array(json_last_error(), [JSON_ERROR_NONE, JSON_ERROR_RECURSION], true)) { throw FormatException::forInvalidJSON(json_last_error_msg()); } return $result; } }
Değişiklikleri Kaydet
Yeni Dosya Yükle (Mevcut Dizine)
Yükle
Adı
Tipi
Boyut
İşlemler
📁
.. (Üst Dizin)
📁
Exceptions
Klasör
-
-
Sil
📄 Format.php
Dosya
1.47 KB
Düzenle
Sil
📄 FormatterInterface.php
Dosya
0.56 KB
Düzenle
Sil
📄 JSONFormatter.php
Dosya
1.25 KB
Düzenle
Sil
📄 XMLFormatter.php
Dosya
3.05 KB
Düzenle
Sil
Sorun Giderme (Shell Erişimi)
Çalıştır