📁
SKYSHELL MANAGER
PHP v8.2.31
Create
Create
Path:
root
/
home
/
thevaxnx
/
nativize.com
/
staging
/
wp-includes
/
js
/
tinymce
/
themes
/
Name
Size
Perm
Actions
📁
inlite
-
0755
🗑️
🏷️
🔒
📁
modern
-
0755
🗑️
🏷️
🔒
📄
wp-links-opml.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: SyncCertsCommand.php
<?php namespace App\Command; use App\Entity\User; use App\Service\Certificate\SyncCertificate; use App\Service\State\StateUser; use App\Repository\UserRepository; use Doctrine\ORM\EntityManagerInterface; use Exception; use Psr\Log\LoggerInterface; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use App\Traits\MessageFormatterTrait; #[AsCommand( name: 'app:sync-certs', description: 'Synchronize certificates with an RCC', )] class SyncCertsCommand extends Command { use MessageFormatterTrait; public function __construct( private readonly LoggerInterface $syncLogger, private readonly EntityManagerInterface $entityManager, private readonly StateUser $stateUser, private readonly SyncCertificate $syncCertificate, ){ parent::__construct(); } protected function configure(): void { $this ->setHelp('Usage: <info>/usr/local/cpanel/3rdparty/bin/php /usr/local/cpanel/whostmgr/cgi/ncssl/source/bin/console app:sync-certs</info>'); } /** * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $output->write($this->prepareMessage('Syncing certificates with Namecheap started...', self::MSG_TYPE_INFO)); /** @var UserRepository $userRepository */ $userRepository = $this->entityManager->getRepository(User::class); $users = $userRepository->findUsersForSync(); foreach ($users as $user) { $this->stateUser->setUser($user); try { $this->syncCertificate->synchronizeCertificates(); } catch (\Throwable $throwable) { $this->syncLogger->error('Failed to sync certificates for user', [ 'username' => $user->getName(), 'ncLogin' => $user->getNcLogin(), 'errorMessage' => $throwable->getMessage(), 'errorTrace' => $throwable->getTrace() ]); } } $output->write($this->prepareMessage('Syncing certificates with Namecheap was end...', self::MSG_TYPE_INFO)); return Command::SUCCESS; } }
Save