Browse Source

Moved the server startup to the "index.php" file

tags/v3.1.0
Cédric Belin 5 months ago
parent
commit
ca3e44d741
4 changed files with 8 additions and 5 deletions
  1. +1
    -1
      share/fast_transformer.http
  2. +1
    -1
      src/FastTransformer.php
  3. +0
    -3
      src/Server.php
  4. +6
    -0
      src/index.php

+ 1
- 1
share/fast_transformer.http View File

@@ -3,4 +3,4 @@
###

// Minifies the PHP code of the specified document.
GET {{baseUrl}}/Server.php?file=Server.php
GET {{baseUrl}}/?file=Server.php

+ 1
- 1
src/FastTransformer.php View File

@@ -73,7 +73,7 @@ class FastTransformer implements Transformer {
function transform(\SplFileInfo $script): string {
$address = static::address;
$file = rawurlencode((string) $script->getRealPath());
$request = $this->http->createRequest('GET', "http://$address:{$this->listen()}/Server.php?file=$file");
$request = $this->http->createRequest('GET', "http://$address:{$this->listen()}/?file=$file");
return $this->http->sendRequest($request)->getBody()->getContents();
}



+ 0
- 3
src/Server.php View File

@@ -60,6 +60,3 @@ class Server {
return $output;
}
}

// Start the application.
(new Server)->run($_GET);

+ 6
- 0
src/index.php View File

@@ -0,0 +1,6 @@
<?php declare(strict_types=1);
use Robo\PhpMinify\{Server};

// Start the application.
require_once __DIR__.'/Server.php';
(new Server)->run($_GET);

Loading…
Cancel
Save