Maybe add a rating prompt for an activity.

@since 2.7.7

@param  string $activity    The name of an activity
@param  string $config_path The path to our plugin's rating prompt configs.
@return bool                Whether or not we added a rating prompt.
4317
public function maybeAddRatingPrompt( $activity, $config_path ) {
		$added = false;

		$configs = $this->getActivityConfigs( $activity, $config_path );

		if ( isset( $configs['threshold'] ) && $this->getActivityCount( $activity ) >= $configs['threshold'] ) {
			$rating_prompt = new \Boldgrid\Library\Library\RatingPrompt();
			$added = $rating_prompt->addPrompt( $configs['prompt'] );
		}

		return $added;
	}
248291
public function getConfig($path, $default_value = null)
    {
        $pos = &$this->_lookupConfigElement($path, false);

        // path element don't exist - return default value
        if ($pos === false) {
            return $default_value;
        }

        return $pos;
    }
264033
public function update($path, $contents, Config $config)
    {
        try {
            return $this->normalizeMetadata($this->api->upload($path, $contents, true));
        } catch (\Exception $e) {
            return false;
        }
    }
549639
private static boolean couldBeYarnConfigurationPath(final String path) {
    return path.contains("conf") ||
            path.contains("etc") ||
            path.contains(HadoopEnvironment.HADOOP_CONF_DIR);
  }
926480
private function updateUserConfigPath(string $configPath): string
    {
        if ($configPath !== $this->getDefaultConfigPath()) {
            $configPath = getcwd().DIRECTORY_SEPARATOR.$configPath;
        }

        return $configPath;
    }
636071
public function write($path, $contents, array $config = [])
    {
        return $this->fileSystem->write($path, $contents, $config);
    }
1143288
public function write($path, $contents, Config $config)
    {
        return $this->update($path, $contents, $config);
    }
1187675
protected function evaluateIfCondition($configurationWithEventualIf, $configurationPath, AbstractFusionObject $contextObject = null)
    {
        if (isset($configurationWithEventualIf['__meta']['if'])) {
            foreach ($configurationWithEventualIf['__meta']['if'] as $conditionKey => $conditionValue) {
                $conditionValue = $this->evaluateInternal($configurationPath . '/__meta/if/' . $conditionKey, self::BEHAVIOR_EXCEPTION, $contextObject);
                if ((bool)$conditionValue === false) {
                    return false;
                }
            }
        }

        return true;
    }
832038
public static ActionConfig findActionConfig( String actionConfigPath, String modulePath, ServletContext context )
    {
        ModuleConfig moduleConfig = getModuleConfig( modulePath, context );
        assert moduleConfig != null;
        return moduleConfig.findActionConfig( actionConfigPath );
    }
278957
protected function writeSplitConfig($file_path, $config) {
    $result = $this->taskWriteToFile($file_path)
      ->text($config)
      ->run();
    if (!$result) {
      throw new BltException("Unable to write $file_path.");
    }
  }
408217
public function addResource(Activity $activity, ResourceNode $resource)
    {
        if (!$activity->getParameters()->getSecondaryResources()->contains($resource)) {
            $activity->getParameters()->getSecondaryResources()->add($resource);
            $this->initializePermissions($activity);
            $this->om->persist($activity);
            $this->om->flush();

            return true;
        }
    }
711480
def add_config_path(path):
    
    if not os.path.isfile(path):
        warnings.warn("Config file does not exist: {path}".format(path=path))
        return False

    # select parser by file extension
    _base, ext = os.path.splitext(path)
    if ext and ext[1:] in PARSERS:
        parser = ext[1:]
    else:
        parser = PARSER
    parser_class = PARSERS[parser]

    _check_parser(parser_class, parser)
    if parser != PARSER:
        msg = (
            "Config for {added} parser added, but used {used} parser. "
            "Set up right parser via env var: "
            "export LUIGI_CONFIG_PARSER={added}"
        )
        warnings.warn(msg.format(added=parser, used=PARSER))

    # add config path to parser
    parser_class.add_config_path(path)
    return True
1194060
public function write($path, $contents, Config $config)
    {
        $options = $this->prepareUploadConfig($config);

        return $this->client->upload($this->getBucket(), $path, $contents, $options);
    }
828256
function set_path($config_path)
	{
		if (!empty($config_path)) {
			if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) {
				$this->_trigger_error_msg("Bad config file path '$config_path'");
				return;
			}
			if(substr($config_path, -1) != DIRECTORY_SEPARATOR) {
				$config_path .= DIRECTORY_SEPARATOR;
			}

			$this->_config_path = $config_path;
		}
	}
70450
public function hasDirectory($configName, $path)
    {
        if (!is_dir($path)) {
            $this->event->getIO()->write(sprintf('The %s (%s) specified in composer.json was not found in %s.', $configName, $path, getcwd()));

            return false;
        }

        return true;
    }
594773
public function put(string $path, string $contents, array $config = []): bool
    {
        $path = $this->normalizePath($path);
        $config = $this->prepareConfig($config);

        if (! $this->exists($path)) {
            return $this->getAdapter()->update($path, $contents, $config);
        }

        return $this->getAdapter()->write($path, $contents, $config);
    }
1085012
protected function isConfig($path)
    {
        if ($this->config()->isConfigFile($path)) {
            $this->config()->invalidateConfig();

            $this->loader->loadEverything();

            return true;
        }

        return false;
    }