Resolved #3 Added link to selected album
This commit is contained in:
@ -4,11 +4,27 @@ namespace PhotoPrismUpload\API;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\RotatingFileHandler;
|
||||
use Monolog\Handler\HandlerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use PhotoPrismUpload\Exceptions\NetworkException;
|
||||
use PhotoPrismUpload\Exceptions\AuthenticationException;
|
||||
use PhotoPrismUpload\Entities\Album;
|
||||
|
||||
class LoggerFactory
|
||||
{
|
||||
private static $handlers = [];
|
||||
|
||||
public static function addHandler(HandlerInterface $handler) {
|
||||
self::$handlers[] = $handler;
|
||||
}
|
||||
public static function create(string $name) {
|
||||
$l = new Logger($name);
|
||||
$l->setHandlers(self::$handlers);
|
||||
$l->info('Initialized');
|
||||
return $l;
|
||||
}
|
||||
}
|
||||
|
||||
class PhotoPrism
|
||||
{
|
||||
protected string $base_url = 'https://photos.phlaym.net';
|
||||
@ -23,12 +39,11 @@ class PhotoPrism
|
||||
) {
|
||||
$this->api_url = $this->base_url.'/api/v1';
|
||||
$this->config = $config;
|
||||
$this->logger = new Logger('PhotoPrismUpload');
|
||||
if (empty($log_path)) {
|
||||
$log_path = __DIR__.'/logs/log.log';
|
||||
}
|
||||
$handler = new RotatingFileHandler($log_path, 5, Logger::DEBUG, true);
|
||||
$this->logger->pushHandler($handler);
|
||||
LoggerFactory::addHandler(new RotatingFileHandler($log_path, 5, Logger::DEBUG, true));
|
||||
$this->logger = LoggerFactory::create('PhotoPrismUpload');
|
||||
if (isset($_SESSION['pp_sessionid'])) {
|
||||
$this->session_id = $_SESSION['pp_sessionid'];
|
||||
}
|
||||
|
Reference in New Issue
Block a user