mirror of
https://codeberg.org/vlw/scaffold.git
synced 2025-11-04 21:52:41 +01:00
Restores the class method approach for loading source files from #2, which undoes the changes introduced in #3. I can't figure out a way to make the function load before initialization of downstream classes. Reviewed-on: https://codeberg.org/vlw/scaffold/pulls/4
23 lines
506 B
PHP
23 lines
506 B
PHP
<?php
|
|
|
|
namespace vlw\Scaffold;
|
|
|
|
use VV;
|
|
use Reflect\Path;
|
|
|
|
class Scaffold {
|
|
/**
|
|
* Include a source file
|
|
*
|
|
* @param string $pathname Relative path from project root to a source file
|
|
*/
|
|
public static function load(string $pathname): void {
|
|
// Load the Vegvisir VV class from Reflect
|
|
if (!class_exists("VV")) {
|
|
require_once Path::root("vegvisir/src/kernel/Init.php");
|
|
require_once Path::root("vegvisir/src/request/VV.php");
|
|
}
|
|
|
|
require_once VV::root($pathname);
|
|
}
|
|
}
|