PHP 8.3.27
Preview: manage.php Size: 2.28 KB
/home7/doctorbruno/www/doctorbruno.info/taeionline/support/manage.php
#!/usr/bin/env php
<?php
/*********************************************************************
    manage.php

    CLI (command line interface) for osTicket management. Use

    php manage.php --help

    for detailed and updated getting started information.

    Jared Hancock <jared@osticket.com>
    Copyright (c)  2006-2015 osTicket
    http://www.osticket.com

    Released under the GNU General Public License WITHOUT ANY WARRANTY.
    See LICENSE.TXT for details.

    vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require_once 'bootstrap.php';

// Make sure the script is executed via CLI
if (!osTicket::is_cli())
    die("Management only supported from command-line\n");

require_once CLI_DIR . 'cli.inc.php';
class Manager extends Module {
    var $prologue =
        "Manage one or more osTicket installations";

    var $arguments = array(
        'action' => "Action to be managed"
    );

    var $usage = '$script action [options] [arguments]';

    var $autohelp = false;

    function showHelp() {
        foreach (glob(CLI_DIR.'modules/*.php') as $script)
            include_once $script;

        global $registered_modules;
        $this->epilog =
            "Currently available modules follow. Use 'manage.php <module>
            --help' for usage regarding each respective module:";

        parent::showHelp();

        echo "\n";
        ksort($registered_modules);
        $width = max(array_map('strlen', array_keys($registered_modules)));
        foreach ($registered_modules as $name=>$mod)
            echo str_pad($name, $width + 2) . $mod->prologue . "\n";
    }

    function run($args, $options) {
        if ($options['help'] && !$args['action'])
            $this->showHelp();

        else {
            $action = $args['action'];

            global $argv;
            foreach ($argv as $idx=>$val)
                if ($val == $action)
                    unset($argv[$idx]);

            require_once CLI_DIR . "modules/{$args['action']}.php";
            if (($module = Module::getInstance($action)))
                return $module->_run($args['action']);

            $this->stderr->write("Unknown action given\n");
            $this->showHelp();
        }
    }
}

$manager = new Manager();
$manager->_run(basename(__file__), false);

Directory Contents

Dirs: 11 × Files: 23
Name Size Perms Modified Actions
api DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
apps DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
assets DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
css DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
images DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
include DIR
- drwxr-xr-x 2026-10-02 10:07:25
Edit Download
js DIR
- drwxr-xr-x 2026-10-02 10:07:26
Edit Download
kb DIR
- drwxr-xr-x 2026-10-02 10:07:26
Edit Download
pages DIR
- drwxr-xr-x 2026-10-02 10:07:26
Edit Download
scp DIR
- drwxr-xr-x 2026-10-02 10:07:26
Edit Download
setup DIR
- drwxr-xr-x 2026-10-02 10:07:26
Edit Download
5.31 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.88 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.06 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
15.92 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
611 B lrw-r--r-- 2026-06-28 09:39:09
Edit Download
3.00 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
2.31 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
2.30 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
2.28 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
44 B lrw-r--r-- 2026-10-02 10:07:25
Edit Download
5.63 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
925 B lrw-r--r-- 2026-06-28 09:39:09
Edit Download
732 B lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.98 KB lrw-r--r-- 2026-06-28 09:39:10
Edit Download
2.28 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
940 B lrw-r--r-- 2026-06-28 09:39:09
Edit Download
3.10 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.20 KB lrw-r--r-- 2026-06-28 09:39:10
Edit Download
3.17 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.14 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
5.66 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
1.67 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
2.15 KB lrw-r--r-- 2026-06-28 09:39:09
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).