| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/nextcloud/3rdparty/punic/punic/code/Exception/ |
Upload File : |
<?php
namespace Punic\Exception;
/**
* An exception raised when an data file has not been found.
*/
class DataFileNotFound extends \Punic\Exception
{
protected $identifier;
protected $locale;
protected $fallbackLocale;
/**
* Initializes the instance.
*
* @param string $identifier The data file identifier
* @param string $locale The preferred locale (if the data file is locale-specific)
* @param string $fallbackLocale The fallback locale (if the data file is locale-specific)
* @param \Exception $previous The previous exception used for the exception chaining
*/
public function __construct($identifier, $locale = '', $fallbackLocale = '', $previous = null)
{
$this->identifier = $identifier;
if (empty($locale) && empty($fallbackLocale)) {
$this->locale = '';
$this->fallbackLocale = '';
$message = "Unable to find the data file '$identifier'";
} else {
$this->locale = $locale;
$this->fallbackLocale = $fallbackLocale;
if (@strcasecmp($locale, $fallbackLocale) === 0) {
$message = "Unable to find the data file '$identifier' for '$locale'";
} else {
$message = "Unable to find the data file '$identifier', neither for '$locale' nor for '$fallbackLocale'";
}
}
parent::__construct($message, \Punic\Exception::DATA_FILE_NOT_FOUND, $previous);
}
/**
* Retrieves the bad data file identifier.
*
* @return string
*/
public function getIdentifier()
{
return $this->identifier;
}
/**
* Retrieves the preferred locale.
*
* @return string
*/
public function getLocale()
{
return $this->locale;
}
/**
* Retrieves the fallback locale.
*
* @return string
*/
public function getFallbackLocale()
{
return $this->fallbackLocale;
}
}