mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:55:15 +00:00
rename some base constants
This commit is contained in:
parent
6d36d10f29
commit
d0f89bf99e
9 changed files with 22 additions and 29 deletions
|
@ -419,7 +419,7 @@ class Channel
|
||||||
|
|
||||||
// The site channel gets the project logo as a profile photo.
|
// The site channel gets the project logo as a profile photo.
|
||||||
if ($arr['account_id'] === 'xxx') {
|
if ($arr['account_id'] === 'xxx') {
|
||||||
$photo_type = import_channel_photo_from_url(z_root() . '/images/' . PLATFORM_NAME . '.png', 0, $r[0]['channel_id']);
|
$photo_type = import_channel_photo_from_url(z_root() . '/images/' . REPOSITORY_ID . '.png', 0, $r[0]['channel_id']);
|
||||||
}
|
}
|
||||||
elseif ($z['photo_url']) {
|
elseif ($z['photo_url']) {
|
||||||
$photo_type = import_channel_photo_from_url($z['photo_url'], $arr['account_id'], $r[0]['channel_id']);
|
$photo_type = import_channel_photo_from_url($z['photo_url'], $arr['account_id'], $r[0]['channel_id']);
|
||||||
|
@ -938,7 +938,7 @@ class Channel
|
||||||
// with a non-standard platform and version.
|
// with a non-standard platform and version.
|
||||||
|
|
||||||
$ret['compatibility'] = [
|
$ret['compatibility'] = [
|
||||||
'project' => PLATFORM_NAME,
|
'project' => REPOSITORY_ID,
|
||||||
'codebase' => 'zap',
|
'codebase' => 'zap',
|
||||||
'schema' => 'streams',
|
'schema' => 'streams',
|
||||||
'version' => STD_VERSION,
|
'version' => STD_VERSION,
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Enotify
|
||||||
push_lang($recip['account_language']); // should probably have a channel language
|
push_lang($recip['account_language']); // should probably have a channel language
|
||||||
|
|
||||||
$banner = t('$Projectname Notification');
|
$banner = t('$Projectname Notification');
|
||||||
$product = t('$projectname'); // PLATFORM_NAME;
|
$product = t('$projectname'); // REPOSITORY_ID;
|
||||||
$siteurl = z_root();
|
$siteurl = z_root();
|
||||||
$thanks = t('Thank You,');
|
$thanks = t('Thank You,');
|
||||||
$sitename = get_config('system', 'sitename');
|
$sitename = get_config('system', 'sitename');
|
||||||
|
|
|
@ -2486,7 +2486,7 @@ class Libzot
|
||||||
'sitekey' => $hub['hubloc_sitekey'],
|
'sitekey' => $hub['hubloc_sitekey'],
|
||||||
'deleted' => (intval($hub['hubloc_deleted']) ? true : false)
|
'deleted' => (intval($hub['hubloc_deleted']) ? true : false)
|
||||||
];
|
];
|
||||||
if ($hub['hubloc_url'] === z_root() && version_compare(ZOT_REVISION, '11.0') >= 0) {
|
if ($hub['hubloc_url'] === z_root() && version_compare(NOMAD_PROTOCOL_VERSION, '11.0') >= 0) {
|
||||||
$tmp['driver'] = 'nomad';
|
$tmp['driver'] = 'nomad';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class System
|
||||||
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('platform_name', App::$config['system'])) {
|
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('platform_name', App::$config['system'])) {
|
||||||
return App::$config['system']['platform_name'];
|
return App::$config['system']['platform_name'];
|
||||||
}
|
}
|
||||||
return PLATFORM_NAME;
|
return REPOSITORY_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_site_name(): string
|
public static function get_site_name(): string
|
||||||
|
@ -58,7 +58,7 @@ class System
|
||||||
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('icon', App::$config['system'])) {
|
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('icon', App::$config['system'])) {
|
||||||
return App::$config['system']['icon'];
|
return App::$config['system']['icon'];
|
||||||
}
|
}
|
||||||
return z_root() . '/images/' . PLATFORM_NAME . '-64.png';
|
return z_root() . '/images/' . REPOSITORY_ID . '-64.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_project_favicon()
|
public static function get_project_favicon()
|
||||||
|
@ -66,7 +66,7 @@ class System
|
||||||
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('favicon', App::$config['system'])) {
|
if (is_array(App::$config) && is_array(App::$config['system']) && array_key_exists('favicon', App::$config['system'])) {
|
||||||
return App::$config['system']['favicon'];
|
return App::$config['system']['favicon'];
|
||||||
}
|
}
|
||||||
return z_root() . '/images/' . PLATFORM_NAME . '.ico';
|
return z_root() . '/images/' . REPOSITORY_ID . '.ico';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,13 +117,13 @@ class System
|
||||||
return App::$config['system']['project_srclink'];
|
return App::$config['system']['project_srclink'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'https://codeberg.org/streams/' . PLATFORM_NAME;
|
return 'https://codeberg.org/streams/' . REPOSITORY_ID;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get_zot_revision()
|
public static function get_zot_revision()
|
||||||
{
|
{
|
||||||
$x = [ 'revision' => ZOT_REVISION ];
|
$x = [ 'revision' => NOMAD_PROTOCOL_VERSION ];
|
||||||
Hook::call('zot_revision', $x);
|
Hook::call('zot_revision', $x);
|
||||||
return $x['revision'];
|
return $x['revision'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@ class Import extends Controller
|
||||||
foreach ($xchans as $xchan) {
|
foreach ($xchans as $xchan) {
|
||||||
// Provide backward compatibility for zot11 based projects
|
// Provide backward compatibility for zot11 based projects
|
||||||
|
|
||||||
if ($xchan['xchan_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) {
|
if ($xchan['xchan_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) {
|
||||||
$xchan['xchan_network'] = 'zot6';
|
$xchan['xchan_network'] = 'zot6';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,10 @@ class Portfolio implements WidgetInterface
|
||||||
|
|
||||||
public function widget(array $arguments): string
|
public function widget(array $arguments): string
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$owner_uid = App::$profile_uid;
|
$owner_uid = App::$profile_uid;
|
||||||
$sql_extra = permissions_sql($owner_uid);
|
$sql_extra = permissions_sql($owner_uid);
|
||||||
|
$album = '';
|
||||||
|
$title = '';
|
||||||
|
|
||||||
if (!perm_is_allowed($owner_uid, get_observer_hash(), 'view_storage')) {
|
if (!perm_is_allowed($owner_uid, get_observer_hash(), 'view_storage')) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -118,7 +117,7 @@ class Portfolio implements WidgetInterface
|
||||||
'$photos' => $photos,
|
'$photos' => $photos,
|
||||||
'$mode' => $mode,
|
'$mode' => $mode,
|
||||||
'$count' => $count,
|
'$count' => $count,
|
||||||
'$album' => (($title) ? $title : $album),
|
'$album' => (($title) ?: $album),
|
||||||
'$album_id' => rand(),
|
'$album_id' => rand(),
|
||||||
'$album_edit' => [t('Edit Album'), $album_edit],
|
'$album_edit' => [t('Edit Album'), $album_edit],
|
||||||
'$can_post' => false,
|
'$can_post' => false,
|
||||||
|
|
18
boot.php
18
boot.php
|
@ -26,17 +26,11 @@ use Code\Lib\Url;
|
||||||
|
|
||||||
require_once('version.php');
|
require_once('version.php');
|
||||||
|
|
||||||
define ( 'PLATFORM_NAME', 'streams' );
|
const REPOSITORY_ID = 'streams';
|
||||||
|
const DB_UPDATE_VERSION = 1262;
|
||||||
define ( 'DB_UPDATE_VERSION', 1262 );
|
const PROJECT_BASE = __DIR__;
|
||||||
define ( 'ZOT_REVISION', '11.0' );
|
const ACTIVITYPUB_ENABLED = true;
|
||||||
|
const NOMAD_PROTOCOL_VERSION = '11.0';
|
||||||
define ( 'PLATFORM_ARCHITECTURE', 'zap' );
|
|
||||||
|
|
||||||
define ( 'PROJECT_BASE', __DIR__ );
|
|
||||||
|
|
||||||
define ( 'ACTIVITYPUB_ENABLED', true );
|
|
||||||
|
|
||||||
|
|
||||||
// composer autoloader for all namespaced Classes
|
// composer autoloader for all namespaced Classes
|
||||||
require_once('vendor/autoload.php');
|
require_once('vendor/autoload.php');
|
||||||
|
@ -1147,7 +1141,7 @@ class App {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! x(self::$page,'title')) {
|
if (! x(self::$page,'title')) {
|
||||||
self::$page['title'] = ucfirst(App::$module) . ' | ' . ((array_path_exists('system/sitename',self::$config)) ? self::$config['system']['sitename'] : PLATFORM_NAME);
|
self::$page['title'] = ucfirst(App::$module) . ' | ' . ((array_path_exists('system/sitename',self::$config)) ? self::$config['system']['sitename'] : REPOSITORY_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! self::$meta->get_field('og:title')) {
|
if (! self::$meta->get_field('og:title')) {
|
||||||
|
|
|
@ -385,7 +385,7 @@ function import_xchans($xchans) {
|
||||||
foreach ($xchans as $xchan) {
|
foreach ($xchans as $xchan) {
|
||||||
// Provide backward compatibility for zot11 based projects
|
// Provide backward compatibility for zot11 based projects
|
||||||
|
|
||||||
if ($xchan['xchan_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) {
|
if ($xchan['xchan_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) {
|
||||||
$xchan['xchan_network'] = 'zot6';
|
$xchan['xchan_network'] = 'zot6';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ function import_hublocs($channel, $hublocs, $seize, $moving = false)
|
||||||
foreach ($hublocs as $hubloc) {
|
foreach ($hublocs as $hubloc) {
|
||||||
// Provide backward compatibility for zot11 based projects
|
// Provide backward compatibility for zot11 based projects
|
||||||
|
|
||||||
if ($hubloc['hubloc_network'] === 'nomad' && version_compare(ZOT_REVISION, '10.0') <= 0) {
|
if ($hubloc['hubloc_network'] === 'nomad' && version_compare(NOMAD_PROTOCOL_VERSION, '10.0') <= 0) {
|
||||||
$hubloc['hubloc_network'] = 'zot6';
|
$hubloc['hubloc_network'] = 'zot6';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1098,7 +1098,7 @@ function deliverable_singleton($channel_id, $xchan)
|
||||||
|
|
||||||
function get_repository_version($branch = 'release')
|
function get_repository_version($branch = 'release')
|
||||||
{
|
{
|
||||||
$path = 'https://raw.codeberg.page/streams/' . PLATFORM_NAME . "/@$branch/version.php";
|
$path = 'https://raw.codeberg.page/streams/' . REPOSITORY_ID . "/@$branch/version.php";
|
||||||
|
|
||||||
$x = Url::get($path);
|
$x = Url::get($path);
|
||||||
if ($x['success']) {
|
if ($x['success']) {
|
||||||
|
|
Loading…
Reference in a new issue