Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2013-present Benjamin Morel
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;

View File

@@ -0,0 +1,262 @@
<?php
declare(strict_types=1);
namespace Brick\PhoneNumber;
use JsonSerializable;
use libphonenumber\geocoding\PhoneNumberOfflineGeocoder;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberUtil;
/**
* A phone number.
*/
final class PhoneNumber implements JsonSerializable
{
/**
* The underlying PhoneNumber object from libphonenumber.
*
* @var \libphonenumber\PhoneNumber
*/
private $phoneNumber;
/**
* Private constructor. Use a factory method to obtain an instance.
*
* @param \libphonenumber\PhoneNumber $phoneNumber
*/
private function __construct(\libphonenumber\PhoneNumber $phoneNumber)
{
$this->phoneNumber = $phoneNumber;
}
/**
* Parses a string representation of a phone number.
*
* @param string $phoneNumber The phone number to parse.
* @param string|null $regionCode The region code to assume, if the number is not in international format.
*
* @return PhoneNumber
*
* @throws PhoneNumberParseException
*/
public static function parse(string $phoneNumber, ?string $regionCode = null) : PhoneNumber
{
try {
return new PhoneNumber(
PhoneNumberUtil::getInstance()->parse($phoneNumber, $regionCode)
);
} catch (NumberParseException $e) {
throw PhoneNumberParseException::wrap($e);
}
}
/**
* @param string $regionCode The region code.
* @param PhoneNumberType::* $phoneNumberType The phone number type, defaults to a fixed line.
*
* @return PhoneNumber
*
* @throws PhoneNumberException If no example number is available for this region and type.
*/
public static function getExampleNumber(string $regionCode, int $phoneNumberType = PhoneNumberType::FIXED_LINE) : PhoneNumber
{
$phoneNumber = PhoneNumberUtil::getInstance()->getExampleNumberForType($regionCode, $phoneNumberType);
if ($phoneNumber === null) {
throw new PhoneNumberException('No example number is available for the given region and type.');
}
return new PhoneNumber($phoneNumber);
}
/**
* Returns the country code of this PhoneNumber.
*
* The country code is a series of 1 to 3 digits, as defined per the E.164 recommendation.
*
* @return string
*/
public function getCountryCode() : string
{
return (string) $this->phoneNumber->getCountryCode();
}
/**
* Returns the geographical area code of this PhoneNumber.
*
* Notes:
*
* - geographical area codes change over time, and this method honors those changes; therefore, it doesn't
* guarantee the stability of the result it produces;
* - most non-geographical numbers have no area codes, including numbers from non-geographical entities;
* - some geographical numbers have no area codes.
*
* If this number has no area code, an empty string is returned.
*
* @return string
*/
public function getGeographicalAreaCode() : string
{
$phoneNumberUtil = PhoneNumberUtil::getInstance();
$nationalSignificantNumber = $phoneNumberUtil->getNationalSignificantNumber($this->phoneNumber);
$areaCodeLength = $phoneNumberUtil->getLengthOfGeographicalAreaCode($this->phoneNumber);
return substr($nationalSignificantNumber, 0, $areaCodeLength);
}
/**
* Returns the national number of this PhoneNumber.
*
* The national number is a series of digits.
*
* @return string
*/
public function getNationalNumber() : string
{
return $this->phoneNumber->getNationalNumber();
}
/**
* Returns the region code of this PhoneNumber.
*
* The region code is an ISO 3166-1 alpha-2 country code.
*
* If the phone number does not map to a geographic region
* (global networks, such as satellite phone numbers) this method returns null.
*
* @return string|null The region code, or null if the number does not map to a geographic region.
*/
public function getRegionCode() : ?string
{
$regionCode = PhoneNumberUtil::getInstance()->getRegionCodeForNumber($this->phoneNumber);
if ($regionCode === '001') {
return null;
}
return $regionCode;
}
/**
* Returns whether this phone number is a possible number.
*
* Note this provides a more lenient and faster check than `isValidNumber()`.
*
* @return bool
*/
public function isPossibleNumber() : bool
{
return PhoneNumberUtil::getInstance()->isPossibleNumber($this->phoneNumber);
}
/**
* Returns whether this phone number matches a valid pattern.
*
* Note this doesn't verify the number is actually in use,
* which is impossible to tell by just looking at a number itself.
*
* @return bool
*/
public function isValidNumber() : bool
{
return PhoneNumberUtil::getInstance()->isValidNumber($this->phoneNumber);
}
/**
* Returns the type of this phone number.
*
* @return PhoneNumberType::*
*/
public function getNumberType() : int
{
return PhoneNumberUtil::getInstance()->getNumberType($this->phoneNumber);
}
/**
* Returns a formatted string representation of this phone number.
*
* @param PhoneNumberFormat::* $format
*
* @return string
*/
public function format(int $format) : string
{
return PhoneNumberUtil::getInstance()->format($this->phoneNumber, $format);
}
/**
* Formats this phone number for out-of-country dialing purposes.
*
* @param string $regionCode The ISO 3166-1 alpha-2 country code
*
* @return string
*/
public function formatForCallingFrom(string $regionCode) : string
{
return PhoneNumberUtil::getInstance()->formatOutOfCountryCallingNumber($this->phoneNumber, $regionCode);
}
public function isEqualTo(PhoneNumber $phoneNumber): bool
{
return $this->phoneNumber->equals($phoneNumber->phoneNumber);
}
/**
* Required by interface JsonSerializable.
*/
public function jsonSerialize(): string
{
return (string) $this;
}
/**
* Returns a text description for the given phone number, in the language provided. The description might consist of
* the name of the country where the phone number is from, or the name of the geographical area the phone number is
* from if more detailed information is available.
*
* If $userRegion is set, we also consider the region of the user. If the phone number is from the same region as
* the user, only a lower-level description will be returned, if one exists. Otherwise, the phone number's region
* will be returned, with optionally some more detailed information.
*
* For example, for a user from the region "US" (United States), we would show "Mountain View, CA" for a particular
* number, omitting the United States from the description. For a user from the United Kingdom (region "GB"), for
* the same number we may show "Mountain View, CA, United States" or even just "United States".
*
* If no description is found, this method returns null.
*
* @param string $locale The locale for which the description should be written.
* @param string|null $userRegion The region code for a given user. This region will be omitted from the description
* if the phone number comes from this region. It is a two-letter uppercase CLDR
* region code.
*
* @return string|null
*/
public function getDescription(string $locale, ?string $userRegion = null) : ?string
{
$description = PhoneNumberOfflineGeocoder::getInstance()->getDescriptionForNumber(
$this->phoneNumber,
$locale,
$userRegion
);
if ($description === '') {
return null;
}
return $description;
}
/**
* Returns a string representation of this phone number in international E164 format.
*
* @return string
*/
public function __toString() : string
{
return $this->format(PhoneNumberFormat::E164);
}
}

View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace Brick\PhoneNumber;
/**
* Base class for phone number exceptions.
*/
class PhoneNumberException extends \Exception
{
}

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace Brick\PhoneNumber;
/**
* Constants for the phone number formats.
*/
final class PhoneNumberFormat
{
/**
* The E164 format.
*
* This consists of a + sign followed by a series of digits,
* comprising the country code and national number.
*
* Example: `+41446681800`.
*/
public const E164 = 0;
/**
* The international format.
*
* This is similar to the E164 format, with extra formatting.
* This format is consistent with the definition in ITU-T Recommendation E123.
*
* Example: `+41 44 668 1800`.
*/
public const INTERNATIONAL = 1;
/**
* The national format.
*
* This is the number as it would be composed from within the country, with formatting.
* This format is consistent with the definition in ITU-T Recommendation E123.
*
* Example: `044 668 1800`.
*/
public const NATIONAL = 2;
/**
* The RFC 3966 format.
*
* This format outputs a `tel:` URI that can be used as an anchor link to start a VOIP call from a web page.
*
* Example: `tel:+41-44-668-1800`.
*/
public const RFC3966 = 3;
}

View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Brick\PhoneNumber;
/**
* Exception thrown when a phone number cannot be parsed.
*/
final class PhoneNumberParseException extends PhoneNumberException
{
/**
* @internal
*
* @param \Exception $e
*
* @return PhoneNumberParseException
*/
public static function wrap(\Exception $e) : PhoneNumberParseException
{
return new PhoneNumberParseException($e->getMessage(), $e->getCode(), $e);
}
}

View File

@@ -0,0 +1,106 @@
<?php
declare(strict_types=1);
namespace Brick\PhoneNumber;
/**
* Constants for the phone number types.
*/
final class PhoneNumberType
{
/**
* Fixed line number.
*/
public const FIXED_LINE = 0;
/**
* Mobile number.
*/
public const MOBILE = 1;
/**
* Fixed line or mobile number.
*
* In some regions (e.g. the USA), it is impossible to distinguish between fixed-line and
* mobile numbers by looking at the phone number itself.
*/
public const FIXED_LINE_OR_MOBILE = 2;
/**
* Freephone number.
*/
public const TOLL_FREE = 3;
/**
* Premium rate number.
*/
public const PREMIUM_RATE = 4;
/**
* Shared cost number.
*
* The cost of this call is shared between the caller and the recipient, and is hence typically
* less than PREMIUM_RATE calls.
*
* @see http://en.wikipedia.org/wiki/Shared_Cost_Service
*/
public const SHARED_COST = 5;
/**
* Voice over IP number.
*
* This includes TSoIP (Telephony Service over IP).
*/
public const VOIP = 6;
/**
* Personal number.
*
* A personal number is associated with a particular person, and may be routed to either a
* MOBILE or FIXED_LINE number.
*
* @see http://en.wikipedia.org/wiki/Personal_Numbers
*/
public const PERSONAL_NUMBER = 7;
/**
* Pager number.
*/
public const PAGER = 8;
/**
* Universal Access Number or Company Number.
*
* The number may be further routed to specific offices, but allows one number to be used for a company.
*/
public const UAN = 9;
/**
* Unknown number type.
*
* A phone number is of type UNKNOWN when it does not fit any of the known patterns
* for a specific region.
*/
public const UNKNOWN = 10;
/**
* Emergency number.
*/
public const EMERGENCY = 27;
/**
* Voicemail number.
*/
public const VOICEMAIL = 28;
/**
* Short code number.
*/
public const SHORT_CODE = 29;
/**
* Standard rate number.
*/
public const STANDARD_RATE = 30;
}

View File

@@ -0,0 +1,11 @@
<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit;