mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 03:06:43 +02:00
refactor: add phpstan and update code to adhere to level 5
- move and refactor Image.php from Libraries to Entities folder - update some database field names / types - update composer packages
This commit is contained in:
parent
b691b927fe
commit
231d578d64
148 changed files with 11189 additions and 11421 deletions
42
app/Controllers/ActorController.php
Normal file
42
app/Controllers/ActorController.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright 2020 Podlibre
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use ActivityPub\Controllers\ActorController as ActivityPubActorController;
|
||||
use Analytics\AnalyticsTrait;
|
||||
|
||||
class ActorController extends ActivityPubActorController
|
||||
{
|
||||
use AnalyticsTrait;
|
||||
|
||||
protected $helpers = ['auth', 'svg', 'components', 'misc'];
|
||||
|
||||
public function follow()
|
||||
{
|
||||
// Prevent analytics hit when authenticated
|
||||
if (!can_user_interact()) {
|
||||
$this->registerPodcastWebpageHit($this->actor->podcast->id);
|
||||
}
|
||||
|
||||
$cacheName = "page_podcast-{$this->actor->username}_follow";
|
||||
if (!($cachedView = cache($cacheName))) {
|
||||
helper(['form', 'components', 'svg']);
|
||||
$data = [
|
||||
'actor' => $this->actor,
|
||||
];
|
||||
|
||||
return view('podcast/follow', $data, [
|
||||
'cache' => DECADE,
|
||||
'cache_name' => $cacheName,
|
||||
]);
|
||||
}
|
||||
|
||||
return $cachedView;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue