app\CertificateHandler::getAll PHP Method

getAll() public method

public getAll ( ) : Certificate[]
return Certificate[]
    public function getAll()
    {
        $certificates = [];
        foreach (glob('/data/*') as $path) {
            if (!is_dir($path) || basename($path) == "_account") {
                continue;
            }
            $name = basename($path);
            $certificates[] = new Certificate($name);
        }
        return $certificates;
    }

Usage Example

コード例 #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $ch = new CertificateHandler();
     $ah = $this->getEmailAlertHandler();
     if ($input->getOption('domain')) {
         $certificates = array($ch->findByDomain($input->getOption('domain')));
     } else {
         $certificates = $ch->getAll();
     }
     foreach ($certificates as $certificate) {
         $logger = $this->getLogger($certificate);
         $le = $this->getLescript($logger);
         try {
             $le->initAccount();
             $le->signDomains($certificate->getAllDomains(), $input->getOption('reuse-csr'));
             $ah->sendIssuedLog($certificate);
         } catch (\Exception $e) {
             $logger->error($e->getMessage());
             foreach (explode("\n", $e->getTraceAsString()) as $line) {
                 $logger->debug($line);
             }
             $ah->sendErrorLog($certificate);
         }
     }
 }
All Usage Examples Of app\CertificateHandler::getAll