PHP code example of monomelodies / hangman

1. Go to this page and download the library: Download monomelodies/hangman library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

monomelodies / hangman example snippets




use Monomelodies\Hangman\{ Executioner, FakeExecutioner, Executable };

function setExecutioner() : Executable
{
    if (shouldActuallyRunCommands()) {
        $executioner = new Executioner;
    } else {
        $executioner = new FakeExecutioner;
    }
    return $executioner;
}

$executioner = setExecutioner();
$executioner->exec('some/command');



$executioner
    ->exec('ls')
    ->passthru('ls')
    ->chdir('some/path')
    ->system('ls')
    ->chdir();