Removes the watermark path from the manipulationGroup and returns it. This way it can be injected into the Glide
server as the `watermarks` path.

@param $manipulationGroup

@return null|string
17691
private function extractWatermarkPath(&$manipulationGroup)
    {
        if (array_key_exists('watermark', $manipulationGroup)) {
            $watermarkPath = dirname($manipulationGroup['watermark']);

            $manipulationGroup['watermark'] = basename($manipulationGroup['watermark']);

            return $watermarkPath;
        }
    }
1186376
public function groupPrefix($viewPath)
    {
        foreach ($this->pathToPrefix as $directory => $groupPrefix) {
            if (strpos($viewPath, $directory) === 0) {
                return $groupPrefix;
            }
        }

        return '';
    }
1160431
public function DeleteWaterMark($identifier)
	{
		$sig = $this->encode($this->applicationSecret."|".$identifier);

		$qs = "key=" .urlencode($this->applicationKey)."&identifier=".urlencode($identifier)."&sig=".$sig;

		return $this->isSuccessful($this->Get($this->getRootUrl(false) . "deletewatermark.ashx?" . $qs));
	}
999540
public function reverseTransform($group)
    {
        if(null === $group) {
            return "";
        } elseif ($group instanceof Group) {
            return (string)$group->getId();
        } elseif ($group instanceof ArrayCollection) {
            $result = array();
            foreach($group as $value) {
                $result[] = (string)$value->getId();
            }
            return $result;
        }
        else return "";
    }
1320713
public function group($group = null)
    {
        if ($group !== null) {
            $this->_group = $group;
        }
        return $this->_group;
    }
356077
public static function getConversionGroupUnits($group = NULL) {
		$conversionGroups = array();
		foreach(self::$_conversionUnits as $conversionUnit => $conversionGroup) {
			if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
				$conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
			}
		}
		return $conversionGroups;
	}
467046
public function removeGroup($group)
    {
        if (is_string($group)) {
            // If the group is a string, we'll assume the dev is passing
            // in a DN string of the group. We'll try to locate it.
            $group = $this->query->newInstance()->findByDn($group);
        }

        if ($group instanceof Group) {
            // If the group is Group model instance, we can
            // remove the current models DN from the group.
            return $group->removeMember($this->getDn());
        }

        return false;
    }
989775
public function detach()
    {
        if (!is_resource($this->stream)) {
            return null;
        }

        $result = $this->stream;
        unset($this->stream);

        $this->size = null;
        $this->isReadable = false;
        $this->isWritable = false;
        $this->isSeekable = false;

        return $result;
    }
762661
public static function removeQueryString($path)
    {
        if (false === $pos = strpos($path, '?')) {
            return $path;
        }

        $anchorPos = strpos($path, '#', $pos);

        $end = false === $anchorPos ? strlen($path) : $anchorPos;

        return substr($path, 0, $pos).substr($path, $end);
    }
557617
public function reverseTransform($groups)
    {
        $value = new ArrayCollection();
        if (is_array($groups) && array_key_exists('groups_collection', $groups)) {
            $groups = $groups['groups_collection'];
            foreach ($groups as $groupId => $group) {
                if (array_key_exists('group', $group) && $group['group']) {
                    $group = $this->groupRepository->find($groupId);
                    if (null !== $group && in_array($group->getSite()->getId(), $this->availableSiteIds)) {
                        $value->add($group);
                    }
                }
            }
        }

        return $value;
    }
671239
public function clearGroup($group)
    {
        $success = false;
        wincache_ucache_inc($this->_config['prefix'] . $group, 1, $success);

        return $success;
    }
323154
public function watermarkPosition(string $position)
    {
        if (! $this->validateManipulation($position, 'position')) {
            throw InvalidManipulation::invalidParameter(
                'watermarkPosition',
                $position,
                $this->getValidManipulationOptions('position')
            );
        }

        return $this->addManipulation('watermarkPosition', $position);
    }
701824
public function removeFields($fieldset = null, $group = null)
    {
        foreach ($this->fields as $current) {
            if ($fieldset && $current->getFieldset() != $fieldset) {
                $this->removeField($current->getName(true));
            }

            if ($group && $current->getGroup() != $group) {
                $this->removeField($current->getName(true));
            }
        }

        return $this;
    }
885059
public function decodeAspiringTranslatorsGroup(Group $group)
    {
        $result = null;
        $match = null;
        if (preg_match('/^\/' . preg_quote(self::GROUPNAME_ASPIRING_TRANSLATORS, '/') . '\/(.+)$/', $group->getGroupPath(), $match)) {
            $result = $this->app->make(LocaleRepository::class)->findApproved($match[1]);
        }

        return $result;
    }
296627
public function delGroup($group) {
    if ($group->inArray((array) $this->groups)) {
      foreach ((array) $this->groups as $key => $curGroup) {
        if ($group->is($curGroup)) {
          unset($this->groups[$key]);
        }
      }
      return $this->groups;
    }
    return true;
  }
425290
public function clean($group = null)
	{
		$hash = $this->options['hash'];

		$allinfo = xcache_list(XC_TYPE_VAR, 0);

		foreach ($allinfo['cache_list'] as $key)
		{
			if (strpos($key['name'], $hash . '-cache-' . $group . '-') === 0) // xor $mode != 'group')
			{
				xcache_unset($key['name']);
			}
		}

		return true;
	}
1166055
private static function removeDotSegments(string $path)
    {
        $result = '';

        while (!\in_array($path, ['', '.', '..'], true)) {
            if ('.' === $path[0] && (0 === strpos($path, $p = '../') || 0 === strpos($path, $p = './'))) {
                $path = substr($path, \strlen($p));
            } elseif ('/.' === $path || 0 === strpos($path, '/./')) {
                $path = substr_replace($path, '/', 0, 3);
            } elseif ('/..' === $path || 0 === strpos($path, '/../')) {
                $i = strrpos($result, '/');
                $result = $i ? substr($result, 0, $i) : '';
                $path = substr_replace($path, '/', 0, 4);
            } else {
                $i = strpos($path, '/', 1) ?: \strlen($path);
                $result .= substr($path, 0, $i);
                $path = substr($path, $i);
            }
        }

        return $result;
    }