Caches feature node.

@param string      $path    Feature path
@param FeatureNode $feature Feature instance
500860
public function write($path, FeatureNode $feature)
    {
        $this->features[$path]   = $feature;
        $this->timestamps[$path] = time();
    }
315014
protected function storeToAll(FeatureInterface $feature)
    {
        $name = $feature->getName();

        if (!isset($this->all[$name])) {
            $this->all[$name] = [];
        }

        $this->all[$name][$feature->getProvider()->getName()] = $feature;
    }
786765
private function isMatchNameFilter(FeatureNode $feature, $filterString)
    {
        $filter = new NameFilter($filterString);

        return $filter->isFeatureMatch($feature);
    }
1035928
public function filterFeature(FeatureNode $feature)
    {
        $scenarios = array();
        foreach ($feature->getScenarios() as $scenario) {
            if (!$this->isScenarioMatch($scenario)) {
                continue;
            }

            if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
                $table = $scenario->getExampleTable()->getTable();
                $lines = array_keys($table);

                $filteredTable = array($lines[0] => $table[$lines[0]]);
                unset($table[$lines[0]]);

                foreach ($table as $line => $row) {
                    if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
                        $filteredTable[$line] = $row;
                    }
                }

                $scenario = new OutlineNode(
                    $scenario->getTitle(),
                    $scenario->getTags(),
                    $scenario->getSteps(),
                    new ExampleTableNode($filteredTable, $scenario->getExampleTable()->getKeyword()),
                    $scenario->getKeyword(),
                    $scenario->getLine()
                );
            }

            $scenarios[] = $scenario;
        }

        return new FeatureNode(
            $feature->getTitle(),
            $feature->getDescription(),
            $feature->getTags(),
            $feature->getBackground(),
            $scenarios,
            $feature->getKeyword(),
            $feature->getLanguage(),
            $feature->getFile(),
            $feature->getLine()
        );
    }
619901
public void addFeaturePath( String featurePath, String filter ) {
        if (!featurePaths.contains(featurePath)) {
            featurePaths.add(featurePath);
            if (filter == null) {
                filter = "";
            }
            featureFilter.add(filter);
        }
    }
675093
public function copyTo($path)
    {
        foreach ($this->assets as $assetName => $assetPath) {
            $outputPath = $path . '/' . $assetName;

            $this->copyFromTo($assetPath, $outputPath);
        }
    }
845030
public function getNodeCollection($path)
    {
        // init
        $result = null;
        $chunks = $this->splitPath($path);

        // action
        $curObj = $this;
        $count = 0;
        foreach ($chunks as $chunk) {
            // check, if attributes exist
            $regs = array();
            preg_match('/^([a-z]+)(?:\[(.*)\])?$/i', $chunk, $regs);

            // if there are attributes, store them in array
            $chunkAttributes = array();
            if (sizeof($regs) > 2) {
                // get chunk name
                $chunk = $regs[1];

                // get attributes
                $tmpAttributes = preg_split('/\,/', $regs[2]);
                for ($i = 0; $i < sizeof($tmpAttributes); $i++) {
                    list($key, $value) = preg_split('/\=/', $tmpAttributes[$i]); // split into key = value
                    $key = substr($key, 1, strlen($key) - 1); // remove @
                    $value = trim($value, '\''); // remove ''
                    $chunkAttributes[$key] = $value; // add to attributes list
                }
            }

            //echo $count.' / '.sizeof($chunks)."\n";

            try {
                if ($count + 1 < sizeof($chunks)) {
                    if (($curObj = $curObj->getChildNode($chunk, $chunkAttributes)) != null) {
                        // zuweisung schon oben in if-block schon erfolgt
                    } else {
                        throw new ChildDoesNotExistException(
                            'Child nodes "'.$chunk.'" '.' ("'.$path.'") does not exist.'
                        );
                    }

                } else {
                    if (sizeof($result = $curObj->getChildNodes($chunk, $chunkAttributes)) > 0) {
                        //var_dump($result);die;
                    }
                }
            } catch (\Exception $e) {
                //die('XXXXXXX');
                throw $e;
            }

            /*
            //if ( ( $curObj = $curObj->GetChildNodes($chunk, $chunkAttributes) ) != null ) {
            if ( sizeof( $curObj = $curObj->GetChildNodes($chunk, $chunkAttributes) ) > 0 ) {
              // zuweisung schon oben in if-block schon erfolgt
            }
            else {
              throw new ChildDoesNotExistException('Child nodes "'.$chunk.'" '.' ("'.$path.'") does not exist.');
            }
            */

            $count++;
        }

        // return
        return $result;
        //return $curObj;
    }
20911
public static function addIncludePath(...$path): void
    {
        $paths = explode(PATH_SEPARATOR, get_include_path());

        foreach ($path as $r) {

            if (is_array($r)) {
                foreach ($r as $t) {
                    $paths[] = $t;
                }
            } else {
                $paths[] = $r;
            }
        }

        set_include_path(implode(PATH_SEPARATOR, array_unique($paths)));
    }
1108934
public function getChildren($path)
    {
        $node = $this->getNodeForPath($path);
        $basePath = trim($path, '/');
        if ('' !== $basePath) {
            $basePath .= '/';
        }

        foreach ($node->getChildren() as $child) {
            $this->cache[$basePath.$child->getName()] = $child;
            yield $child;
        }
    }
423755
function (config) {
    return _.map(config.features, function(featureDef) {
      var feature = null
        , featurePath = null;

      var featureId = featureDef.$featureId || featureDef.feature;

      // Try to require the feature from each path listed in `config.featurePaths`.
      for (var i = 0; i < config.featurePaths.length; ++i) {
        featurePath = path.join(config.featurePaths[i], featureDef.feature);
        if (fs.existsSync(featurePath) || fs.existsSync(featurePath + '.js')) {
          feature = require(featurePath);
          break;
        }
      }

      if (!feature) {
        var errorMsg =
          'Cannot find feature: ' + util.inspect(featureDef.feature) +
          ' from featurePaths: ' + util.inspect(config.featurePaths);
        throw new Error(errorMsg);
      }

      var featureTasks = _.get(feature, 'tasks', []);

      return {
        featureId: featureId,
        featureDef: featureDef,
        featureConstructor : feature,
        tasks: featureTasks
      };
    });
  }
303226
private function isMatch(FeatureNode $feature, $filterString)
    {
        if (false !== strpos($filterString, '@')) {
            return $this->isMatchTagFilter($feature, $filterString);
        }

        if (!empty($filterString)) {
            return $this->isMatchNameFilter($feature, $filterString);
        }

        return false;
    }
121297
protected function parseFeature($path)
    {
        $filename = $this->findRelativePath($path);
        $content = file_get_contents($path);
        $feature = $this->parser->parse($content, $filename);

        return $feature;
    }
1038378
private function bakeFeature(string $name) : void
    {
        $this->pathFragment = 'Feature/Type/Module/';

        $this->bake($name, 'Feature/feature', ['name' => $name], 'Feature');
    }
1207772
public void deleteNode(String path) {

        try {

            zk.delete(path, -1);

        } catch (KeeperException.NoNodeException e) {

            LOGGER.error("cannot delete path: " + path, e);

        } catch (InterruptedException e) {

            LOGGER.warn(e.toString());

        } catch (KeeperException e) {

            LOGGER.error("cannot delete path: " + path, e);
        }
    }
946917
public function process($node, $path = null)
    {
        $this->_depth = 0;
        $this->_variables[$this->_depth] = [];
        $this->_processTree($node);
        if ($this->_variables[$this->_depth]) {
            $this->_flushVariables($node);
        }
        $this->_variables = [];
        return $node;
    }
1148127
function(feature, node) {
        for (var key in feature.attributes) {
            var tag = this.createElementNS(null, "tag");
            tag.setAttribute("k", key);
            tag.setAttribute("v", feature.attributes[key]);
            node.appendChild(tag);
        }
    }
638247
protected function _processTree($file, $nodes, $coverage, $path = '')
    {
        foreach ($nodes as $node) {
            $this->_processNode($file, $node, $coverage, $path);
        }
    }