High level fucntion to read an IP address of the given version

@access private
@param int $version  IP version to read (either 4 or 6, returns false on anything else)
@param int $pos  Position to read from
@return int|string|boolean
329853
private function readIp($version, $pos) {
    if (4 === $version) {
      // Read a standard PHP int
      return self::wrap32($this->readWord($pos));
    } elseif (6 === $version) {
      // Read as BCMath int (quad)
      return $this->readQuad($pos);
    } else {
      // unrecognized
      return false;
    }
  }
242558
public function getURL($version)
    {
        $file = false;
        $os = $this->getOS();
        $cdn_url = $this->getCdnUrl($version);

        if ($os === 'windows') {
            $file = 'phantomjs-' . $version . '-windows.zip';
        }

        if ($os === 'linux') {
            $bitsize = $this->getBitSize();

            if ($bitsize === '32') {
                $file = 'phantomjs-' . $version . '-linux-i686.tar.bz2';
            }

            if ($bitsize === '64') {
                $file = 'phantomjs-' . $version . '-linux-x86_64.tar.bz2';
            }
        }

        if ($os === 'macosx') {
            $file = 'phantomjs-' . $version . '-macosx.zip';
        }

        # OS unknown
        if ($file === false) {
            throw new \RuntimeException(
                'The Installer could not select a PhantomJS package for this OS.
                Please install PhantomJS manually into the /bin folder of your project.'
            );
        }

        return $cdn_url . $file;
    }
369740
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getDealerId();
                break;
            case 2:
                return $this->getDay();
                break;
            case 3:
                return $this->getBegin();
                break;
            case 4:
                return $this->getEnd();
                break;
            case 5:
                return $this->getClosed();
                break;
            case 6:
                return $this->getPeriodBegin();
                break;
            case 7:
                return $this->getPeriodEnd();
                break;
            case 8:
                return $this->getCreatedAt();
                break;
            case 9:
                return $this->getUpdatedAt();
                break;
            case 10:
                return $this->getVersion();
                break;
            case 11:
                return $this->getVersionCreatedAt();
                break;
            case 12:
                return $this->getVersionCreatedBy();
                break;
            case 13:
                return $this->getDealerIdVersion();
                break;
            default:
                return null;
                break;
        } // switch()
    }
202610
public function getCharacterCountBits(Version $version) : int
    {
        $number = $version->getVersionNumber();

        if ($number <= 9) {
            $offset = 0;
        } elseif ($number <= 26) {
            $offset = 1;
        } else {
            $offset = 2;
        }

        return $this->characterCountBitsForVersions[$offset];
    }
1372263
private function comparePhingVersion($version)
    {
        $current = strtolower(self::getPhingVersion());
        $current = trim(str_replace('phing', '', $current));

        // make sure that version checks are not applied to trunk
        if ('dev' === $current) {
            return 1;
        }

        if (-1 == version_compare($current, $version)) {
            throw new BuildException(
                sprintf('Incompatible Phing version (%s). Version "%s" required.', $current, $version)
            );
        }
    }
1247438
public function getVersionedContent($version)
    {
        if (!in_array($version, $this->getVersions(), true)) {
            throw new \UnexpectedValueException("Invalid log entry $version for {$this->path}.");
        }

        if (($content = \Arbit\VCSWrapper\Cache\Manager::get($this->path, $version, 'content')) === false) {
            // Refetch the basic content information, and cache it.
            $process = new \Arbit\VCSWrapper\SvnCli\Process('svn', $this->username, $this->password);
            $process->argument('-r' . $version);

            // Execute command
            $return = $process->argument('cat')->argument(new \SystemProcess\Argument\PathArgument($this->root . $this->path))->execute();
            \Arbit\VCSWrapper\Cache\Manager::cache($this->path, $version, 'content', $content = $process->stdoutOutput);
        }

        return $content;
    }
33445
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getRemoteAppId();
                break;
            case 2:
                return $this->getApiversion();
                break;
            case 3:
                return $this->getName();
                break;
            case 4:
                return $this->getVersion();
                break;
            case 5:
                return $this->getConfigDisplayerrors();
                break;
            case 6:
                return $this->getConfigBypasscache();
                break;
            case 7:
                return $this->getConfigMinifymarkup();
                break;
            case 8:
                return $this->getConfigDebugmode();
                break;
            case 9:
                return $this->getConfigMaintenancemode();
                break;
            case 10:
                return $this->getConfigGzipscripts();
                break;
            case 11:
                return $this->getConfigRewriteurl();
                break;
            case 12:
                return $this->getConfigAdminemail();
                break;
            case 13:
                return $this->getConfigCachemode();
                break;
            case 14:
                return $this->getStatuscode();
                break;
            case 15:
                return $this->getExtensions();
                break;
            case 16:
                return $this->getLog();
                break;
            case 17:
                return $this->getPHP();
                break;
            case 18:
                return $this->getMySQL();
                break;
            default:
                return null;
                break;
        } // switch()
    }
35954
public function fetch($version = '')
    {
        $version = $version ?: $this->getVersionAvailable();

        return $this->sourceRepository->fetch($version);
    }
1368730
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getVisible();
                break;
            case 2:
                return $this->getAddress1();
                break;
            case 3:
                return $this->getAddress2();
                break;
            case 4:
                return $this->getAddress3();
                break;
            case 5:
                return $this->getZipcode();
                break;
            case 6:
                return $this->getCity();
                break;
            case 7:
                return $this->getCountryId();
                break;
            case 8:
                return $this->getLatitude();
                break;
            case 9:
                return $this->getLongitude();
                break;
            case 10:
                return $this->getCreatedAt();
                break;
            case 11:
                return $this->getUpdatedAt();
                break;
            case 12:
                return $this->getVersion();
                break;
            case 13:
                return $this->getVersionCreatedAt();
                break;
            case 14:
                return $this->getVersionCreatedBy();
                break;
            case 15:
                return $this->getDealerShedulesIds();
                break;
            case 16:
                return $this->getDealerShedulesVersions();
                break;
            case 17:
                return $this->getDealerContactIds();
                break;
            case 18:
                return $this->getDealerContactVersions();
                break;
            case 19:
                return $this->getDealerContentIds();
                break;
            case 20:
                return $this->getDealerContentVersions();
                break;
            case 21:
                return $this->getDealerFolderIds();
                break;
            case 22:
                return $this->getDealerFolderVersions();
                break;
            case 23:
                return $this->getDealerBrandIds();
                break;
            case 24:
                return $this->getDealerBrandVersions();
                break;
            case 25:
                return $this->getDealerProductIds();
                break;
            case 26:
                return $this->getDealerProductVersions();
                break;
            case 27:
                return $this->getDealerAdminIds();
                break;
            case 28:
                return $this->getDealerAdminVersions();
                break;
            default:
                return null;
                break;
        } // switch()
    }
696103
public static function version2string($version)
    {
        switch($version)
        {   // fall-through's are on purpose
            case self::SEPA_PAIN_001_001_03_GBIC:
            case self::SEPA_PAIN_001_001_03: return 'pain.001.001.03';
            case self::SEPA_PAIN_001_002_03: return 'pain.001.002.03';
            case self::SEPA_PAIN_001_003_03: return 'pain.001.003.03';
            case self::SEPA_PAIN_008_001_02_GBIC:
            case self::SEPA_PAIN_008_001_02_AUSTRIAN_003:
            case self::SEPA_PAIN_008_001_02: return 'pain.008.001.02';
            case self::SEPA_PAIN_008_002_02: return 'pain.008.002.02';
            case self::SEPA_PAIN_008_003_02: return 'pain.008.003.02';
            default: return false;
        }
    }
444196
public static function isVersion($version){
        $currentVersion = Craft::$app->getVersion();
        $version = explode('.', $version);
        $currentVersion = explode('.', $currentVersion);
        $isVersion = true;
        foreach($version as $key => $value){
            if ((int)$currentVersion[$key] < $version[$key]){ 
                $isVersion = false;
            }
        }
        return $isVersion;
    }
1204495
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getSourceId();
                break;
            case 2:
                return $this->getPageid();
                break;
            case 3:
                return $this->getTitle();
                break;
            case 4:
                return $this->getFiles();
                break;
            case 5:
                return $this->getSubcats();
                break;
            case 6:
                return $this->getPages();
                break;
            case 7:
                return $this->getSize();
                break;
            case 8:
                return $this->getHidden();
                break;
            case 9:
                return $this->getCreatedAt();
                break;
            case 10:
                return $this->getUpdatedAt();
                break;
            case 11:
                return $this->getTreeLeft();
                break;
            case 12:
                return $this->getTreeRight();
                break;
            case 13:
                return $this->getTreeLevel();
                break;
            default:
                return null;
                break;
        } // switch()
    }
123566
public static function lengthIndicator($mode, $version)
        {
            if ($mode == QR_MODE_STRUCTURE)
                return 0;
                
            if ($version <= 9) {
                $l = 0;
            } else if ($version <= 26) {
                $l = 1;
            } else {
                $l = 2;
            }

            return self::$lengthTableBits[$mode][$l];
        }
1359027
protected function getCompareVersion(Version $version)
    {
        if ($version->isDev()) {
            return substr(
                $version->getFullPretty(),
                strlen($version->getPretty()) + 1
            );
        }

        return $version->getPretty();
    }
68338
public static function convertDateVersion($version)
    {
        if (preg_match('/^\d{7,}\./', $version)) {
            $pos = strpos($version, '.');
            $version = substr($version, 0, $pos).self::convertDateMinorVersion(substr($version, $pos + 1));
        }

        return $version;
    }
965125
protected function versionMatch($title, $version)
    {
        $title = strtolower($title);
        $version = strtolower($version);

        $version = str_replace(array('.', '-', '/'), ' ', $version);
        $versionParts = explode(' ', $version);

        $matches = array();

        foreach ($versionParts as $versionPart) {
            if (strlen($versionPart) >= 3 && stripos($title, $versionPart)) {
                $matches[] = $versionPart;
            }
        }

        $matches = count($matches);

        if ($matches > 0) {
            return $matches;
        } else {
            return false;
        }
    }
382641
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getFile();
                break;
            case 2:
                return $this->getPersonId();
                break;
            case 3:
                return $this->getVisible();
                break;
            case 4:
                return $this->getPosition();
                break;
            case 5:
                return $this->getCreatedAt();
                break;
            case 6:
                return $this->getUpdatedAt();
                break;
            case 7:
                return $this->getVersion();
                break;
            case 8:
                return $this->getVersionCreatedAt();
                break;
            case 9:
                return $this->getVersionCreatedBy();
                break;
            case 10:
                return $this->getPersonIdVersion();
                break;
            default:
                return null;
                break;
        } // switch()
    }