mirror of
https://codeberg.org/vlw/scaffold.git
synced 2025-11-05 06:02:42 +01:00
refactor: add class for crosstalk between Vegvisir and Reflect (#4)
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
This commit is contained in:
parent
3cc4984b14
commit
5b5e9c45c6
1 changed files with 14 additions and 12 deletions
|
|
@ -5,13 +5,14 @@
|
||||||
use VV;
|
use VV;
|
||||||
use Reflect\Path;
|
use Reflect\Path;
|
||||||
|
|
||||||
|
class Scaffold {
|
||||||
/**
|
/**
|
||||||
* Include a source file from either Vegvisir or Reflect
|
* Include a source file
|
||||||
*
|
*
|
||||||
* @param string $pathname Relative path from project root to a source file
|
* @param string $pathname Relative path from project root to a source file
|
||||||
*/
|
*/
|
||||||
function load(string $pathname): void {
|
public static function load(string $pathname): void {
|
||||||
// Load the Vegvisir VV clas from Reflect
|
// Load the Vegvisir VV class from Reflect
|
||||||
if (!class_exists("VV")) {
|
if (!class_exists("VV")) {
|
||||||
require_once Path::root("vegvisir/src/kernel/Init.php");
|
require_once Path::root("vegvisir/src/kernel/Init.php");
|
||||||
require_once Path::root("vegvisir/src/request/VV.php");
|
require_once Path::root("vegvisir/src/request/VV.php");
|
||||||
|
|
@ -19,3 +20,4 @@
|
||||||
|
|
||||||
require_once VV::root($pathname);
|
require_once VV::root($pathname);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue