FROM php:7.4-fpm
RUN apt-get update && apt-get install -y \
libmcrypt-dev \
libxml2-dev \
zlib1g-dev \
libzip-dev \
mariadb-client \
git
RUN pecl install xdebug-2.9.6 && docker-php-ext-enable xdebug
RUN pecl install mcrypt-1.0.3 && docker-php-ext-enable mcrypt
RUN docker-php-ext-install pdo_mysql iconv mysqli zip
...
В гугле и яндексе не нашел ни чего подходящего.
SELECT id, description FROM products WHERE description LIKE '%под заказ%' OR description LIKE '%под покраску%' OR ...
$row['description'] = str_replace('</h1>', "</h1>\n<h3><!-- craft time -->изготавливается в течении $craftTime</h3>", $row['description']);
interface DeliveryInterface
{
public const TYPE_COURIER = 1;
public const TYPE_PICKUP_POINT = 2;
public const TYPE_ALL = self::TYPE_COURIER + self::TYPE_PICKUP_POINT;
public function getId(): int;
public function getName(): string;
public function getType(): int;
public function getPaymentTypes(): array;
public function isAllowedAddress(Address $address): bool;
public function calculateCost(Address $from, Address $to): array;
}
interface PickupDeliveryInterface extends DeliveryInterface
{
public function getPickupPoints(Address $address = null): array;
}
class DeliveryManager
{
private $deliveries = [];
public function registerDelivery(DeliveryInterface $delivery)
{
$this->deliveries[$delivery->getId()] = $delivery;
}
public function registerDeliveryClass(int $id, string $className, array $config = [])
{
$this->deliveries[$id] = [$className, ['id' => $id] + $config];
}
public function getDelivery(int $id): DeliveryInterface
{
if (!isset($this->deliveries[$id])) {
throw new InvalidArgumentException();
}
if (is_array($this->deliveries[$id])) {
[$className, $config] = $this->deliveries[$id];
$this->deliveries[$id] = new $className($config);
}
return $this->deliveries[$id];
}
}