Skip to content

Instantly share code, notes, and snippets.

@paveltretyakovru
Created August 6, 2018 22:16
Show Gist options
  • Save paveltretyakovru/b211efc0e6d246aceba9be8d9671ba33 to your computer and use it in GitHub Desktop.
Save paveltretyakovru/b211efc0e6d246aceba9be8d9671ba33 to your computer and use it in GitHub Desktop.
PHP terminal application with a i/o fuctionality
<?php
echo "Welcome to the OZ-TZ init script \n";
$f_db_host = fopen ("php://stdin","r");
$f_db_dbname = fopen ("php://stdin","r");
$f_db_username = fopen ("php://stdin","r");
$f_db_userpassword = fopen ("php://stdin","r");
echo "Type DB host: ";
$db_host = fgets($f_db_host);
echo "\n";
echo "Type DB name: ";
$db_dbname = fgets($f_db_dbname);
echo "\n";
echo "Type DB user name: ";
$db_username = fgets($f_db_username);
echo "\n";
echo "Type DB user password: ";
$db_userpassword = fgets($f_db_userpassword);
echo "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment