Server :
Apache
System :
Linux server1.cbinetwhm.bi 4.18.0-553.123.1.el8_10.x86_64 #1 SMP Tue May 5 04:00:43 EDT 2026 x86_64
User :
fenacobu (1017)
PHP Version :
8.1.34
Disable Functions :
NONE
Current Directory :
/home/fenacobu/www/libraries/vendor/willdurand/negotiation/src/Negotiation/
Directory Status:
Writeable | Document Root:
Writeable
Upload File
Viewing: /home/fenacobu/www/libraries/vendor/willdurand/negotiation/src/Negotiation/AcceptLanguage.php
<?php
namespace Negotiation;
use Negotiation\Exception\InvalidLanguage;
final class AcceptLanguage extends BaseAccept implements AcceptHeader
{
private $language;
private $script;
private $region;
public function __construct($value)
{
parent::__construct($value);
$parts = explode('-', $this->type);
if (2 === count($parts)) {
$this->language = $parts[0];
$this->region = $parts[1];
} elseif (1 === count($parts)) {
$this->language = $parts[0];
} elseif (3 === count($parts)) {
$this->language = $parts[0];
$this->script = $parts[1];
$this->region = $parts[2];
} else {
// TODO: this part is never reached...
throw new InvalidLanguage();
}
}
/**
* @return string
*/
public function getSubPart()
{
return $this->region;
}
/**
* @return string
*/
public function getBasePart()
{
return $this->language;
}
}
Cyb3r Drag0nz Team • Google Edition