tes, $index, 3)); return $node; case 32: $bytes = Util::read($this->fileHandle, $baseOffset + $index * 4, 4); [, $node] = unpack('N', $bytes); return $node; default: throw new InvalidDatabaseException( 'Unknown record size: ' . $this->metadata->recordSize ); } } /** * @return mixed */ private function resolveDataPointer(int $pointer) { $resolved = $pointer - $this->metadata->nodeCount + $this->metadata->searchTreeSize; if ($resolved >= $this->fileSize) { throw new InvalidDatabaseException( "The MaxMind DB file's search tree is corrupt" ); } [$data] = $this->decoder->decode($resolved); return $data; } /* * This is an extremely naive but reasonably readable implementation. There * are much faster algorithms (e.g., Boyer-Moore) for this if speed is ever * an issue, but I suspect it won't be. */ private function findMetadataStart(string $filename): int { $handle = $this->fileHandle; $fstat = fstat($handle); $fileSize = $fstat['size']; $marker = self::$METADATA_START_MARKER; $markerLength = self::$METADATA_START_MARKER_LENGTH; $minStart = $fileSize - min(self::$METADATA_MAX_SIZE, $fileSize); for ($offset = $fileSize - $markerLength; $offset >= $minStart; --$offset) { if (fseek($handle, $offset) !== 0) { break; } $value = fread($handle, $markerLength); if ($value === $marker) { return $offset + $markerLength; } } throw new InvalidDatabaseException( "Error opening database file ($filename). " . 'Is this a valid MaxMind DB file?' ); } /** * @throws InvalidArgumentException if arguments are passed to the method * @throws BadMethodCallException if the database has been closed * * @return Metadata object for the database */ public function metadata(): Metadata { if (\func_num_args()) { throw new ArgumentCountError( sprintf('%s() expects exactly 0 parameters, %d given', __METHOD__, \func_num_args()) ); } // Not technically required, but this makes it consistent with // C extension and it allows us to change our implementation later. if (!\is_resource($this->fileHandle)) { throw new BadMethodCallException( 'Attempt to read from a closed MaxMind DB.' ); } return clone $this->metadata; } /** * Closes the MaxMind DB and returns resources to the system. * * @throws Exception * if an I/O error occurs */ public function close(): void { if (\func_num_args()) { throw new ArgumentCountError( sprintf('%s() expects exactly 0 parameters, %d given', __METHOD__, \func_num_args()) ); } if (!\is_resource($this->fileHandle)) { throw new BadMethodCallException( 'Attempt to close a closed MaxMind DB.' ); } fclose($this->fileHandle); } } فروشگاه - گروه فنی مهندسی کوثر

گروه فنی و مهندسی کوثر

  • العربيةالعربية
  • فارسیفارسی
  • EnglishEnglish
Instagram Whatsapp

لوگو گروه فنی و مهندسی کوثر

09176050698

شیراز -شهرک صنعتی،میدان دوم،بلوار تلاش شرقی

ایران فارس
  • صفحه اصلی
  • فروشگاه
  • خدمات ما
  • پروژه ها
  • مقالات
  • درباره ما
  • تماس با ما
  • فرم ثبت نام کارآموزی

محصولات

  1. محصولات
دسته‌های محصولات
  • بدون دسته‌بندی (350)
Home » فروشگاه

    آخرین مقالات

    کمپرسور

    کمپرسور

    • 9 شهریور 1402
    کمپرسور چیست و چگونه کار می‌کند؟

    کمپرسور چیست و چگونه کار می‌کند؟

    • 13 مرداد 1401
    نحوه کار سردخانه‌های آمونیاکی چگونه است؟

    نحوه کار سردخانه‌های آمونیاکی چگونه است؟

    • 21 خرداد 1401

    دسترسی سریع

    • مقالات
    • پروژه ها
    • تماس با ما
    • خدمات ما
    • درباره ما
    • فروشگاه

    اینماد

    اطلاعات تماس

    • ایران، فارس، شیراز،شهرک صنعتی،میدان دوم، بلوار تلاش شرقی،گروه فنی مهندسی کوثر
    • 09171170698
    • 09176050698
    • kowsargroupco@gmail.com

    ساعات کاری

    شنبه
    8:00 تا 17:00
    یک شنبه
    8:00 تا 17:00
    دو شنبه
    8:00 تا 17:00
    سه شنبه
    8:00 تا 17:00
    چهار شنبه
    8:00 تا 17:00
    پنج شنبه
    8:00 تا 14:00

    تمامی حقوق این سایت متعلق به گروه فنی مهندسی کوثر می باشد.  طراحی و اجرای سایت : شیرازوب آنلاین

    پیام واتساپ