mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 03:23:41 +02:00
Core functions compartmentalized
This commit is contained in:
parent
b08169fe88
commit
9526e7bf52
4 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once dirname(__DIR__,1)."/src/Globals.php";
|
|
||||||
|
|
||||||
class APIRouter {
|
class APIRouter {
|
||||||
public function __construct($path) {
|
public function __construct($path) {
|
||||||
// List of implemented API services
|
// List of implemented API services
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Import {
|
class Import {
|
||||||
|
// Import assets from disk
|
||||||
public static function file($file) {
|
public static function file($file) {
|
||||||
$content = file_get_contents($file);
|
$content = file_get_contents($file);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Import JSON to PHP list
|
||||||
public static function json($file) {
|
public static function json($file) {
|
||||||
$contents = Import::file($file);
|
$contents = Import::file($file);
|
||||||
$json = json_decode($contents);
|
$json = json_decode($contents);
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
include_once dirname(__DIR__,1)."/Globals.php";
|
include_once dirname(__DIR__,1)."/core/Import.php";
|
||||||
|
|
||||||
class Database extends mysqli {
|
class Database extends mysqli {
|
||||||
public function __construct($table) {
|
public function __construct($table) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once dirname(__DIR__,1)."/Globals.php";
|
require_once dirname(__DIR__,1)."/core/Import.php";
|
||||||
require_once dirname(__DIR__,1)."/database/Database.php";
|
require_once dirname(__DIR__,1)."/database/Database.php";
|
||||||
|
|
||||||
class Search extends Database {
|
class Search extends Database {
|
||||||
|
|
Loading…
Add table
Reference in a new issue