Determine whether these attributes refer to a symbolic link.

@return boolean
356471
public boolean isLink() {

		if (sftp.getVersion() > 3) {
			return type == SSH_FILEXFER_TYPE_SYMLINK;
		} else if (permissions != null
				&& (permissions.longValue() & SftpFileAttributes.S_IFLNK) == SftpFileAttributes.S_IFLNK) {
			return true;
		} else {
			return false;
		}
	}
13321
public function parseLink($line)
    {
        // Links
        if (preg_match('/^\.\. _`(.+)`: (.+)$/mUsi', $line, $match)) {
            $this->environment->setLink($match[1], $match[2]);
            return true;
        }

        if (preg_match('/^\.\. _(.+): (.+)$/mUsi', $line, $match)) {
            $this->environment->setLink($match[1], $match[2]);
            return true;
        }

        // Short anonymous links
        if (preg_match('/^__ (.+)$/mUsi', trim($line), $match)) {
            $url = $match[1];
            $this->environment->setLink('_', $url);
            return true;
        }

        // Anchor link 
        if (preg_match('/^\.\. _(.+):$/mUsi', trim($line), $match)) {
            $anchor = $match[1];
            $this->document->addNode($this->kernel->build('Nodes\AnchorNode', $anchor));
            $this->environment->setLink($anchor, '#'.$anchor);
            return true;
        }

        return false;
    }
1329403
def _is_symlink(self):
        # type: () -> bool
        '''
        
        '''
        return len(self.dr_entries.sl_records) > 0 or len(self.ce_entries.sl_records) > 0
773856
protected function matchLink()
    {
        return ReplyRuleKeyword::find()
            ->andFilterWhere(['type' => [ReplyRuleKeyword::TYPE_LINK]])
            ->wechatRule($this->getWechat()->id)
            ->limitTime(TIMESTAMP)
            ->all();
    }
1307646
public static function checkBrowserNetPositive()
    {
        if (stripos(self::$userAgentString, 'NetPositive') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'NetPositive'));
            if (isset($aresult[1])) {
                $aversion = explode(' ', $aresult[1]);
                self::$browser->setVersion(str_replace(array('(', ')', ';'), '', $aversion[0]));
            }
            self::$browser->setName(Browser::NETPOSITIVE);

            return true;
        }

        return false;
    }
873506
public function hasPatterns()
    {
        if ($this->isReference() && $this->getProject() !== null) {
            return $this->getRef($this->getProject())->hasPatterns();
        }

        if ($this->defaultPatterns->hasPatterns()) {
            return true;
        }

        for ($i = 0, $size = count($this->additionalPatterns); $i < $size; $i++) {
            $ps = $this->additionalPatterns[$i];
            if ($ps->hasPatterns()) {
                return true;
            }
        }

        return false;
    }
294416
protected function _getLinkId()
    {
        if ($connect = ldap_connect($this->_params['hostname'], $this->_params['port'])) {
            ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, $this->_params['protocolVersion']);
            ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
            return $connect;
        }
        return false;
    }
8209
public function getModelLink()
    {
        $linkCallback = $this->getOption('link');

        if ($linkCallback && is_callable($linkCallback)) {
            return $linkCallback($this->getDataModel());
        } else {
            return false;
        }
    }
570193
public function numLinks()
    {
        if (!is_array($this->links()) && !($this->links() instanceof \Traversable)) {
            return 0;
        }

        $links = array_filter($this->links, function ($link) {
            if (isset($link['active']) && !$link['active']) {
                return false;
            }

            if (isset($link['required_acl_permissions'])) {
                $link['permissions'] = $link['required_acl_permissions'];
                unset($link['required_acl_permissions']);
            }

            if (isset($link['permissions'])) {
                if ($this->hasPermissions($link['permissions']) === false) {
                    return false;
                }
            }

            return true;
        });

        return count($links);
    }
595284
public function getLinkType()
    {
        $types = $this->config()->get('types');
        return isset($types[$this->Type]) ? _t('Links.TYPE'.strtoupper($this->Type), $types[$this->Type]) : null;
    }
1309910
public function isCurrent()
    {
        $link = $this->getLink();
        if ($link{0} == '/') {
            $link = substr($link, 1);
        }

        return request()->is($link);
    }
772664
public function isExternal()
    {
        $parentLink = $this->parentLink;
        if($parentLink===null){ //parentLink is null in case of baseUrl
            return false;
        }
                    
        $isExternal = $this->getHost() !== "" && 
                    ($this->getHost() != $parentLink->getHost());
        
        return $isExternal;
    }
1297031
public function getMetaImageLinked()
    {
        if (!is_null($this->owner->ImageMetaLinked)) {
            return (boolean) $this->owner->ImageMetaLinked;
        }
        
        return $this->owner->getFieldFromParent('DefaultImageLinked');
    }
676937
public function isPair()
    {
        return (!$this->isNull() && ($this->getBaseType() === BaseType::PAIR) || $this->getBaseType() === BaseType::DIRECTED_PAIR);
    }
411517
public static function get_symlinks( )
    {
        Self::$arrSymlinks = array();               // leeres Array
        $url = TL_ROOT . '/';

        Self::iterateDir( $url );                   // Symlinks suchen
        asort( Self::$arrSymlinks );                // alphabetisch sortieren

        $links = array();
        foreach( Self::$arrSymlinks as $link ) {
            $links[] = Self::getLinkData( $link );
        }

        $script = "<?php\n\n"
                . "// This file is part of a backup, included in the zip archive.\n"
                . "// Place the restoreSymlinks.php in the web directory of your\n"
                . "// contao 4 and call http://domain.tld/restoreSymlinks.php\n"
                . "// After running script clear symfony-cache, e.g. with Contao Manager\n\n"
                . '$arrSymlinks = unserialize(\'' . serialize( $links ) . "');\n\n"
                . "// Check current position\n"
                . 'if( !is_dir( "../web" ) || !file_exists( "./app.php" ) ) {' . "\n"
                . "\t" . 'die( "The file is not in the correct directory" );' . "\n"
                . "}\n\n"
                . "// detect OS\n"
                . '$windows = strtoupper(substr(PHP_OS, 0, 3)) === "WIN";      // Windows or not' . "\n\n"
                . "// get absolute path to contao\n"
                . '$rootpath = getcwd();' . "\n"
                . '$rootpath = substr( $rootpath, 0 , strlen($rootpath) - 3 );' . "\n\n"
                . "// Restore the symlinks\n"
                . '$errors = 0;' . "\n"
                . '$counter = 0;' . "\n"
                . 'foreach( $arrSymlinks as $link ) {' . "\n"
                . "\t// get linkpath\n"
                . "\t" . '$l = $rootpath . $link["link"];                         // absolute address of symlink' . "\n"
                . "\t" . 'if( $windows ) $l = str_replace( "/", "\\\\", $l );       // for windows change slashes' . "\n\n"
                . "\t// get targetpath\n"
                . "\t" . 'if( $windows ) {' ."\n"
                . "\t\t" . '$t = str_replace( "/", "\\\\", $rootpath . $link["target"] );' . "\n"
                . "\t}\n"
                . "\telse {\n"
                . "\t\t" . '$t = $link["target"];' . "\n"
                . "\t\t" . 'for( $i = 0; $i < $link["depth"]; $i++ ) {' . "\n"
                . "\t\t\t" . '$t = "../" . $t;' . "\n"
                . "\t\t}\n"
                . "\t}\n\n"
                . "\t// check if link seem to be a directory\n"
                . "\t" . 'if( file_exists( $l ) && !is_link( $l ) ) {' . "\n"
                . "\t\t" . 'rename( $l, $l . ".removed" );                      // rename directory or file' . "\n"
                . "\t}\n\n"
                . "\t// no action, if link is a symlink\n"
                . "\t" . 'if( is_link( $l ) ) continue;' . "\n\n"
                . "\t// set new symlink\n"
                . "\t" . '$counter++;' . "\n"
                . "\t" . 'if( !symlink( $t, $l ) ) {' . "\n"
                . "\t\t" . 'echo "Symlink failed: " . $l . "<br>";' . "\n"
                . "\t\t" . '$errors++;' . "\n"
                . "\t}\n"
                . "}\n\n"
                . 'echo "Program terminated with " . $errors . " errors, " . $counter . " new symlinks<br><br>PLEASE DELETE THE SCRIPT FROM THE DIRECTORY NOW!<br>CLEAR THE SYMFONY-CACHE, e.g. with Contao Manager<br>";' . "\n\n";

        return $script;
    }
303765
public function referrerIsSearchEngine()
    {
        $referrerHostExploded = explode('.', $this->getReferrerDomain());
        $numberOfPieces = count($referrerHostExploded);
        $positionToCheck = $numberOfPieces - 2;

        if (!isset($referrerHostExploded[$positionToCheck])) {
            return false;
        }

        if (strlen($referrerHostExploded[$positionToCheck]) <= 3) {
            --$positionToCheck;

            if (!isset($referrerHostExploded[$positionToCheck])) {
                return false;
            }
        }

        return in_array(
            $referrerHostExploded[$positionToCheck],
            [
                'baidu',
                'bing',
                'bleikko',
                'duckduckgo',
                'exalead',
                'gigablast',
                'google',
                'munax',
                'qwant',
                'sogou',
                'yahoo',
                'yandex',
            ]
        );
    }
667182
public static function checkBrowserLynx()
    {
        if (stripos(self::$userAgentString, 'lynx') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'Lynx'));
            $aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ''));
            self::$browser->setVersion($aversion[0]);
            self::$browser->setName(Browser::LYNX);

            return true;
        }

        return false;
    }