Adds an array of BBCode's to the document
@param array $bbcodes
@param bool $replace
@see add_bbcode
162317
public function add_bbcodes(Array $bbcodes, $replace=true)
	{
		foreach($bbcodes as $bbcode)
			$this->add_bbcode($bbcode, $replace);
	}
1364954
public static function replaceInFile($filename, $replacements){
		$content = \file_get_contents($filename);
		foreach ($replacements as $find => $replace) {
			$content = \str_replace($find, $replace, $content);
		}
		\file_put_contents($filename, $content);
	}
1345992
public function replace($search, $replace)
    {
        return $this->map(function ($str) use ($search, $replace) {
            return str_replace($search, $replace, $str);
        });
    }
637411
public function header($header, $value, $replace = true)
    {
        $this->headers[] = array($header, $value, $replace);
    }
383035
public function replaceOutsideQuotes($search, $replace) {
        
        $this->search = $search;
        $this->replace = $replace;
        return $this->_strReplaceOutsideQuotes();
    }
21872
protected function buildRepositoryReplacements(array $replace)
    {
        $repository = $this->parseRepository($this->option('repository'));

        if (empty(trim($repository, $this->laravel->getNamespace(). 'Repositories\\'))) {
            $repository = $this->parseRepository($this->ask('witch repository do you want to injected to the controller?'));
        }

        if (! class_exists($repository)) {
            if ($this->confirm("A {$repository} repository does not exist. Do you want to generate it?", true)) {
                $this->call('make:repository', [
                        'name' => $repository,
                        '--model' => $this->modelClass
                    ]);
            }
        }

        return array_merge($replace, [
            'DummyFullRepositoryClass' => $repository,
            'DummyRepositoryClass' => class_basename($repository),
            'DummyRepositoryVariable' => lcfirst(class_basename($repository)),
        ]);
    }
1139849
public function replaceExact(array $words, $replace, $text)
    {
        return Replace\Normal::replace($words, $replace, $text);
    }
768753
final public function __pack(array $values, $replace)
    {
        $this->values = $replace ? $values : array_merge($this->values, $values);
        $this->dirty = [];
        $this->fresh = false;

        return $this;
    }
968644
public function groupAppend( $groupName, $groupName2OrArray , $replace = true ){
		$this->load($groupName);
		$data = [];
		if( is_array( $groupName2OrArray ) ){
			$data = $groupName2OrArray;
		}
		else{
			$this->load( $groupName2OrArray );
			$data = $this->langs[ $groupName2OrArray];
		}
		if( !empty( $data)){
			foreach ($data as $k => $v ){
				if( isset( $this->langs[$groupName][$k])){
					if( $replace == true ){
						$this->langs[ $groupName ][$k] = $v;
					}
				}
				else{
					$this->langs[ $groupName ][$k] = $v;
				}
				
			}
		}
		
	}
222539
public function replaceContents(Array $replacements) {
    $this->writeContents(
      str_replace(
                  array_keys($replacements),
                  array_values($replacements),
                  $this->getContents()
                 )
    );
    return $this;
  }
1045921
protected function sortReplacements(array $replace)
    {
        return (new Collection($replace))->sortBy(function ($value, $key) {
            return mb_strlen($key) * -1;
        })->all();
    }
1348935
function replace($search,$replace){
		$this->_String = $this->toString();
		return parent::replace($search,$replace);
	}
621528
public function replace(array $replacements)
    {
        foreach ($this->files() as $file) {
            (new Replacer($file))->swap($replacements);
        }
    }
1338967
private function perfomOperations($insert, $update, $remove)
    {
        $bulkOperations = [];
        foreach ($insert as $id => $document) {
            $repository = $this->getObjectRepository($document);
            if ($repository instanceof GridFSRepository) {
                $repository->insertOne($document);
                unset($insert[$id]);
            } else {
                $query = $repository->insertOne($document, ['getQuery' => true]);
                $repositoryId = spl_object_hash($repository);
                $bulkOperations[$repositoryId] = isset($bulkOperations[$repositoryId]) ? $bulkOperations[$repositoryId] : $repository->createBulkWriteQuery();
                $bulkOperations[$repositoryId]->addQuery($query);
            }
        }

        foreach ($update as $id => $document) {
            $repository = $this->getObjectRepository($document);
            $query = $repository->updateOne($document, [], ['getQuery' => true]);
            $repositoryId = spl_object_hash($repository);
            $bulkOperations[$repositoryId] = isset($bulkOperations[$repositoryId]) ? $bulkOperations[$repositoryId] : $repository->createBulkWriteQuery();
            $bulkOperations[$repositoryId]->addQuery($query);
        }

        foreach ($remove as $id => $document) {
            $repository = $this->getObjectRepository($document);
            if ($repository instanceof GridFSRepository) {
                $repository->deleteOne($document);
                unset($remove[$id]);
            } else {
                $query = $repository->deleteOne($document, ['getQuery' => true]);
                $repositoryId = spl_object_hash($repository);
                $bulkOperations[$repositoryId] = $bulkOperations[$repositoryId] ?? $repository->createBulkWriteQuery();
                $bulkOperations[$repositoryId]->addQuery($query);
            }
        }

        foreach (array_merge($insert, $update, $remove) as $id => $document) {
            $repository = $this->getObjectRepository($document);
            $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_PRE_FLUSH, $document);
        }

        foreach ($bulkOperations as $bulkOperation) {
            $bulkOperation->execute();
        }

        foreach (array_merge($insert, $update) as $id => $document) {
            $repository = $this->getObjectRepository($document);
            $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_POST_FLUSH, $document);
            $repository->cacheObject($document);
        }

        $this->flush();
    }
1007366
public function send($replace = true)
    {
        if (headers_sent()) {
            return;
        }

        foreach ($this->headers as $header) {
            header($header, $replace);
        }

        return $this;
    }
826547
protected function buildModelReplacements(array $replace)
    {
        $modelClass = $this->parseModel($this->option('model'));

        if (! class_exists($modelClass)) {
            if ($this->confirm("A {$modelClass} model does not exist. Do you want to generate it?", true)) {
                $this->call('make:model', ['name' => $modelClass]);
            }
        }

        return array_merge($replace, [
            'DummyFullModelClass' => $modelClass,
            'DummyModelClass' => class_basename($modelClass),
            'DummyModelVariable' => lcfirst(class_basename($modelClass)),
        ]);
    }
160941
function replace($search,$replace){
		settype($search,"string");

		// prevod StringBuffer na string
		if(is_object($replace)){
			$replace = $replace->toString();
		}

		for($i=0;$i<sizeof($this->_Buffer);$i++){
			$this->_Buffer[$i]->replace($search,$replace);
		}
	}