siteinfo regression with Zotlabs\Project - add an autoloader
This commit is contained in:
parent
4512a4cdd4
commit
5a7b994e59
19
boot.php
19
boot.php
@ -45,7 +45,6 @@ require_once('include/Contact.php');
|
|||||||
require_once('include/account.php');
|
require_once('include/account.php');
|
||||||
require_once('include/AccessList.php');
|
require_once('include/AccessList.php');
|
||||||
|
|
||||||
require_once('Zotlabs/Project/System.php');
|
|
||||||
|
|
||||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||||
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
|
define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
|
||||||
@ -625,6 +624,21 @@ function startup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class ZotlabsAutoloader {
|
||||||
|
static public function loader($className) {
|
||||||
|
$filename = str_replace('\\', '/', $className) . ".php";
|
||||||
|
if (file_exists($filename)) {
|
||||||
|
include($filename);
|
||||||
|
if (class_exists($className)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class: App
|
* class: App
|
||||||
*
|
*
|
||||||
@ -855,6 +869,9 @@ class App {
|
|||||||
$this->register_template_engine($k);
|
$this->register_template_engine($k);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spl_autoload_register('ZotlabsAutoloader::loader');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_baseurl($ssl = false) {
|
function get_baseurl($ssl = false) {
|
||||||
|
@ -15,7 +15,7 @@ function siteinfo_content(&$a) {
|
|||||||
$version = sprintf( t('Version %s'), Zotlabs\Project\System::get_project_version());
|
$version = sprintf( t('Version %s'), Zotlabs\Project\System::get_project_version());
|
||||||
if(@is_dir('.git') && function_exists('shell_exec')) {
|
if(@is_dir('.git') && function_exists('shell_exec')) {
|
||||||
$commit = @shell_exec('git log -1 --format="%h"');
|
$commit = @shell_exec('git log -1 --format="%h"');
|
||||||
$tag = get_std_version(); // @shell_exec('git describe --tags --abbrev=0');
|
$tag = Zotlabs\Project\System::get_std_version(); // @shell_exec('git describe --tags --abbrev=0');
|
||||||
}
|
}
|
||||||
if(! isset($commit) || strlen($commit) > 16)
|
if(! isset($commit) || strlen($commit) > 16)
|
||||||
$commit = '';
|
$commit = '';
|
||||||
|
Reference in New Issue
Block a user