Insert text into file using mountpoint. Mountpoint is maintained at file.

@param string $mountpoint
@param $textToAdd

@return int|null
426565
private function addTextIntoMountPoint($mountpoint, $textToAdd)
    {
        passthru(
            'sed -i \'s/.*'.$mountpoint.'.*/ \ \ \ \ \ \ \ '.$this->scapeSingleQuotes(preg_quote($textToAdd)).',\n \ \ \ \ \ \ \ '.$mountpoint.'/\' '.str_replace(" ", "\ ", $this->laravel_config_file), $error);

        return $error;
    }
348898
public function create($pinId, $text)
    {
        $requestOptions = [
            'objectId' => $this->getAggregatedPinId($pinId),
            'pinId'    => $pinId,
            'text'     => $text,
        ];

        return $this->post(UrlBuilder::RESOURCE_COMMENT_PIN, $requestOptions, true);
    }
1209180
private function determineFilesToPushAndDelete(
        MountManager $mountManager,
        string $from,
        string $to,
        array $config
    ): array {
        $this->logger->info('Calculating file sync list');

        $delete = !empty($config['delete']);
        $excludes = !empty($config['excludes']) ? $config['excludes'] : [];
        $includes = !empty($config['includes']) ? $config['includes'] : [];

        $filesToPush = $filesToDelete = [];
        list(, $pathTo) = $mountManager->getPrefixAndPath($to);
        $pathTo = trim($pathTo, '/');

        // @todo Remove some of these debug statements
        $this->logger->debug('Retrieving source file list');
        $sourceFiles = $this->applyExcludesAndIncludes($mountManager->listContents($from, true), $excludes, $includes);

        if ('.' != $pathTo && !$mountManager->has($to)) {
            // Source files should all be pushed since destination does not exist
            $filesToPush = $sourceFiles;
        } else {
            if (!$sourceFiles) {
                if ($delete) {
                    $this->logger->debug('Retrieving destination file list');
                    // no need to go recursive if we are deleting all, unless there are excludes
                    if ($excludes) {
                        $destinationFiles = $this->applyExcludesAndIncludes(
                            $mountManager->listContents($to, true),
                            $excludes,
                            $includes
                        );
                    } else {
                        $destinationFiles = $mountManager->listContents($to);
                    }
                    $filesToDelete = $destinationFiles;
                }
            } else {
                $this->logger->debug('Retrieving destination file list');
                $destinationFiles = $this->applyExcludesAndIncludes(
                    $mountManager->listContents($to, true),
                    $excludes,
                    $includes
                );

                if (!$destinationFiles) {
                    // Source files should all be pushed since destination has no files
                    $filesToPush = $sourceFiles;
                } else {
                    // Files exist on source and destination. We must compare them now to sync

                    $this->logger->debug('Determining files to push');
                    // Index by relative path so that we can more easily do comparisons
                    $sourceFiles = array_combine(array_column($sourceFiles, 'relative_path'), $sourceFiles);
                    $destinationFiles = array_combine(
                        array_column($destinationFiles, 'relative_path'),
                        $destinationFiles
                    );

                    if (!empty($config['ignore_timestamps'])) {
                        $filesToPush = $sourceFiles;
                    } else {
                        foreach ($sourceFiles as $sourceFile) {
                            $relativePath = $sourceFile['relative_path'];
                            // If file already exists on destination and is directory or is newer, skip it
                            if (isset($destinationFiles[$relativePath])
                                && ('dir' == $destinationFiles[$relativePath]['type']
                                    || (
                                        !empty($destinationFiles[$relativePath]['timestamp'])
                                        && !empty($sourceFile['timestamp'])
                                        && $destinationFiles[$relativePath]['timestamp'] >= $sourceFile['timestamp']))
                            ) {
                                continue;
                            }

                            $filesToPush[] = $sourceFile;
                        }
                    }

                    $this->logger->debug('Determining files to delete');
                    if ($delete) {
                        $filesToDelete = array_diff_key($destinationFiles, $sourceFiles);
                    }
                }
            }
        }

        if ($filesToPush || ($delete && $filesToDelete)) {
            $this->logger->debug('Removing implicit files from sync list');
            if ($filesToPush) {
                $filesToPush = $this->removeImplicitDirectoriesForPush($filesToPush);
            }

            if ($delete && $filesToDelete) {
                $filesToDelete = $this->removeImplicitFilesForDelete($filesToDelete);
            }
        }

        return [$filesToPush, $filesToDelete];
    }
257110
public void addAddon(MapAddon addon) {
		if (null == addons) {
			addons = new ArrayList<MapAddon>();
		}
		addons.add(addon);
	}
373124
@Override
    public final <T extends TimePoint<? super U, T>> T addTo(T time) {

        return this.add(time, this, false);

    }
56063
function pushTextNode(text) {
        switch (options.trimWhitespace) {
            case 'blank':
                if (/^\s+$/.test(text)) {
                    text = null;
                }
                break;

            case 'all':
                text = text.replace(/(^\s+|\s+$)/g, '');
                break;
        }

        if (text) {
            currentNode.children.push({
                textExpr: parseText(text, options.delimiters)
            });
        }
    }
842318
public function add(TraitDefinition $traitToAdd)
    {
        foreach ($this->collection as $trait) {
            if ($trait === $traitToAdd) {
                throw new Exception(\sprintf('Trait already exists %s', \var_export($traitToAdd, true)));
            }
        }
        $this->collection[] = $traitToAdd;
    }
619408
public function addTOC($styleFont = null, $styleTOC = null) {
		$toc = new PHPWord_TOC($styleFont, $styleTOC);
		$this->_elementCollection[] = $toc;
		return $toc;
	}
911631
public static function addNodeFromNode(\DOMNode $source, \DOMNode $nodeToAdd)
    {
        if ($nodeToAdd->hasChildNodes()) {
            $nodeList = $nodeToAdd->childNodes; // It is necessary because Zend Core For Oracle didn't support
            // access the property Directly.
            foreach ($nodeList as $node) {
                $owner = XmlUtil::getOwnerDocument($source);
                $newNode = $owner->importNode($node, true);
                $source->appendChild($newNode);
            }
        }
    }
1260286
private void addNewText(final EAdd paramAdd, final Characters paramTextEvent) throws TTException {
        assert paramTextEvent != null;
        final String text = paramTextEvent.getData().trim();
        final ByteBuffer textByteBuffer = ByteBuffer.wrap(TypedValue.getBytes(text));
        if (textByteBuffer.array().length > 0) {
            if (paramAdd == EAdd.ASFIRSTCHILD) {
                mWtx.insertTextAsFirstChild(new String(textByteBuffer.array()));
            } else {
                mWtx.insertTextAsRightSibling(new String(textByteBuffer.array()));
            }
        }
    }
985913
public void setTagsToAdd(java.util.Collection<Tag> tagsToAdd) {
        if (tagsToAdd == null) {
            this.tagsToAdd = null;
            return;
        }

        this.tagsToAdd = new com.amazonaws.internal.SdkInternalList<Tag>(tagsToAdd);
    }
340436
public function insertAbove(Text $text, $addition, $location = null)
    {
        $input = array(
            'text' => $text,
            'location' => $location,
            'addition' => $addition,
        );
        $this->commandInvoker->run('insert_above', $input);
    }
395420
private function addFile($pathToAdd, $fileName = null)
    {
        if (!$fileName) {
            $info = pathinfo($pathToAdd);
            $fileName = isset($info['extension']) ?
                $info['filename'].'.'.$info['extension'] :
                $info['filename'];
        }

        $this->repository->addFile($pathToAdd, $this->getInternalPath().$fileName);
    }
402953
public function parseText() : void
    {
        if (!count($this->stream->getTokens())) {
            return;
        }

        if ($this->accept(Token::T_TEXT)) {
            $this->insert(new TextNode($this->getCurrentToken()->getValue()));
            $this->advance();
        }
    }
254994
public static function isMountpointInRootLine($uid = null)
    {
        $ret = false;

        // Performance check, there must be an MP-GET value
        if (Typo3GeneralUtility::_GET('MP')) {
            // Possible mount point detected, let's check the rootline
            foreach (self::getRootLine($uid) as $page) {
                if (!empty($page['_MOUNT_OL'])) {
                    // Mountpoint detected in rootline
                    $ret = true;
                }
            }
        }

        return $ret;
    }
678422
public TagResourceRequest withTagsToAdd(java.util.Map<String, String> tagsToAdd) {
        setTagsToAdd(tagsToAdd);
        return this;
    }
940725
@SuppressWarnings("unchecked")
    void insert(Suffix<T, S> suffix, ActivePoint<T, S> activePoint) {
        Object item = suffix.getEndItem();

        if (edges.containsKey(item)) {
            if (tree.isNotFirstInsert() && activePoint.getNode() != tree.getRoot())
                tree.setSuffixLink(activePoint.getNode());
            activePoint.setEdge(edges.get(item));
            activePoint.incrementLength();
        } else {
            saveSequenceTerminal(item);
            Edge<T, S> newEdge = new Edge<>(suffix.getEndPosition() - 1, this,
                    sequence, tree);
            edges.put((T) suffix.getEndItem(), newEdge);
            suffix.decrement();
            activePoint.updateAfterInsert(suffix);

            if (tree.isNotFirstInsert() && !this.equals(tree.getRoot())) {
                tree.getLastNodeInserted().setSuffixLink(this);
            }
            if (suffix.isEmpty()) {
            }
            else
                tree.insert(suffix);
        }
    }