PHPackages                             adnanhussainturki/unix-screen-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. adnanhussainturki/unix-screen-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

adnanhussainturki/unix-screen-php
=================================

Just a wrapper for Unix's screen in PHP

0.15(3y ago)1448[1 issues](https://github.com/AdnanHussainTurki/unix-screen-php/issues)MITPHP

Since Feb 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/AdnanHussainTurki/unix-screen-php)[ Packagist](https://packagist.org/packages/adnanhussainturki/unix-screen-php)[ Docs](https://www.myphpnotes.com)[ RSS](/packages/adnanhussainturki-unix-screen-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

[![Artboard 1](https://private-user-images.githubusercontent.com/24974673/284171879-4545afab-e643-4a4a-a773-07b4d022203b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMzAwMTYsIm5iZiI6MTc3NTAyOTcxNiwicGF0aCI6Ii8yNDk3NDY3My8yODQxNzE4NzktNDU0NWFmYWItZTY0My00YTRhLWE3NzMtMDdiNGQwMjIyMDNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAxVDA3NDgzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlMmEzOThiZGFjZGJhNjc5NWUwODFhOWY1Nzc1OWVjYzY2OTY0OGNmMDY2NzIwMjNhNmEzNWYwMDkyZWEwN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZjnY5jcAa5I_EwJcnMcSn1QbTBTDio6LosbwHqurVT8)](https://private-user-images.githubusercontent.com/24974673/284171879-4545afab-e643-4a4a-a773-07b4d022203b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUwMzAwMTYsIm5iZiI6MTc3NTAyOTcxNiwicGF0aCI6Ii8yNDk3NDY3My8yODQxNzE4NzktNDU0NWFmYWItZTY0My00YTRhLWE3NzMtMDdiNGQwMjIyMDNiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAxVDA3NDgzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTdlMmEzOThiZGFjZGJhNjc5NWUwODFhOWY1Nzc1OWVjYzY2OTY0OGNmMDY2NzIwMjNhNmEzNWYwMDkyZWEwN2ImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZjnY5jcAa5I_EwJcnMcSn1QbTBTDio6LosbwHqurVT8)

unix-screen-php
===============

[](#unix-screen-php)

The right-way to run shell commands or scripts right from the PHP script.

The package is exlcusively designed to be used with Laravel framework, but can also be used with Core PHP along with [Laravel's Eloquent](https://github.com/illuminate/database "Laravel's Eloquent")

### Tutorial Playlist

[](#tutorial-playlist)

Click to watch playlist on YouTube:

[![IMAGE ALT TEXT HERE](https://camo.githubusercontent.com/8aff2bbf36d14946d58c1afe81a0ab1338f584099b6867962ea90024af5206cc/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f7a526158753670545036592f302e6a7067)](https://www.youtube.com/playlist?list=PLC-R40l2hJffUVf3DBMqpqLaMQrw8-19M)

### Installation

[](#installation)

The package can be installed easily using [Composer](https://getcomposer.org/ "Composer") by executing the following command:

```
composer require adnanhussainturki/unix-screen-php

```

### Prerequisite

[](#prerequisite)

- Create model name `Process` using command `php artisan make:model Process`
- Create a new migration using command `php artisan make:migration create_process_table`
- Use the following code for migration: ```
    Schema::create('processes', function (Blueprint $table) {
    	$table->id();
    	$table->string("slug")->unique();
    	$table->integer("timeout")->default(30);
    	$table->integer("exitcode")->nullable();
    	$table->json("data");
    	$table->boolean("closed")->default(false);
    	$table->boolean("success")->nullable();
    	$table->dateTime("started_at");
    	$table->bigInteger("started_at_unix");
    	$table->text("remark")->nullable();
    	$table->timestamps();
    });

    ```

### Modes of execution

[](#modes-of-execution)

The package two modes of execution of commands or scripts:

- Synchronous Good for running short time-taking commands like `ls` or `uname` etc. Running the command or shell script and wait until the execution is completed. This method is *NOT RECOMMENDED* as it may invoke PHP timeout errors or Webserver timeout errors. Along with these, this method is not also so good for user experience.
- Asynchronous (Recommended) Great for running time-taking command or scripts like `top` or `cp` or `mv` etc.

### Create a Screen instance

[](#create-a-screen-instance)

```
