Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7949795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:04:48+00:00 2026-06-04T02:04:48+00:00

I want to write a small management tool to oversee my server processes, my

  • 0

I want to write a small management tool to oversee my server processes, my problem is now, how could i wait for user input and at same time update the screen with current stats? Is it even possible with PHP-CLI or are there any tricks for doing this I missing currently?

I have looked into newt and ncurses PECL extensions but both doesn’t seem to fit my needs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:04:50+00:00Added an answer on June 4, 2026 at 2:04 am

    Go for libevent http://www.php.net/manual/en/book.libevent.php

    You can run your main loop while listening to console with a code roughly like this one:

    <?php   
    // you need libevent, installable via PEAR
    $forever=true;
    $base=event_base_new();
    $console=event_buffer_new(STDIN,"process_console");
    event_buffer_base_set($console,$base);
    event_buffer_enable($console,EV_READ);
    while ($forever) {
        event_base_loop($base,EVLOOP_NONBLOCK); // Non blocking poll to console listener
        //Do your video update process
    }
    event_base_free($base); //Cleanup
    function process_console($buffer,$id) {
        global $base;
        global $forever;
        $message='';
        while ($read = event_buffer_read($buffer, 256)) {
            $message.=$read;
        }
        $message=trim($message);
        print("[$message]\n");
        if ($message=="quit") {
            event_base_loopexit($base);
            $forever=false;
        }
        else {
            //whatever.....
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a small tool, that does the following: When you right
I want to write a small reporting tool and looking to fetch data from
I want to write a small bit of data from my app to the
HI, I want to write a small Delphi IDE Expert for D2007-D2009 (aka. Galileo
i want to create functions what get the folder size. I write small function:
I want to write an NSOutputStream to a server with apple's sample code: NSURL
I want to write a small program with help of ffmpeg. I want to
I want to write a small backup script that would take my shelf changes
I'm trying to write a small snippet of jQuery that validates my input fields.
I want to write small class with some methods, which actualy belongs to other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.