One Hat Cyber Team
Your IP :
216.73.216.14
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
backup
/
oldserver
/
2
/
bin
/
View File Name :
mnemo-convert-to-utf8
#!/usr/bin/php <?php /** * This script converts the data in an SQL backend from any supported charset * to UTF-8. * * Copyright 2008-2017 Horde LLC (http://www.horde.org/) * * See the enclosed file LICENSE for license information (ASL). If you * did not receive this file, see http://www.horde.org/licenses/apache. * * @author Jan Schneider <jan@horde.org> */ if (file_exists(__DIR__ . '/../../mnemo/lib/Application.php')) { $baseDir = __DIR__ . '/../'; } else { require_once 'PEAR/Config.php'; $baseDir = PEAR_Config::singleton() ->get('horde_dir', null, 'pear.horde.org') . '/mnemo/'; } require_once $baseDir . 'lib/Application.php'; Horde_Registry::appInit('mnemo', array('cli' => true)); if ($conf['storage']['driver'] != 'sql') { exit("You must have an SQL backend configured.\n"); } $table = 'mnemo_memos'; $db = $injector->getInstance('Horde_Db_Adapter'); // Get current charset. $charset = $cli->prompt('Please specify the current charset of the data', null, 'ISO-8859-1'); // Read existing notes. try { $results = $db->selectAll('SELECT memo_owner, memo_id, memo_desc, memo_body FROM mnemo_memos'); } catch (Horde_Db_Exception $e) { $cli->fatal($e->getMessage()); } $sth = 'UPDATE mnemo_memos SET memo_desc = ?, memo_body = ?' . ' WHERE memo_owner = ? AND memo_id = ?'; echo 'Converting notes'; foreach ($results as $row) { $values = Horde_String::convertCharset( array($row['memo_desc'], $row['memo_body']), $charset, 'UTF-8'); $values[] = $row['memo_owner']; $values[] = $row['memo_id']; try { $executed = $db->update($sth, $values); } catch (Horde_Db_Exception $e) { $cli->fatal($e->getMessage()); } echo '.'; } $cli->writeln($cli->green('Done'));