appendFile.

@param mixed $source
@param int $index
@return $this
547970
public function appendFile($source, $index = 0)
    {
        $chunkFile = $this->chunkFile().'.'.$index;
        $this->files->appendStream($chunkFile, $source, 0);

        return $this;
    }
529642
public function replaceInFile($old, $new, $append = 0)
    {
        $contents = $this->previous;
        $replaceWith = preg_replace("~$old\n?~", "$new\n", $contents);

        file_put_contents($this->getPath(), $replaceWith, $append);

        return $this;
    }
1089628
public function setSource($source)
    {
        if (is_file($source)) {
            $info = getimagesize($source);

            $this->mime         = $info['mime'];
            $this->source       = $source;
            $this->sourceWidth  = $info[0];
            $this->sourceHeight = $info[1];
        }

        return $this;
    }
1152238
public function add(string $dir): self
    {
        $dir = rtrim(\BearFramework\Internal\Utilities::normalizePath($dir), '/') . '/';
        if (!isset($this->dirs[$dir])) {
            $this->dirs[$dir] = strlen($dir);
            arsort($this->dirs);
            $indexFilename = $dir . 'index.php';
            if (is_file($indexFilename)) {
                ob_start();
                try {
                    (static function($__filename) {
                        include $__filename;
                    })($indexFilename);
                    ob_end_clean();
                } catch (\Exception $e) {
                    ob_end_clean();
                    throw $e;
                }
            } else {
                throw new \Exception('Cannot find index.php file in the dir specified (' . $dir . ')!');
            }
        }
        return $this;
    }
498702
public function addFilter($index, $method = null, ...$params)
    {
        $this->filters[$index] = [$method, $params];
        return $this;
    }
802187
public function addOrder($source)
    {
        $orders   = $this->getOrders();
        $orders[] = $source;

        $this->setData('orders', $orders);

        return $this;
    }
79054
public function addValue($value, $index = null)
    {
        if ($this->value === null) {
            $this->value = [];
        }

        if ($index === null) {
            $this->value[] = $value;
        }
        else {
            $this->value[$index] = $value;
        }

        return $this;
    }
18189
public function createIndex($index, $configuration = null)
    {
        $body = $configuration !== null ? Json::encode($configuration) : null;

        return $this->db->put([$index], [], $body);
    }
1175401
public function copy($target, $source)
    {
        if (!$this->exists($target)) {
            throw new \RuntimeException("$target does not exist.", E_ERROR);
        }

        if (!$this->exists($source)) {
            $this->makeDirectory(dirname($source), true);
        }

        return file_put_contents($source, $this->get($target));
    }
1209748
public function insertFile($index, $href)
    {
        $href = '/css/' . $href;
        $this->insert($index, 'file', $href);
        return $this;
    }
72381
public function append($path)
    {
        if (!is_array($path)) {
            $path = $this->normalize($path);
        }

        $path = array_merge($this->paths, $path);

        $this->paths = $this->removeDots($path);

        return $this;
    }
302892
public function setSource($source)
    {
        if (!$source instanceof Collection) {
            $source = collect($source);
        }

        $this->source = $source;
        return $this;
    }
1184735
public function addSources(array $sources)
    {
        foreach ($sources as $s) {
            if (!file_exists($s)) {
                throw new \Exception(sprintf('Unable to compress %s because the destination doesn\'t exist.', $s));
            }
            $this->sources[] = $s;
        }
    }
1095051
public function append($source)
    {
        $importNode = $this->ownerDocument->importNode($this->ownerDocument->importSourceNode($source), true);

        return $this->insertBefore($importNode, $this->firstChild);
    }
1296804
public final static function append(string $source, array $Append): string {
		return self::encode(Arr::append(self::decode($source), $Append));
	}
919347
public function addRenderer($index, $method = null)
    {
        $this->renderers[$index] = is_null($method) ?  $index : $method;
        return $this;
    }
257823
public function file($source, $destination)
    {
        settype($source, 'array');

        $this->set($destination, true);

        $added = 0;

        foreach ($source as $file) {
            $added += (int) $this->zip->addFile($file, basename($file));
        }

        $this->zip->close();
        return count($source) == $added;
    }