Maurits van der Schee 5 years ago
parent
commit
f4ea5cee23
2 changed files with 2 additions and 4 deletions
  1. 1
    1
      build.php
  2. 1
    3
      src/index.php

+ 1
- 1
build.php View File

@@ -49,7 +49,7 @@ function runDir(string $base, string $dir, array &$lines, array $ignore, array $
49 49
             $data = preg_replace('|/\*\*.*?\*/|s', '', $data);
50 50
             array_push($lines, "// file: $dir/$entry");
51 51
             foreach (explode("\n", $data) as $line) {
52
-                if (!preg_match('/^<\?php|^namespace |^use |spl_autoload_register|declare\s*\(\s*strict_types\s*=\s*1|^\s*\/\//', $line)) {
52
+                if (!preg_match('/^<\?php|^namespace |^use |vendor\/autoload|declare\s*\(\s*strict_types\s*=\s*1|^\s*\/\//', $line)) {
53 53
                     array_push($lines, $line);
54 54
                 }
55 55
             }

+ 1
- 3
src/index.php View File

@@ -4,9 +4,7 @@ use Tqdev\PhpCrudApi\Config;
4 4
 use Tqdev\PhpCrudApi\RequestFactory;
5 5
 use Tqdev\PhpCrudApi\ResponseUtils;
6 6
 
7
-// do not reformat the following line
8
-spl_autoload_register(function ($class) {include str_replace('\\', '/', __DIR__ . "/$class.php");});
9
-// as it is excluded in the build
7
+require '../vendor/autoload.php';
10 8
 
11 9
 $config = new Config([
12 10
     'username' => 'php-crud-api',

Loading…
Cancel
Save