<?php
/**
 * Version informations about pthreads extension
 *
 * PHP version 5
 *
 * @category PHP
 * @package  PHP_CompatInfo
 * @author   Laurent Laville <pear@laurent-laville.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version  GIT: $Id: pthreads.php 504342e 2013-10-07 12:17:25 +0200 Laurent Laville $
 * @link     http://php5.laurent-laville.org/compatinfo/
 */

/**
 * All interfaces, classes, functions, constants about pthreads extension
 *
 * @category PHP
 * @package  PHP_CompatInfo
 * @author   Laurent Laville <pear@laurent-laville.org>
 * @license  http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version  Release: 2.26.0
 * @link     http://php5.laurent-laville.org/compatinfo/
 * @link     http://www.php.net/manual/en/book.pthreads.php
 * @since    Class available since Release 2.16.0
 */
class PHP_CompatInfo_Reference_Pthreads
    extends PHP_CompatInfo_Reference_PluginsAbstract
{
    /**
     * Extension/Reference name
     */
    const REF_NAME    = 'pthreads';

    /**
     * Latest version of Extension/Reference supported
     */
    const REF_VERSION = '0.45';   // 2013-09-08 (stable)

    /**
     * Gets informations about extensions
     *
     * @param string $extension (optional) NULL for PHP version,
     *                          TRUE if extension version
     * @param string $version   (optional) php or extension version
     * @param string $condition (optional) particular relationship with $version
     *                          Same operator values as used by version_compare
     *
     * @return array
     */
    public function getExtensions($extension = null, $version = null, $condition = null)
    {
        $phpMin = '5.3.0';
        $extensions = array(
            self::REF_NAME => array($phpMin, '', self::REF_VERSION)
        );
        return $extensions;
    }

    /**
     * Gets informations about classes
     *
     * @param string $extension (optional) NULL for PHP version,
     *                          TRUE if extension version
     * @param string $version   (optional) php or extension version
     * @param string $condition (optional) particular relationship with $version
     *                          Same operator values as used by version_compare
     *
     * @return array
     */
    public function getClasses($extension = null, $version = null, $condition = null)
    {
        $this->setFilter(func_get_args());

        $classes = array();

        $release = false;
        $items = array(
            'Cond'                                  => array('5.3.0', ''),
            'Mutex'                                 => array('5.3.0', ''),
            'Stackable'                             => array('5.3.0', ''),
            'Thread'                                => array('5.3.0', ''),
            'Worker'                                => array('5.3.0', ''),
        );
        $this->applyFilter($release, $items, $classes);

        return $classes;
    }

    /**
     * Gets informations about constants
     *
     * @param string $extension (optional) NULL for PHP version,
     *                          TRUE if extension version
     * @param string $version   (optional) php or extension version
     * @param string $condition (optional) particular relationship with $version
     *                          Same operator values as used by version_compare
     *
     * @return array
     * @link   http://www.php.net/manual/en/pthreads.constants.php
     */
    public function getConstants($extension = null, $version = null, $condition = null)
    {
        $this->setFilter(func_get_args());

        $constants = array();

        $release = false;
        $items = array(
            'PTHREADS_INHERIT_ALL'                  => array('5.3.0', ''),
            'PTHREADS_INHERIT_CLASSES'              => array('5.3.0', ''),
            'PTHREADS_INHERIT_CONSTANTS'            => array('5.3.0', ''),
            'PTHREADS_INHERIT_FUNCTIONS'            => array('5.3.0', ''),
            'PTHREADS_INHERIT_INCLUDES'             => array('5.3.0', ''),
            'PTHREADS_INHERIT_INI'                  => array('5.3.0', ''),
            'PTHREADS_INHERIT_NONE'                 => array('5.3.0', ''),
        );
        $this->applyFilter($release, $items, $constants);

        return $constants;
    }

}
