add settings namespace

This commit is contained in:
ghost 2023-09-14 16:40:55 +03:00
parent d0f13d0439
commit 2cc0bd71e9
2 changed files with 24 additions and 23 deletions

View File

@ -127,21 +127,22 @@ define('NODE_RULE_LANGUAGES', 'All');
// API // API
define('API_VERSION', 1); define('API_VERSION', 1);
/// Export
define('API_EXPORT_ENABLED', true); define('API_EXPORT_ENABLED', true);
define('API_EXPORT_USERS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_USERS_ENABLED', true); // depends of API_EXPORT_ENABLED
define('API_EXPORT_MAGNETS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_MAGNETS_ENABLED', true); // depends of API_EXPORT_ENABLED
define('API_EXPORT_DOWNLOADS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_MAGNET_DOWNLOADS_ENABLED', true); // depends of API_EXPORT_ENABLED
define('API_EXPORT_COMMENTS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_MAGNET_COMMENTS_ENABLED', true); // depends of API_EXPORT_ENABLED
define('API_EXPORT_STARS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_MAGNET_STARS_ENABLED', true); // depends of API_EXPORT_ENABLED
define('API_EXPORT_VIEWS_ENABLED', true); // depends of API_EXPORT_ENABLED define('API_EXPORT_MAGNET_VIEWS_ENABLED', true); // depends of API_EXPORT_ENABLED
/// Import
define('API_IMPORT_ENABLED', true); define('API_IMPORT_ENABLED', true);
define('API_IMPORT_USERS_ENABLED', true); // depends of API_IMPORT_ENABLED define('API_IMPORT_USERS_ENABLED', true); // depends of API_IMPORT_ENABLED
define('API_IMPORT_MAGNETS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED define('API_IMPORT_MAGNETS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED
define('API_IMPORT_DOWNLOADS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED define('API_IMPORT_MAGNET_DOWNLOADS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
define('API_IMPORT_COMMENTS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED define('API_IMPORT_MAGNET_COMMENTS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
define('API_IMPORT_STARS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED define('API_IMPORT_MAGNET_STARS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED
define('API_IMPORT_VIEWS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED define('API_IMPORT_MAGNET_VIEWS_ENABLED', true); // depends of API_IMPORT_ENABLED, API_IMPORT_USERS_ENABLED, API_IMPORT_MAGNETS_ENABLED

View File

@ -93,10 +93,10 @@ try
'users' => API_EXPORT_USERS_ENABLED ? sprintf('%s/api/users.json', WEBSITE_URL) : false, 'users' => API_EXPORT_USERS_ENABLED ? sprintf('%s/api/users.json', WEBSITE_URL) : false,
'magnets' => API_EXPORT_MAGNETS_ENABLED ? sprintf('%s/api/magnets.json', WEBSITE_URL) : false, 'magnets' => API_EXPORT_MAGNETS_ENABLED ? sprintf('%s/api/magnets.json', WEBSITE_URL) : false,
'downloads' => API_EXPORT_DOWNLOADS_ENABLED ? sprintf('%s/api/downloads.json', WEBSITE_URL) : false, 'downloads' => API_EXPORT_MAGNET_DOWNLOADS_ENABLED ? sprintf('%s/api/downloads.json', WEBSITE_URL) : false,
'comments' => API_EXPORT_COMMENTS_ENABLED ? sprintf('%s/api/comments.json', WEBSITE_URL) : false, 'comments' => API_EXPORT_MAGNET_COMMENTS_ENABLED ? sprintf('%s/api/comments.json', WEBSITE_URL) : false,
'stars' => API_EXPORT_STARS_ENABLED ? sprintf('%s/api/stars.json', WEBSITE_URL) : false, 'stars' => API_EXPORT_MAGNET_STARS_ENABLED ? sprintf('%s/api/stars.json', WEBSITE_URL) : false,
'views' => API_EXPORT_VIEWS_ENABLED ? sprintf('%s/api/views.json', WEBSITE_URL) : false, 'views' => API_EXPORT_MAGNET_VIEWS_ENABLED ? sprintf('%s/api/views.json', WEBSITE_URL) : false,
'totals' => 'totals' =>
[ [
@ -323,7 +323,7 @@ try
} }
// Downloads // Downloads
if (API_EXPORT_DOWNLOADS_ENABLED) if (API_EXPORT_MAGNET_DOWNLOADS_ENABLED)
{ {
$downloads = []; $downloads = [];
@ -352,7 +352,7 @@ try
} }
// Comments // Comments
if (API_EXPORT_COMMENTS_ENABLED) if (API_EXPORT_MAGNET_COMMENTS_ENABLED)
{ {
$comments = []; $comments = [];
@ -381,7 +381,7 @@ try
} }
// Stars // Stars
if (API_EXPORT_STARS_ENABLED) if (API_EXPORT_MAGNET_STARS_ENABLED)
{ {
$stars = []; $stars = [];
@ -410,7 +410,7 @@ try
} }
} }
// Views // Views
if (API_EXPORT_VIEWS_ENABLED) if (API_EXPORT_MAGNET_VIEWS_ENABLED)
{ {
$views = []; $views = [];