PHP code example of whispphp / whisp
1. Go to this page and download the library: Download whispphp/whisp 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/ */
whispphp / whisp example snippets
// Setup server port & IP
$server = new Whisp\Server(port: 2222);
// Then, add your apps in 1 of 3 ways: auto discovery, array, or string
// Auto-discovery - we'll find all apps in the 'apps' directory and make them available
$server->run();
// Array
$server->run(apps: [
'default' => 'full-path/howdy.php',
'guestbook' => 'full-path/guestbook.php',
'chat-{roomName}' => 'full-path/chat.php',
]);
// String - set the default script that's always ran
$server->run('full-path/howdy.php');