checkVersion example

$info->username,
            $info->password,
            [
                PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
                PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
            ]
        );

        $this->setNonStrictSQLMode($conn);

        $this->checkVersion($conn);
        $this->checkEngineSupport($conn);
        $this->checkSQLMode($conn);

        return $conn;
    }

    protected function setNonStrictSQLMode(PDO $conn)
    {
        $conn->exec("SET @@session.sql_mode = ''");
    }

    
/** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        $technicalName = $input->getArgument('technical-name');
        $domain = $this->checkDomain();
        $version = $this->checkVersion();
        $token = null;

        $io = $this->io = new SymfonyStyle($input$output);
        $io->title('Community Store Download Command');

        $plugin = $this->getFreePlugin($technicalName$version);

        if ($plugin && $plugin->getCode() !== null) {
            if ($plugin->hasFreeDownload() === false && $plugin->hasCapabilityDummy() === false) {
                $io->note(sprintf('You must be authenticated to download: %s', $plugin->getLabel()));

                

    public function getConnection(DatabaseConnectionInformation $connectionInformation, bool $withoutDatabase = false): Connection
    {
        return self::createConnection($connectionInformation$withoutDatabase);
    }

    public static function createConnection(DatabaseConnectionInformation $connectionInformation, bool $withoutDatabase = false): Connection
    {
        $connection = DriverManager::getConnection($connectionInformation->toDBALParameters($withoutDatabase)new Configuration());

        self::checkVersion($connection);

        return $connection;
    }

    private static function checkVersion(Connection $connection): void
    {
        // https://developer.shopware.com/docs/guides/installation/overview#system-requirements         $mysqlRequiredVersion = '5.7.21';
        $mariaDBRequiredVersion = '10.3.22';

        $version = $connection->fetchOne('SELECT VERSION()');
        


    /** * @throws OrderException */
    private function validateOrder(?OrderEntity $order, string $orderId): void
    {
        if (!$order) {
            throw CartException::orderNotFound($orderId);
        }

        $this->checkVersion($order);
    }

    /** * @throws ProductNotFoundException * @throws InconsistentCriteriaIdsException */
    private function validateProduct(string $productId, Context $context): void
    {
        $product = $this->productRepository->search(new Criteria([$productId])$context)->get($productId);

        if (!$product) {
            
/** * {@inheritdoc} */
  public function findTranslation(array $conditions) {
    $values = $this->dbStringSelect($conditions['translation' => TRUE])
      ->execute()
      ->fetchAssoc();

    if (!empty($values)) {
      $string = new TranslationString($values);
      $this->checkVersion($string, \Drupal::VERSION);
      $string->setStorage($this);
      return $string;
    }
  }

  /** * {@inheritdoc} */
  public function getLocations(array $conditions = []) {
    $query = $this->connection->select('locales_location', 'l', $this->options)
      ->fields('l');
    
Home | Imprint | This part of the site doesn't use cookies.