Return if the extractor can extract the requested data or not.

@param SupportedSource $source
@param SupportedTarget $target
@param ExtractionContextInterface $extractionContext
@return boolean
421755
public function canExtract($source, $target, ExtractionContextInterface $extractionContext)
    {
        if (!$source instanceof SupportedSource) {
            return false;
        }

        if (!$target instanceof SupportedTarget) {
            return false;
        }

        return true;
    }
1141224
public function extract($file, $target, $delete = false)
    {
        $zip = new \ZipArchive();
        $x = $zip->open($file);
        if ($x === true) {
            $zip->extractTo($target);
            $zip->close();
            if ($delete === true) {
                unlink($file);
            }

            return true;
        }
    }
431619
protected function extractZip($archive, $target, $deleteSource = false)
    {
        if (!$this->files->exists($target))
        {
            $this->files->makeDirectory($target, 0777, true);
        }

        $archive = new Pclzip($archive);

        if ($archive->extract(PCLZIP_OPT_PATH, $target) == 0)
        {
            $this->errors->add('extract_zip', $archive->error_string);
            return false;
        }

        if ($deleteSource)
            $this->files->delete($archive->zipname);

        return $archive;
    }
1192716
private function getTargetResult($target, $context=null)
    {
        if ($context===null && \is_string($target) && strpos($target, '<') === false) {
            $context = $this->document;
        }

        return $context === null ? self::create($target) : self::create($target, $context);
    }
203028
protected function isSelfExtend($target, $origin)
    {
        foreach ($origin as $sel) {
            if (in_array($target, $sel)) {
                return true;
            }
        }

        return false;
    }
1244830
private function resolve(string $name, ExtractInterface $extract, array $context = [])
    {
        if (!isset($this->optionsResolver[$name])) {
            $this->optionsResolver[$name] = new OptionsResolver();
            $extract->configureOptions($this->optionsResolver[$name]);

            $dataExtension = $this->getDataExtension($name);
            if (null !== $dataExtension) {
                $dataExtension->configureOptions($this->optionsResolver[$name]);
            }
            $targetExtension = $this->getTargetExtension($name);
            if (null !== $targetExtension) {
                $targetExtension->configureOptions($this->optionsResolver[$name]);
            }
        }

        return $this->optionsResolver[$name]->resolve($context);
    }
114458
public function hasSource($source, $package=null) {
		try {
			return !!static::getFilePath($source, $package);
		} catch( Exception $e ) {
			return false;
		}
	}
1164147
public function isPath( $source, $target, $hadNodes = array() )
	{
		if( $this->isEdge( $source, $target ) )
			return true;
		$nodes = $this->getTargetNodes( $source );
		$hadNodes[] = $source->getNodeName();
		foreach( $nodes as $node )
			if( !in_array( $node->getNodeName(), $hadNodes ) )
				if( $this->isPath( $node, $target, $hadNodes ) )
					return true;
		return false;
	}
1164142
public static function copy(String $source, String $target) : Bool
    {
        return Filesystem::copy(Info::rpath($source), Info::rpath($target));
    }
869835
public function canExtract($source, $type, ExtractionContextInterface $extractionContext)
    {
        if (!$type instanceof Schema) {
            return false;
        }

        if (!$source instanceof ReflectionClass) {
            return false;
        }

        $constraints = $this->getPropertiesConstraints(
            $source,
            $type,
            $this->getValidationGroups($extractionContext)
        );

        return count($constraints);
    }
834749
public function uncompress($source, $target)
    {
        if ($this->zip->open($source, \ZipArchive::CHECKCONS) === false) {
            return false;
        }

        if ($this->zip->extractTo(dirname($target), basename($target)) === false) {
            $this->zip->close();

            return false;
        }

        return $this->zip->close();
    }
858285
private function _copySection($source, &$target)
    {
        foreach ($source as $key => $value) {

            if (!array_key_exists($key, $target)) $target[$key] = $value;
        }
    }
107217
public function fetch(ConnectionContext $context, $source)
    {
        if ($context->mustCache()) {
            $options = $this->connector instanceof ConnectorOptions ? $this->connector->getOptions()->copy() : [];
            ksort($options);

            $this->validateCacheKey($key = $this->cacheKeyGenerator->generateCacheKey($source, $options));

            if ($this->cache->hasItem($key)) {
                return $this->cache->getItem($key)->get();
            }
        }

        $data = $this->connector->fetch($context, $source);

        isset($key) && $this->cache->save($this->cache->getItem($key)->set($data));

        return $data;
    }
942696
public static function unlinkTargetFilesNotPresentInSource($source, $target)
    {
        $diff = self::directoryDiff($source, $target);
        $diff = self::sortFilesDescByPathLength($diff);

        foreach ($diff as $file) {
            $remove = $target . $file;

            if (is_dir($remove)) {
                @rmdir($remove);
            } else {
                self::deleteFileIfExists($remove);
            }
        }
    }
592938
public function addExtractor(ExtractorInterface $extractor)
    {
        if ($this->freeze) {
            throw new FreezeStateException($this);
        }

        $this->extractors[get_class($extractor)] = $extractor;
    }
395852
public static function copy($source, $target)
    {
        if (false === is_dir($source)) {
            return copy($source, $target);
        }

        self::mkdir($target);

        $dirSource = dir($source);

        while (false !== ($fileEntry = $dirSource->read())) {
            if (true === in_array($fileEntry, self::getDirSymbols())) {
                continue;
            }

            if (false === self::copy(sprintf('%s/%s', $source, $fileEntry), sprintf('%s/%s', $target, $fileEntry))) {
                return false;
            }

        }

        $dirSource->close();

        return true;
    }
582212
public static function exists(\core_analytics\local\target\base $target, $indicators = false) {
        global $DB;

        $existingmodels = $DB->get_records('analytics_models', array('target' => $target->get_id()));

        if (!$existingmodels) {
            return false;
        }

        if (!$indicators && $existingmodels) {
            return true;
        }

        $indicatorids = array_keys($indicators);
        sort($indicatorids);

        foreach ($existingmodels as $modelobj) {
            $model = new \core_analytics\model($modelobj);
            $modelindicatorids = array_keys($model->get_indicators());
            sort($modelindicatorids);

            if ($indicatorids === $modelindicatorids) {
                return true;
            }
        }
        return false;
    }