⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.50
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
View File Name :
mnemo-convert-to-utf8
#!/usr/bin/env php */ 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'));