Creates the needed link text for a Release.

@param Release $release

@return string
189899
protected function createLink(Release $release)
	{
		$line = '';

		$link = $release->getLink();

		if ($link !== null)
		{
			$linkName = $release->getLinkName();
			$name = $release->getName();

			$reference = ($linkName === null) ? $name : $linkName;

			$line = "[$reference] $link\n";
		}

		return $line;
	}
1120347
public function link( string $target, string $link )
	{
		if( Helper::isOsWindows() )
		{
			$mode = $this->isDirectory( $target ) ? 'J' : 'H';
			exec( "mklink /{$mode} \"{$link}\" \"{$target}\"" );
		}
		else
		{
			symlink( $target, $link );
		}
	}
1011446
public function buildSimpleLink($output, Link $link)
    {
        $name = $link->getName();

        $output->$name = $link->getHref();

        return $output;
    }
148147
protected static function generateConfig($releases, $phpFile)
    {
        $data = '<?php' . PHP_EOL;
        $data .= '// DO NOT EDIT! This file has been automatically generated.' . PHP_EOL;
        $data .= '// Run composer update to fetch a new version.' . PHP_EOL;
        $data .= 'return array(' . PHP_EOL;
        foreach ($releases as $version => $date) {
            $data .= '   \'' . $version . '\' => \'' . $date . '\',' . PHP_EOL;
        }
        $data .= ');' . PHP_EOL;

        file_put_contents($phpFile, $data);
    }
235347
public static function createMessage($value)
    {
        $newValue = $value . self::EOL;
        return
            self::CONTENT_LENGTH . ':' . strlen($newValue) . self::EOL
            . self::EOL
            . $newValue;
    }
1262341
private function buildAttachmentBody($attachment)
    {
        return sprintf('%s%s%s%s%s%s',
            '--MIME_boundary'.self::CRLF,
            'Content-Type: '.$attachment['mimeType'].self::CRLF,
            'Content-Transfer-Encoding: binary'.self::CRLF,
            'Content-ID: <attachment.bin@devbay.net>'.self::CRLF.self::CRLF,
            $attachment['data'].self::CRLF,
            '--MIME_boundary--'
        );
    }
1315814
public static function createMessage(string $message): string
    {
        $lastErrorMessage = error_get_last();
        if ($lastErrorMessage !== null) {
            $message .= "; ".$lastErrorMessage["message"];
        }
        return $message;
    }
923204
protected function addDate(Release $release)
	{
		$content = '';
		$date = $release->getDate();
		if ($date !== null)
		{
			$content = ' - ' . $date->format('Y-m-d');
		}
		return $content;
	}
811777
private function getTextFromArticle($title)
    {
        $title = \Title::newFromText($title);
        $revision = \Revision::newFromId($title->getLatestRevID());
        if (isset($revision)) {
            return \ContentHandler::getContentText($revision->getContent(\Revision::RAW));
        } else {
            return;
        }
    }
1116779
public static function title($link) {
        if(isset($link['title']) || isset($link['label'])){
            return ' title="'.trim(isset($link['title']) && !empty(trim($link['title'])) ? $link['title'] : $link['label']).'"';
        }
        return false;
    }
864985
public function msginitString(string $source, string $refname): PoFile
    {
        if (!($this->poFile instanceof PoFile)) {
            $this->poFile = new PoFile;
        }

        $tpl = $this->smarty->createTemplate('eval:'.$source);
        $tags = $this->smarty->getTags($tpl);

        $translateTags = array_merge($this->gettextTags, $this->pgettextTags, $this->ngettextTags);
        foreach ($tags as $tag) {
            if (in_array($tag[0], $translateTags)) {
                $entry = new PoEntry;
                $haveEntry = false;
                $entry->add(PoTokens::REFERENCE, $refname);
                foreach ($tag[1] as $temp) {
                    foreach ($temp as $key => $value) {
                        if ($value[0]=="'" || $value[0]=='"') {
                            if (in_array($key, $this->msgidArgNames)) {
                                $entry->set(PoTokens::MESSAGE, $this->escapeForPo($value));
                                $haveEntry = true;
                            } elseif (in_array($key, $this->msgidPluralArgNames)) {
                                $entry->set(PoTokens::PLURAL, $this->escapeForPo($value));
                            } elseif (in_array($key, $this->msgctxtArgNames)) {
                                $entry->set(PoTokens::CONTEXT, $this->escapeForPo($value));
                            }
                        }
                    }
                }
                if ($haveEntry) {
                    $this->checkPhpFormatFlag($entry);
                    $this->poFile->mergeEntry($entry);
                }
            }
        }
        return $this->poFile;
    }
610083
private static String getPomText(ReleaseId releaseId, ReleaseId... dependencies) {
        String pom = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
                + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
                + "         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n"
                + "  <modelVersion>4.0.0</modelVersion>\n" 
                + "\n" 
                + "  <groupId>" + releaseId.getGroupId() + "</groupId>\n"
                + "  <artifactId>" + releaseId.getArtifactId() + "</artifactId>\n" 
                + "  <version>" + releaseId.getVersion() + "</version>\n" + "\n";
        
        if (dependencies != null && dependencies.length > 0) {
            pom += "<dependencies>\n";
            for (ReleaseId dep : dependencies) {
                pom += "<dependency>\n";
                pom += "  <groupId>" + dep.getGroupId() + "</groupId>\n";
                pom += "  <artifactId>" + dep.getArtifactId() + "</artifactId>\n";
                pom += "  <version>" + dep.getVersion() + "</version>\n";
                pom += "</dependency>\n";
            }
            pom += "</dependencies>\n";
        }
        
        pom += "</project>";
        
        return pom;
    }
707714
public function actionShow($release = null)
    {
        $version = $this->getComponent();
        $version->load();
        $version->setRelease($release);
        $dir = dirname($version->getAbspath());
        echo $version->renderFile() . PHP_EOL;
        echo "(run from $dir)\n";
    }
893369
private function readlink(string $path): string
    {
        $result = @readlink($path);

        if (false === $result) {
            $message = 'Could not read symlink.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return $result;
    }
78503
public function updateSymlink($release = null)
    {
        // If the release is specified, update to make it the current one
        if ($release) {
            $this->releasesManager->setNextRelease($release);
        }

        // Get path to current/ folder and latest release
        $currentReleasePath = $this->releasesManager->getCurrentReleasePath();
        $currentFolder = $this->paths->getCurrentFolder();

        return $this->modulable->symlink($currentReleasePath, $currentFolder);
    }
1202020
public function linkTitle()
    {
        return $this->entity->param('link_title') ? $this->entity->param('link_title') : $this->entity->title;
    }
1345596
public function write($mask = '%s')
    {
        $str='';
// allow multi same links
//        foreach($this->cleanStack( $this->get(), 'rel' ) as $entry) {
        foreach ($this->get() as $entry) {
            $str .= sprintf($mask, Html::writeHtmlTag('link', null, $entry, true));
        }
        return $str;
    }