mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 11:16:43 +02:00
chore: update CodeIgniter to v4.5.6
+ update php dependencies to latest
This commit is contained in:
parent
fc2e7a0d83
commit
f295e9aa4c
31 changed files with 85 additions and 116 deletions
|
|
@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||
namespace Modules\Admin\Controllers;
|
||||
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Config\Services;
|
||||
|
||||
class AboutController extends BaseController
|
||||
{
|
||||
|
|
@ -43,7 +42,7 @@ class AboutController extends BaseController
|
|||
|
||||
public function migrateDatabase(): RedirectResponse
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Analytics;
|
||||
|
||||
use Config\Services;
|
||||
|
||||
trait AnalyticsTrait
|
||||
{
|
||||
protected function registerPodcastWebpageHit(int $podcastId): void
|
||||
|
|
@ -28,7 +26,7 @@ trait AnalyticsTrait
|
|||
set_user_session_referer();
|
||||
set_user_session_entry_page();
|
||||
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->get('denyListIp')) {
|
||||
$db = db_connect();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||
*/
|
||||
|
||||
use AdAures\Ipcat\IpDb;
|
||||
use Config\Services;
|
||||
use GeoIp2\Database\Reader;
|
||||
use Opawg\UserAgentsV2Php\UserAgents;
|
||||
use WhichBrowser\Parser;
|
||||
|
|
@ -55,7 +54,7 @@ if (! function_exists('set_user_session_deny_list_ip')) {
|
|||
*/
|
||||
function set_user_session_deny_list_ip(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('denyListIp')) {
|
||||
$session->set('denyListIp', IpDb::find(client_ip()) !== null);
|
||||
|
|
@ -69,7 +68,7 @@ if (! function_exists('set_user_session_location')) {
|
|||
*/
|
||||
function set_user_session_location(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$location = [
|
||||
'countryCode' => 'N/A',
|
||||
|
|
@ -105,7 +104,7 @@ if (! function_exists('set_user_session_player')) {
|
|||
*/
|
||||
function set_user_session_player(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('player')) {
|
||||
$playerFound = null;
|
||||
|
|
@ -148,7 +147,7 @@ if (! function_exists('set_user_session_browser')) {
|
|||
*/
|
||||
function set_user_session_browser(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
if (! $session->has('browser')) {
|
||||
$browserName = '- Other -';
|
||||
|
|
@ -174,7 +173,7 @@ if (! function_exists('set_user_session_referer')) {
|
|||
*/
|
||||
function set_user_session_referer(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$newreferer = service('superglobals')
|
||||
->server('HTTP_REFERER') ?? '- Direct -';
|
||||
|
|
@ -195,7 +194,7 @@ if (! function_exists('set_user_session_entry_page')) {
|
|||
*/
|
||||
function set_user_session_entry_page(): void
|
||||
{
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$entryPage = service('superglobals')
|
||||
->server('REQUEST_URI');
|
||||
|
|
@ -238,7 +237,7 @@ if (! function_exists('podcast_hit')) {
|
|||
string $serviceName,
|
||||
?int $subscriptionId,
|
||||
): void {
|
||||
$session = Services::session();
|
||||
$session = service('session');
|
||||
|
||||
$clientIp = client_ip();
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ use CodeIgniter\API\ResponseTrait;
|
|||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Modules\Api\Rest\V1\Config\Services;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
|
||||
class EpisodeController extends Controller
|
||||
|
|
@ -24,7 +23,7 @@ class EpisodeController extends Controller
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
Services::restApiExceptions()->initialize();
|
||||
service('restApiExceptions')->initialize();
|
||||
}
|
||||
|
||||
public function list(): ResponseInterface
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use App\Models\PodcastModel;
|
|||
use CodeIgniter\API\ResponseTrait;
|
||||
use CodeIgniter\Controller;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Modules\Api\Rest\V1\Config\Services;
|
||||
|
||||
class PodcastController extends Controller
|
||||
{
|
||||
|
|
@ -17,7 +16,7 @@ class PodcastController extends Controller
|
|||
|
||||
public function __construct()
|
||||
{
|
||||
Services::restApiExceptions()->initialize();
|
||||
service('restApiExceptions')->initialize();
|
||||
}
|
||||
|
||||
public function list(): ResponseInterface
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use Closure;
|
|||
use CodeIgniter\CLI\BaseCommand;
|
||||
use CodeIgniter\CLI\CLI;
|
||||
use CodeIgniter\View\Table;
|
||||
use Config\Services;
|
||||
use League\HTMLToMarkdown\Converter\TableConverter;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
use Modules\Auth\Config\AuthGroups;
|
||||
|
|
@ -59,8 +58,8 @@ class RolesDoc extends BaseCommand
|
|||
|
||||
foreach ($files as $file) {
|
||||
$locale = $this->detectLocaleFromPath($file);
|
||||
$language = Services::language();
|
||||
$language->setLocale($locale);
|
||||
service('language')
|
||||
->setLocale($locale);
|
||||
|
||||
$authGroups = new AuthGroups();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use App\Models\PodcastModel;
|
|||
use CodeIgniter\Filters\FilterInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Config\Services;
|
||||
use Override;
|
||||
use RuntimeException;
|
||||
|
||||
|
|
@ -62,7 +61,7 @@ class PermissionFilter implements FilterInterface
|
|||
foreach ($arguments as $permission) {
|
||||
// is permission specific to a podcast?
|
||||
if (str_contains($permission, '$')) {
|
||||
$router = Services::router();
|
||||
$router = service('router');
|
||||
$routerParams = $router->params();
|
||||
|
||||
if (! preg_match('/\$(\d+)\./', $permission, $match)) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ use CodeIgniter\HTTP\CURLRequest;
|
|||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\Services;
|
||||
use Modules\Fediverse\Core\Activity;
|
||||
use phpseclib\Crypt\RSA;
|
||||
|
||||
|
|
@ -33,7 +32,7 @@ class ActivityRequest
|
|||
|
||||
public function __construct(string $uri, ?string $activityPayload = null)
|
||||
{
|
||||
$this->request = Services::curlrequest();
|
||||
$this->request = service('curlrequest');
|
||||
|
||||
if ($activityPayload !== null) {
|
||||
$this->request->setBody($activityPayload);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ use CodeIgniter\Filters\FilterInterface;
|
|||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\URI;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use Modules\Fediverse\HttpSignature;
|
||||
use Override;
|
||||
|
|
@ -33,7 +32,7 @@ class FediverseFilter implements FilterInterface
|
|||
}
|
||||
|
||||
if (in_array('verify-activitystream', $params, true)) {
|
||||
$negotiate = Services::negotiator();
|
||||
$negotiate = service('negotiator');
|
||||
|
||||
$allowedContentTypes = [
|
||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams',
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ namespace Modules\Fediverse;
|
|||
|
||||
use CodeIgniter\HTTP\IncomingRequest;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use phpseclib\Crypt\RSA;
|
||||
|
||||
|
|
@ -40,7 +39,7 @@ class HttpSignature
|
|||
public function __construct(IncomingRequest $request = null)
|
||||
{
|
||||
if (! $request instanceof IncomingRequest) {
|
||||
$request = Services::request();
|
||||
$request = service('request');
|
||||
}
|
||||
|
||||
$this->request = $request;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ namespace Modules\Install\Commands;
|
|||
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use Config\Database;
|
||||
use Config\Services;
|
||||
use Override;
|
||||
|
||||
class InitDatabase extends BaseCommand
|
||||
|
|
@ -30,7 +29,7 @@ class InitDatabase extends BaseCommand
|
|||
public function run(array $params): void
|
||||
{
|
||||
// Run all migrations
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ use CodeIgniter\HTTP\ResponseInterface;
|
|||
use CodeIgniter\Shield\Entities\User;
|
||||
use CodeIgniter\Shield\Exceptions\ValidationException as ShieldValidationException;
|
||||
use Config\Database;
|
||||
use Config\Services;
|
||||
use Dotenv\Dotenv;
|
||||
use Dotenv\Exception\ValidationException;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
|
|
@ -247,7 +246,7 @@ class InstallController extends Controller
|
|||
*/
|
||||
public function migrate(): void
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ declare(strict_types=1);
|
|||
namespace Modules\Media\Entities;
|
||||
|
||||
use CodeIgniter\Files\File;
|
||||
use Config\Services;
|
||||
use GdImage;
|
||||
use Override;
|
||||
|
||||
|
|
@ -140,7 +139,7 @@ class Image extends BaseMedia
|
|||
}
|
||||
|
||||
// save derived sizes
|
||||
$imageService = Services::image();
|
||||
$imageService = service('image');
|
||||
|
||||
foreach ($this->sizes as $name => $size) {
|
||||
$tempFilePath = tempnam(WRITEPATH . 'temp', 'img_');
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ use App\Entities\Podcast;
|
|||
use App\Models\PodcastModel;
|
||||
use CodeIgniter\Exceptions\PageNotFoundException;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use Config\Services;
|
||||
use Modules\Admin\Controllers\BaseController;
|
||||
use Modules\Platforms\Models\PlatformModel;
|
||||
|
||||
|
|
@ -65,7 +64,7 @@ class PlatformController extends BaseController
|
|||
public function updateAction(string $platformType): RedirectResponse
|
||||
{
|
||||
$platformModel = new PlatformModel();
|
||||
$validation = Services::validation();
|
||||
$validation = service('validation');
|
||||
|
||||
$platformsData = [];
|
||||
foreach (
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ use CodeIgniter\CLI\BaseCommand;
|
|||
use CodeIgniter\CLI\CLI;
|
||||
use CodeIgniter\I18n\Time;
|
||||
use CodeIgniter\Shield\Entities\User;
|
||||
use Config\Services;
|
||||
use Exception;
|
||||
use League\HTMLToMarkdown\HtmlConverter;
|
||||
use Modules\Auth\Models\UserModel;
|
||||
|
|
@ -96,7 +95,8 @@ class PodcastImport extends BaseCommand
|
|||
public function run(array $params): void
|
||||
{
|
||||
// FIXME: getting named routes doesn't work from v4.3 anymore, so loading all routes before importing
|
||||
Services::routes()->loadRoutes();
|
||||
service('routes')
|
||||
->loadRoutes();
|
||||
|
||||
try {
|
||||
$this->init();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Modules\Update\Commands;
|
||||
|
||||
use CodeIgniter\CLI\BaseCommand;
|
||||
use Config\Services;
|
||||
use Override;
|
||||
|
||||
class DatabaseUpdate extends BaseCommand
|
||||
|
|
@ -28,7 +27,7 @@ class DatabaseUpdate extends BaseCommand
|
|||
#[Override]
|
||||
public function run(array $params): void
|
||||
{
|
||||
$migrate = Services::migrations();
|
||||
$migrate = service('migrations');
|
||||
|
||||
$migrate->setNamespace(null)
|
||||
->latest();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue