PHPackages                             rah/rah\_terminal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. rah/rah\_terminal

ActiveTextpattern-plugin[CLI &amp; Console](/categories/cli)

rah/rah\_terminal
=================

Web terminal plugin for Textpattern

0.1.1(13y ago)22423GPL-2.0PHPPHP &gt;=5.2.0

Since Apr 24Pushed 12y ago2 watchersCompare

[ Source](https://github.com/gocom/rah_terminal)[ Packagist](https://packagist.org/packages/rah/rah_terminal)[ Docs](https://github.com/gocom/rah_terminal)[ RSS](/packages/rah-rah-terminal/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (3)Used By (3)

rah\_terminal
=============

[](#rah_terminal)

[Twitter](http://twitter.com/gocom) | [GitHub](https://github.com/gocom/rah_terminal) | [Donate](http://rahforum.biz/donate/rah_terminal)

Rah\_terminal is a plugin for [Textpattern CMS.](http:://textpattern.com) It provides a terminal emulator interface for executing external applications, commands and evaluating PHP code, right from Textpattern’s admin-panel.

Installing
----------

[](#installing)

Using [Composer](http://getcomposer.org):

```
$ composer.phar require rah/rah_terminal
```

Toolshed notice
---------------

[](#toolshed-notice)

This is a toolshed project. Experimental and not part of the main supported product line of Rah. Not yet at least. Please use at your own risk.

Requirements
------------

[](#requirements)

- Textpattern 4.5.0 or newer.

Modules
-------

[](#modules)

Modules can be used to extend rah\_terminal’s functionality, adding additional terminal types. Modules are like any other Textpattern plugin, and can be installed the same way. The following modules are available.

- [Markdown](https://github.com/gocom/rah_terminal_markdown)
- [Textile](https://github.com/gocom/rah_terminal_textile)
- [Texpattern template language](https://github.com/gocom/rah_terminal_txpmarkup)

Extending
---------

[](#extending)

The plugin comes small API which can be used to add additional terminal types to plugin. By default the plugin comes with options PHP, SQL and Shell, but that can be extended to include a *Textile Generator* among other things. These added terminal types act same as the built in ones do. A callback function is registered, and everything that the callback functions prints or returns to global scope, will be shown to the user. Thrown exceptions and errors are captured too.

### API

[](#api)

#### rah\_terminal::get() – Gets an instance of rah\_terminal class

[](#rah_terminalget--gets-an-instance-of-rah_terminal-class)

```
object rah_terminal::get();
```

`get()` is your standard factory method, following a loose singleton pattern. It returns an instance of the rah\_terminal class. When creating an object, always use `get()` instead of creating new instance yourself.

#### rah\_terminal::add\_terminal() – Adds a new terminal option

[](#rah_terminaladd_terminal--adds-a-new-terminal-option)

```
object rah_terminal::add_terminal( string $name, string|null $label, callback $callback );
```

`add_terminal()` adds and registers a new terminal option. The first parameter `$name` is a unique name for the terminal option, `$label` is the label shown to users and `$callback` is the callback function.

When registering new labels, please use prefixes in the `$name` and the `$callback` function to avoid conflicts with other codebases, including Textpattern core and rah\_terminal itself. For more information about prefixing please see Textpattern’s [Plugin Development Guidelines.](http://textpattern.net/wiki/index.php?title=Plugin_Development_Guidelines)

To use `add_terminal()` you would first get an instance of rah\_terminal using the static method `get()`.

```
rah_terminal::get()
	->add_terminal('abc_example', gTxt('abc_example_label'), 'abc_example_function');
```

#### add\_privs() – Grants user-groups privileges to a terminal option

[](#add_privs--grants-user-groups-privileges-to-a-terminal-option)

```
mixed add_privs(string $event, string $groups);
```

`add_privs()` is a standard Textpattern function. In Textpattern it’s used to grant permission. Rah\_terminal uses it for same thing, to grant users access to terminal options. This is to allow and limit from certain groups access to some terminals, while allowing access to others.

`$event` is the name of the “event” which the access is allowed, and `$groups` is comma-separated list of user-group numbers. Note that neither allow any whitespace.

Rah\_terminal’s events are prefixed with `rah_terminal.`. And terminal event name would consist of the prefix, followed by the terminal options name, given with the `add_terminal()` methods first parameter. For terminal option named as `abc_example`, add\_privs line would look like following:

```
add_privs('rah_terminal.abc_example', '1,2,3,4');
```

Changelog
---------

[](#changelog)

### Version 0.1.1 – 2013/05/07

[](#version-011--20130507)

- Composer package uses [textpattern/installer](https://packagist.org/packages/textpattern/installer) and [textpattern/lock](https://packagist.org/packages/textpattern/lock)

### Version 0.1.0 – 2013/04/24

[](#version-010--20130424)

- Initial release.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

2

Last Release

4801d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a34b4e1b662cd2c926e8e89a76f93df266b199fe61508d38026cb952f28e59e?d=identicon)[rah](/maintainers/rah)

---

Tags

plugintextpattern

### Embed Badge

![Health badge](/badges/rah-rah-terminal/health.svg)

```
[![Health](https://phpackages.com/badges/rah-rah-terminal/health.svg)](https://phpackages.com/packages/rah-rah-terminal)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
