/* (non-PHPdoc)
@see \Zend\Hydrator\HydratorInterface::extract()
480938
public function extract($object)
    {
        $data = parent::extract($object);
        $data['description-description']    = $this->extractValue('descriptiondescription', $object);
        $data['description-requirements']   = $this->extractValue('descriptionrequirements', $object);
        $data['description-benefits']       = $this->extractValue('descriptionbenefits', $object);
        $data['description-qualifications'] = $this->extractValue('descriptionqualifications', $object);
        $data['description-title']          = $this->extractValue('descriptiontitle', $object);

        $data['description-html']           = $object->getTemplateValues()->getHtml();
        return $data;
    }
1302729
protected function extractValue($item, $key)
    {
        if (is_object($item)) {
            if (method_exists($item, 'hasMethod') && $item->hasMethod($key)) {
                return $item->{$key}();
            }
            return $item->{$key};
        } else {
            if (array_key_exists($key, $item)) {
                return $item[$key];
            }
        }
    }
1160547
public function applyExtract(IExtractStrategy $extract)
    {
        /* @var $document \TextAnalysis\Documents\TokensDocument */
        $found = [];
        foreach($this->documents as $document)
        {
            $found = array_merge($document->applyExtract($extract), $found);
        }
        return $found;
    }
1264499
public function extract() {
        $pkValues = array();
        // Lose the parentheses, they mean nothing to us (more importantly, "((key = value))" fails)
        // @fixme A string primary key containing a "(" will not be returned.
        $where = str_replace(array('(', ')'), '', $this->_where);
        foreach ($this->_pkColumns as $pk) {
            $regexp = '/(?:`?' . preg_quote($this->_tableName) . '`?\.|\s|^){1}`?(?:' .
                preg_quote($pk) .
                ')`?\s?=\s?(?:(?P<q>[\'"])(?P<value>(?:(?!\k<q>).)*)\k<q>|(?P<rest>\w*))/';
            if (!preg_match($regexp, $where, $matches)) {
                continue;
            }
            // Note: backreference "rest" is there to catch unquoted
            // values. (id = 100 instead of id = "100")
            $value = $matches['value'];
            if (!empty($matches['rest'])) {
                $value = $matches['rest'];
            }
            $pkValues[$pk] = $value;
        }
        return $pkValues;
    }
360905
public function extract($hash) {
		if ($this->commandDisabled('extract')) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}
		
		if (($file = $this->file($hash)) == false) {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		$archiver = isset($this->archivers['extract'][$file['mime']])
			? $this->archivers['extract'][$file['mime']]
			: false;
			
		if (!$archiver) {
			return $this->setError(elFinder::ERROR_NOT_ARCHIVE);
		}
		
		$path   = $this->decode($hash);
		$parent = $this->stat($this->_dirname($path));

		if (!$file['read'] || !$parent['write']) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}
		$this->clearcache();
		return ($path = $this->_extract($path, $archiver)) ? $this->stat($path) : false;
	}
899557
public function extract($archivename, $extractdir)
	{
		$ext      = pathinfo($archivename, PATHINFO_EXTENSION);
		$path     = pathinfo($archivename, PATHINFO_DIRNAME);
		$filename = pathinfo($archivename, PATHINFO_FILENAME);

		switch (strtolower($ext))
		{
			case 'zip':
				$result = $this->getAdapter('zip')->extract($archivename, $extractdir);

				break;

			case 'tar':
				$result = $this->getAdapter('tar')->extract($archivename, $extractdir);

				break;

			case 'tgz':
			case 'gz':
			case 'gzip':
				// This may just be an individual file (e.g. sql script)
				$tmpfname = $this->options['tmp_path'] . '/' . uniqid('gzip');

				try
				{
					$this->getAdapter('gzip')->extract($archivename, $tmpfname);
				}
				catch (\RuntimeException $exception)
				{
					@unlink($tmpfname);

					return false;
				}

				if ($ext === 'tgz' || stripos($filename, '.tar') !== false)
				{
					$result = $this->getAdapter('tar')->extract($tmpfname, $extractdir);
				}
				else
				{
					Folder::create($extractdir);
					$result = File::copy($tmpfname, $extractdir . '/' . $filename, null, 0);
				}

				@unlink($tmpfname);

				break;

			case 'tbz2':
			case 'bz2':
			case 'bzip2':
				// This may just be an individual file (e.g. sql script)
				$tmpfname = $this->options['tmp_path'] . '/' . uniqid('bzip2');

				try
				{
					$this->getAdapter('bzip2')->extract($archivename, $tmpfname);
				}
				catch (\RuntimeException $exception)
				{
					@unlink($tmpfname);

					return false;
				}

				if ($ext === 'tbz2' || stripos($filename, '.tar') !== false)
				{
					$result = $this->getAdapter('tar')->extract($tmpfname, $extractdir);
				}
				else
				{
					Folder::create($extractdir);
					$result = File::copy($tmpfname, $extractdir . '/' . $filename, null, 0);
				}

				@unlink($tmpfname);

				break;

			default:
				throw new \InvalidArgumentException(sprintf('Unknown archive type: %s', $ext));
		}

		return $result;
	}
527626
public function extract($value)
    {
        if (null === $value) {
            return $this->nullable ? null : [];
        }

        if (is_object($value)) {
            $objectPrototype = $this->getObjectPrototype();
            return $objectPrototype->getHydrator()->extract($value);
        }
                
        if (is_array($value)) {
            return $value;
        }

        throw new Exception\InvalidArgumentException(sprintf(
            'Invalid value: must be null, or an array, or an object: "%s" given',
            is_object($value) ? get_class($value) : gettype($value)
        ));
    }
1110283
public function extract($object)
    {
        $data = parent::extract($object);

        foreach ($this->getFreeValuesKeys() as $key) {
            $data[$key] = $object->get($key);
        }

        return $data;
    }
5575
protected function extract(array $files)
    {
        foreach ($files as $key => $file) {
            if ($file instanceof Doozr_Request_File) {

                // Simple security layer
                $filename = $this->cleanFilename($file->getClientFilename());

                // @todo Move to a basic validation applied always for files if enabled in configuration.
                #$mediaType = $this->getMimeTypeByExtension(pathinfo($filename)['extension']);

                /* @var Doozr_Request_File $file */
                // Put everything in a simple array structure ...
                $files[$key] = [
                    'name'     => $filename,
                    'type'     => $file->getClientMediaType(),
                    'tmp_name' => $file->getTemporaryName(),
                    'error'    => $file->getError(),
                    'size'     => $file->getSize(),
                    'emulated' => false,
                ];
            } else {
                $files[$key] = $this->extract($file);
            }
        }

        return $files;
    }
844171
protected function _extract() {
		$message = [];

		$message[] = 'A `Catalog` class configuration with an adapter that is capable of';
		$message[] = 'handling read requests for the `messageTemplate` category is needed';
		$message[] = 'in order to proceed. This may also be referred to as `extractor`.';
		$this->out($message);
		$this->out();

		$name = $this->_configuration([
			'adapter' => 'Code',
			'path' => $this->source,
			'scope' => $this->scope
		]);
		$configs = Catalog::config();

		try {
			return Catalog::read($name, 'messageTemplate', 'root', [
				'scope' => $configs[$name]['scope'],
				'lossy' => false
			]);
		} catch (Exception $e) {
			return false;
		}
	}
1232643
public function extract($name, $separator = '.')
    {
        $filter = $this->filter instanceof NullFilter ? null : $this->filter;

        return new static($this->get($name, [], 'raw', $separator), $filter);
    }
1167770
public static function extract(array &$arr, $path, $default = null, $delimiter = '.')
    {
        $value = static::get($arr, $path, $default, $delimiter);

        static::delete($arr, $path, $delimiter);

        return $value;
    }
1252801
public function extract($element, $withKey = null)
    {
        return new static(Utils\CollectionKeyWalker::extract($this, $element, $withKey));
    }
257260
public function extract($rules)
    {
        /** @var \DOMElement $node */
        $node = $this->_node;

        $data = [];
        foreach ($rules as $name => $rule) {
            if ($rule[0] === '@') {
                $data[$name] = $node->getAttribute(substr($rule, 1));
            } elseif ($rule === 'text()') {
                $data[$name] = $node->textContent;
            } elseif ($rule === 'html()') {
                $data[$name] = $node->ownerDocument->saveHTML($node);
            } elseif ($rule === 'path()') {
                $data[$name] = $node->getNodePath();
            } elseif (($pos = strpos($rule, '@')) === false) {
                $nodes = $this->_document->getQuery()->css($rule, $node);
                $data[$name] = $nodes->length ? $nodes->item(0)->textContent : null;
            } else {
                $nodes = $this->_document->getQuery()->css(substr($rule, 0, $pos), $node);
                $data[$name] = $nodes->length ? $nodes->item(0)->getAttribute(substr($rule, $pos + 1)) : null;
            }
        }

        return $data;
    }
1355811
public function extract( $object )
    {
        $data = $this->getMapper()
                     ->extract( $object );

        if ( isset( $data['properties'] ) &&
             is_array( $data['properties'] ) )
        {
            foreach ( $data['properties'] as $key => $value )
            {
                $newKey = String::camelize( $key );

                if ( is_array( $value ) &&
                     array_key_exists( 'value', $value ) )
                {
                    $data['properties'][$key] = $value['value'];
                }

                if ( $newKey != $key )
                {
                    $data['properties'][$newKey] = $data['properties'][$key];
                    unset( $data['properties'][$key] );
                }
            }
        }

        return $data;
    }
345911
public function extract($object)
    {
        $array = array();
        $methods = get_class_methods(get_class($object));

        foreach ($methods as $method) {
            preg_match('/^(get)(.*?)$/i', $method, $matches);
            if (!isset($matches[2])) {
                continue;
            }
            $key = StringUtil::snake($matches[2]);
            $array[$key] = $object->$method();
        }

        return $array;
    }
16203
public function extract()
    {
        $iterator = new \RecursiveDirectoryIterator($this->path);
        $iterator = new \RecursiveIteratorIterator($iterator);

        $pages = [];
        $files = iterator_to_array($iterator);
        $files = array_filter($files, function($file)
        {
            return $file->isFile();
        });
        
        foreach($files as $path)
        {
            $pages[$this->exclude($path)] = compact('path');
        }
        
        return $pages;
    }