Stop injecting content into a section.

@param bool $overwrite

@return string
334623
public function stop($overwrite = false)
    {
        $last = array_pop($this->sectionStack);
        if ($overwrite) {
            $this->sections[$last] = ob_get_clean();
        } else {
            $content = ob_get_clean();
            if (isset($this->sections[$last])) {
                $content = str_replace('@parent', $content, $this->sections[$last]);
            }

            $this->sections[$last] = $content;
        }

        return $last;
    }
670809
public function getTitle($overwriteTitle = null) {
		if (null !== $overwriteTitle) {
			return $this->view->getHtmlBuilder()->getOut($overwriteTitle);
		}
		return $this->view->getHtmlBuilder()->getEsc($this->meta->getTitle());
	}
806932
public static function createFile($aimUrl, $overWrite = false) {
		if (is_file($aimUrl) && $overWrite == false) {
			return false;
		} elseif (is_file($aimUrl) && $overWrite == true) {
			self::unlinkFile($aimUrl);
		}
		$aimDir = dirname($aimUrl);
		self::createDir($aimDir);
		touch($aimUrl);
		return true;
	}
362826
public function updateResource(Resource $resource, $overwrite = false)
    {
        $url = self::makeUrl(null, $resource->uri);
        $body = $resource->toJSON();

        $url .= '?' . Util::query_suffix(array("overwrite" => $overwrite));
        // Isolate the class name, lowercase it, and provide it as a filetype in the headers
        $type = explode('\\', get_class($resource));
        $file_type = 'application/repository.' . lcfirst(end($type)) . '+json';
        $data = $this->service->prepAndSend($url, array(201, 200), 'PUT', $body, true, $file_type, 'application/json');
        return $resource::createFromJSON(json_decode($data, true), get_class($resource));
    }
787774
static function copyFile($source, $target, $overwrite = true)
    {
        if (!file_exists($source)) return false;
        if (file_exists($target) && $overwrite == false) return false;
        elseif (file_exists($target) && $overwrite == true) {
            if (!unlink($target)) return false;
        }
        $targetDir = dirname($target);
        if (!self::createDirectory($targetDir)) return false;
        return copy($source, $target);
    }
829539
public function syncWithTemplate($filePath, $overwrite = FALSE) {
    $sourcePath = $this->getBltRoot() . '/template/' . $filePath;
    $targetPath = $this->getRepoRoot() . '/' . $filePath;

    if ($this->getFileSystem()->exists($sourcePath)) {
      try {
        $this->getFileSystem()->copy($sourcePath, $targetPath, $overwrite);
      }
      catch (IOException $e) {
        throw $e;
      }
    }

  }
242871
public function rename($name = '', $append = '', $prepend = '', $overwrite = false) {
        if (is_callable($name)) {
            $name = call_user_func_array($name, array($this->name(), $this));
        } else {
            $name = $name ?: $this->name();
        }

        // Add boundaries
        $name = (string) $prepend . $name . (string) $append;

        // Remove unwanted characters
        $name = preg_replace('/[^_\-\p{Ll}\p{Lm}\p{Lo}\p{Lt}\p{Lu}\p{Nd}]/imu', '-', $name);

        // Rename file
        $ext = $this->ext() ?: MimeType::getExtFromType($this->type(), true);
        $newName = $name;

        // Don't overwrite
        if (!$overwrite) {
            $no = 1;

            while (file_exists($this->dir() . $newName . '.' . $ext)) {
                $newName = $name . '-' . $no;
                $no++;
            }
        }

        $targetPath = $this->dir() . $newName . '.' . $ext;

        if (rename($this->path(), $targetPath)) {
            $this->reset($targetPath);

            return true;
        }

        return false;
    }
998587
public function noContent(): self
    {
        $this->allowsPayload = false;
        $this->headers->add('Content-Length', 0);
        return $this->fixateCode(204);
    }
775754
public function stop()
    {
        if (null === $this->sectionName) {
            throw new \LogicException('You must start a section before you can stop it.');
        }

        if (!isset($this->sections[$this->sectionName])) {
            $this->sections[$this->sectionName] = '';
        }

        $this->sections[$this->sectionName] = $this->appendSection ? $this->sections[$this->sectionName] . ob_get_clean() : ob_get_clean();
        $this->sectionName = null;
        $this->appendSection = false;
    }
308703
public static function moveFile($fileUrl, $aimUrl, $overWrite = false) {
		if (!is_file($fileUrl)) {
			return false;
		}
		if (is_file($aimUrl) && $overWrite = false) {
			return false;
		} elseif (is_file($aimUrl) && $overWrite = true) {
			self::unlinkFile($aimUrl);
		}
		$aimDir = dirname($aimUrl);
		self::createDir($aimDir);
		rename($fileUrl, $aimUrl);
		return true;
	}
296752
public function load(string $configPath, $overwrite = false): void
    {
        if (!file_exists($configPath)) {
            return;
        }
        $config = include $configPath;
        if (!is_array($config) && !is_object($config)) {
            return;
        }
        if (is_object($config)) {
            $config = get_object_vars($config);
        }
        $this->loadArray($config, $overwrite);
    }
407575
public function merge(self $resource, bool $overwrite = true): void
    {
        if ($this->getLocale() !== $resource->getLocale()) {
            trigger_error('Attempting to merge resources of different locale', \E_USER_NOTICE);
        }
        
        $this->addData($resource->data, (bool) $overwrite);
    }
1163490
public function decodeFile( $fileName, $overwrite = FALSE )
	{
		if( file_exists( $fileName ) )
		{
			if( $this->isEncoded( $fileName ) )
			{
				$file	= new FS_File_Editor( $fileName );
				$php	= $file->readString();
				$code	= $this->encode( $php );
				$dirname	= dirname( $fileName );
				$basename	= basename( $fileName );
				$target	= $dirname."/".substr( $basename, strlen( $this->filePrefix) , -strlen( $this->fileSuffix ) );
				if( $fileName == $target && !$overwrite )
					throw new RuntimeException( 'File cannot be overwritten, use Parameter "overwrite".' );
				$file->writeString( $code );
				return TRUE;
			}
		}
		return FALSE;	
	}
1055209
protected function confirmOverwrite(array $files = [])
    {
        if (!$files || $this->option('overwrite')) {
            return true;
        }
        $files = implode("\n - ", $files);
        return $this->confirm(
            "Are you sure you want to overwrite the following files?\n<comment> - {$files}</comment>\n\n"
        );
    }
560789
public function blendFromSeed($seed_key, $overwrite = false)
    {
        $this->loadObjectDataFromSeed($seed_key);
        return $this->blend($overwrite);
    }
445966
public function findDestination($file, $overwrite = false) {
        if ($file instanceof File) {
            $name = $file->name();
            $ext = '.' . $file->ext();

        } else {
            $name = $file;
            $ext = '';

            if ($pos = mb_strrpos($name, '.')) {
                $ext = mb_substr($name, $pos, (mb_strlen($name) - $pos));
                $name = mb_substr($name, 0, $pos);
            }
        }

        function endsWith($haystack, $needle) {
            // search forward starting from end minus needle length characters
            return $needle === "" || strpos($haystack, $needle, strlen($haystack) - strlen($needle)) !== FALSE;
        }

        $retina = false;
        if(endsWith($name, "@2x")) { 
            $name = explode("@2x", $name);
            $name = $name[0].$name[1];
            $retina = true;
        }

        $target = $this->_directory . $name . $ext;

        if (!$overwrite) {
            $no = 1;

            while (file_exists($target)) {
                if ($retina) {
                    $target = sprintf('%s%s-%s@2x%s', $this->_directory, $name, $no, $ext);
                } else {
                    $target = sprintf('%s%s-%s%s', $this->_directory, $name, $no, $ext);
                }
                $no++;
            }
        }

        return $target;
    }
156273
public function setSection($section, array $config, $overwrite = false)
    {
        if (false === $overwrite && array_key_exists($section, $this->raw_parameters)) {
            $this->raw_parameters[$section] = Collection::array_merge_assoc_recursive($this->raw_parameters[$section], $config);
        } else {
            $this->raw_parameters[$section] = $config;
        }

        if (array_key_exists($section, $this->parameters)) {
            unset($this->parameters[$section]);
        }

        return $this;
    }