PHP code example of monkeyscloud / monkeyslegion-dev-server
1. Go to this page and download the library: Download monkeyscloud/monkeyslegion-dev-server 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/ */
monkeyscloud / monkeyslegion-dev-server example snippets
use MonkeysLegion\DevServer\DevServer;
// Start server
$server = new DevServer();
$server->serve('127.0.0.1', 8000);
// Stop server
DevServer::stop();
// Restart server
DevServer::restart('127.0.0.1', 8000);
// Check status
DevServer::status();
$server = new DevServer();
$server->serve('127.0.0.1', 8000, null, true); // Force FileWatcher
$server = new DevServer();
$server->serve('127.0.0.1', 8000, '/path/to/docroot');
// Or relative to project root
$server->serve('127.0.0.1', 8000, 'web');
// Find this section:
$paths = "find app public resources config -type f 2>/dev/null";
// Customize to watch different directories:
$paths = "find app src templates public -type f 2>/dev/null";
$server = new DevServer();
$server->serve('0.0.0.0', 3000, 'web');