diff options
| -rw-r--r-- | .gitignore | 7 | ||||
| -rw-r--r-- | PHPINFO | 2 | ||||
| -rw-r--r-- | REFLECTION | 1128 | ||||
| -rw-r--r-- | composer.json | 27 | ||||
| -rw-r--r-- | php-pecl-ds.spec | 272 |
5 files changed, 454 insertions, 982 deletions
@@ -1,4 +1,9 @@ +clog +package-*.xml *.tgz +*.tar.bz2 *.tar.gz +*.tar.xz +*.tar.xz.asc *.src.rpm -*.xml +*/*rpm @@ -2,4 +2,4 @@ ds ds support => enabled -ds version => 1.2.9 +ds version => 2.0.0 @@ -1,43 +1,40 @@ -Extension [ <persistent> extension #90 ds version 1.2.9 ] { +Extension [ <persistent> extension #154 ds version 2.0.0 ] { - Dependencies { Dependency [ json (Required) ] Dependency [ spl (Required) ] } - - Classes [11] { - Interface [ <internal:ds> interface Ds\Hashable ] { + - Functions { + Function [ <internal:ds> function Ds\seq ] { - - Constants [0] { - } - - - Static properties [0] { + - Parameters [1] { + Parameter #0 [ <optional> $values = <default> ] } + } + Function [ <internal:ds> function Ds\map ] { - - Static methods [0] { + - Parameters [1] { + Parameter #0 [ <optional> $values = <default> ] } + } + Function [ <internal:ds> function Ds\set ] { - - Properties [0] { + - Parameters [1] { + Parameter #0 [ <optional> $values = <default> ] } + } + Function [ <internal:ds> function Ds\heap ] { - - Methods [2] { - Method [ <internal:ds> abstract public method hash ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method equals ] { - - - Parameters [1] { - Parameter #0 [ <required> $obj ] - } - - Return [ boolean ] - } + - Parameters [2] { + Parameter #0 [ <optional> $values = <default> ] + Parameter #1 [ <optional> ?callable $comparator = <default> ] } } + } - Interface [ <internal:ds> interface Ds\Collection extends Traversable, Countable, JsonSerializable ] { + - Classes [6] { + Interface [ <internal:ds> interface Ds\Key ] { - Constants [0] { } @@ -51,49 +48,24 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Properties [0] { } - - Methods [6] { - Method [ <internal:ds> abstract public method clear ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ <internal:ds> abstract public method isEmpty ] { - - - Parameters [0] { - } - - Return [ boolean ] - } - - Method [ <internal:ds> abstract public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } - - Method [ <internal:Core, inherits Countable> abstract public method count ] { + - Methods [2] { + Method [ <internal:ds> abstract public method hash ] { - Parameters [0] { } } - Method [ <internal:json, inherits JsonSerializable> abstract public method jsonSerialize ] { + Method [ <internal:ds> abstract public method equals ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <required> $other ] } + - Return [ bool ] } } } - Interface [ <internal:ds> interface Ds\Sequence extends Ds\Collection, JsonSerializable, Countable, Traversable ] { + Class [ <internal:ds> final readonly class Ds\Pair implements JsonSerializable ] { - Constants [0] { } @@ -104,221 +76,54 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Static methods [0] { } - - Properties [0] { + - Properties [2] { + Property [ public protected(set) readonly mixed $key ] + Property [ public protected(set) readonly mixed $value ] } - - Methods [29] { - Method [ <internal:ds> abstract public method allocate ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] - } - } - - Method [ <internal:ds> abstract public method capacity ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds> abstract public method contains ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - - Return [ boolean ] - } - - Method [ <internal:ds> abstract public method filter ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds> abstract public method find ] { - - - Parameters [1] { - Parameter #0 [ <required> $value ] - } - } - - Method [ <internal:ds> abstract public method first ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method get ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $index ] - } - } - - Method [ <internal:ds> abstract public method insert ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> ...$values ] - } - } - - Method [ <internal:ds> abstract public method join ] { - - - Parameters [1] { - Parameter #0 [ <optional> string $glue ] - } - - Return [ string ] - } - - Method [ <internal:ds> abstract public method last ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method map ] { - - - Parameters [1] { - Parameter #0 [ <required> callable $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds> abstract public method merge ] { - - - Parameters [1] { - Parameter #0 [ <required> $values ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds> abstract public method pop ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method push ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds> abstract public method reduce ] { - - - Parameters [2] { - Parameter #0 [ <required> callable $callback ] - Parameter #1 [ <optional> $initial ] - } - } - - Method [ <internal:ds> abstract public method remove ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $index ] - } - } - - Method [ <internal:ds> abstract public method reverse ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method rotate ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $rotations ] - } - } - - Method [ <internal:ds> abstract public method set ] { + - Methods [5] { + Method [ <internal:ds, ctor> public method __construct ] { - Parameters [2] { - Parameter #0 [ <required> integer $index ] + Parameter #0 [ <required> $key ] Parameter #1 [ <required> $value ] } } - Method [ <internal:ds> abstract public method shift ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> abstract public method slice ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> integer or NULL $length ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds> abstract public method sort ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] - } - } - - Method [ <internal:ds> abstract public method unshift ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, inherits Ds\Collection> abstract public method clear ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, inherits Ds\Collection> abstract public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ <internal:ds, inherits Ds\Collection> abstract public method isEmpty ] { + Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - Parameters [0] { } - - Return [ boolean ] + - Tentative return [ mixed ] } - Method [ <internal:ds, inherits Ds\Collection> abstract public method toArray ] { + Method [ <internal:ds> public method toArray ] { - Parameters [0] { } - Return [ array ] } - Method [ <internal:Core, inherits Countable> abstract public method count ] { + Method [ <internal:ds> public method __serialize ] { - Parameters [0] { } + - Return [ array ] } - Method [ <internal:json, inherits JsonSerializable> abstract public method jsonSerialize ] { + Method [ <internal:ds> public method __unserialize ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <required> $data ] } } } } - Class [ <internal:ds> <iterateable> final class Ds\Vector implements Ds\Sequence, Traversable, Countable, JsonSerializable, Ds\Collection ] { + Class [ <internal:ds> <iterateable> final class Ds\Seq implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } + Constant [ public int MIN_CAPACITY ] { 8 } } - Static properties [0] { @@ -330,317 +135,79 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Properties [0] { } - - Methods [34] { + - Methods [41] { Method [ <internal:ds, ctor> public method __construct ] { - Parameters [1] { - Parameter #0 [ <optional> $values ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method allocate ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] - } - } - - Method [ <internal:ds> public method apply ] { - - - Parameters [1] { - Parameter #0 [ <required> callable $callback ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method capacity ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method contains ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - - Return [ boolean ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method filter ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method find ] { - - - Parameters [1] { - Parameter #0 [ <required> $value ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method first ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method get ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $index ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method insert ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method join ] { - - - Parameters [1] { - Parameter #0 [ <optional> string $glue ] - } - - Return [ string ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method last ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method map ] { - - - Parameters [1] { - Parameter #0 [ <required> callable $callback ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method merge ] { - - - Parameters [1] { - Parameter #0 [ <required> $values ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method pop ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method push ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method reduce ] { - - - Parameters [2] { - Parameter #0 [ <required> callable $callback ] - Parameter #1 [ <optional> $initial ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method remove ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $index ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method reverse ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds> public method reversed ] { - - - Parameters [0] { - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method rotate ] { - - - Parameters [1] { - Parameter #0 [ <required> integer $rotations ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method set ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <required> $value ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method shift ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method slice ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> integer or NULL $length ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method sort ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] - } - } - - Method [ <internal:ds> public method sorted ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> $values = <default> ] } - - Return [ Ds\Sequence ] } - Method [ <internal:ds> public method sum ] { + Method [ <internal:ds, prototype IteratorAggregate> public method getIterator ] { - Parameters [0] { } + - Return [ Traversable ] } - Method [ <internal:ds, prototype Ds\Sequence> public method unshift ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { + Method [ <internal:ds> public method clear ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { + Method [ <internal:ds> public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ <internal:ds, prototype Countable> public method count ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { + Method [ <internal:ds> public method isEmpty ] { - Parameters [0] { } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - Parameters [0] { } + - Tentative return [ mixed ] } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method toArray ] { - Parameters [0] { } - Return [ array ] } - } - } - - Class [ <internal:ds> <iterateable> final class Ds\Deque implements Ds\Sequence, Traversable, Countable, JsonSerializable, Ds\Collection ] { - - - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [34] { - Method [ <internal:ds, ctor> public method __construct ] { - - - Parameters [1] { - Parameter #0 [ <optional> $values ] - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - Method [ <internal:ds, prototype Countable> public method count ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { - - - Parameters [0] { - } - - Return [ boolean ] - } - - Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { + Method [ <internal:ds> public method __serialize ] { - Parameters [0] { } + - Return [ array ] } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method __unserialize ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <required> $data ] } - - Return [ array ] } - Method [ <internal:ds, prototype Ds\Sequence> public method allocate ] { + Method [ <internal:ds> public method allocate ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] + Parameter #0 [ <required> int $capacity ] } } @@ -651,72 +218,72 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { } } - Method [ <internal:ds, prototype Ds\Sequence> public method capacity ] { + Method [ <internal:ds> public method capacity ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } - Method [ <internal:ds, prototype Ds\Sequence> public method contains ] { + Method [ <internal:ds> public method contains ] { - Parameters [1] { Parameter #0 [ <optional> ...$values ] } - - Return [ boolean ] + - Return [ bool ] } - Method [ <internal:ds, prototype Ds\Sequence> public method filter ] { + Method [ <internal:ds> public method filter ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $callback ] + Parameter #0 [ <optional> ?callable $callback = <default> ] } - Return [ Ds\Sequence ] } - Method [ <internal:ds, prototype Ds\Sequence> public method find ] { + Method [ <internal:ds> public method find ] { - Parameters [1] { Parameter #0 [ <required> $value ] } } - Method [ <internal:ds, prototype Ds\Sequence> public method first ] { + Method [ <internal:ds> public method first ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Sequence> public method get ] { + Method [ <internal:ds> public method get ] { - Parameters [1] { - Parameter #0 [ <required> integer $index ] + Parameter #0 [ <required> int $index ] } } - Method [ <internal:ds, prototype Ds\Sequence> public method insert ] { + Method [ <internal:ds> public method insert ] { - Parameters [2] { - Parameter #0 [ <required> integer $index ] + Parameter #0 [ <required> int $index ] Parameter #1 [ <optional> ...$values ] } } - Method [ <internal:ds, prototype Ds\Sequence> public method join ] { + Method [ <internal:ds> public method join ] { - Parameters [1] { - Parameter #0 [ <optional> string $glue ] + Parameter #0 [ <optional> string $glue = <default> ] } - Return [ string ] } - Method [ <internal:ds, prototype Ds\Sequence> public method last ] { + Method [ <internal:ds> public method last ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Sequence> public method map ] { + Method [ <internal:ds> public method map ] { - Parameters [1] { Parameter #0 [ <required> callable $callback ] @@ -724,7 +291,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Return [ Ds\Sequence ] } - Method [ <internal:ds, prototype Ds\Sequence> public method merge ] { + Method [ <internal:ds> public method merge ] { - Parameters [1] { Parameter #0 [ <required> $values ] @@ -732,306 +299,144 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Return [ Ds\Sequence ] } - Method [ <internal:ds, prototype Ds\Sequence> public method pop ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method push ] { - - - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method reduce ] { - - - Parameters [2] { - Parameter #0 [ <required> callable $callback ] - Parameter #1 [ <optional> $initial ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method remove ] { + Method [ <internal:ds, prototype ArrayAccess> public method offsetExists ] { - Parameters [1] { - Parameter #0 [ <required> integer $index ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method reverse ] { - - - Parameters [0] { + Parameter #0 [ <required> $offset ] } + - Return [ bool ] } - Method [ <internal:ds> public method reversed ] { - - - Parameters [0] { - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds, prototype Ds\Sequence> public method rotate ] { + Method [ <internal:ds, prototype ArrayAccess> public method offsetGet ] { - Parameters [1] { - Parameter #0 [ <required> integer $rotations ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method set ] { - - - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <required> $value ] - } - } - - Method [ <internal:ds, prototype Ds\Sequence> public method shift ] { - - - Parameters [0] { + Parameter #0 [ <required> mixed $offset ] } + - Tentative return [ mixed ] } - Method [ <internal:ds, prototype Ds\Sequence> public method slice ] { + Method [ <internal:ds, prototype ArrayAccess> public method offsetSet ] { - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> integer or NULL $length ] + Parameter #0 [ <required> mixed $offset ] + Parameter #1 [ <required> mixed $value ] } - - Return [ Ds\Sequence ] + - Tentative return [ void ] } - Method [ <internal:ds, prototype Ds\Sequence> public method sort ] { + Method [ <internal:ds, prototype ArrayAccess> public method offsetUnset ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <required> mixed $offset ] } + - Tentative return [ void ] } - Method [ <internal:ds> public method sorted ] { - - - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] - } - - Return [ Ds\Sequence ] - } - - Method [ <internal:ds> public method sum ] { + Method [ <internal:ds> public method pop ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Sequence> public method unshift ] { + Method [ <internal:ds> public method push ] { - Parameters [1] { Parameter #0 [ <optional> ...$values ] } } - } - } - - Class [ <internal:ds> <iterateable> final class Ds\Stack implements Ds\Collection, JsonSerializable, Countable, Traversable ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - Methods [12] { - Method [ <internal:ds, ctor> public method __construct ] { + Method [ <internal:ds> public method reduce ] { - - Parameters [1] { - Parameter #0 [ <optional> $values ] + - Parameters [2] { + Parameter #0 [ <required> callable $callback ] + Parameter #1 [ <optional> $initial = <default> ] } } - Method [ <internal:ds> public method allocate ] { + Method [ <internal:ds> public method remove ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] + Parameter #0 [ <required> int $index ] } } - Method [ <internal:ds> public method capacity ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds> public method peek ] { + Method [ <internal:ds> public method reverse ] { - Parameters [0] { } } - Method [ <internal:ds> public method pop ] { + Method [ <internal:ds> public method reversed ] { - Parameters [0] { } + - Return [ Ds\Sequence ] } - Method [ <internal:ds> public method push ] { + Method [ <internal:ds> public method rotate ] { - Parameters [1] { - Parameter #0 [ <optional> ...$values ] - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { - - - Parameters [0] { + Parameter #0 [ <required> int $rotations ] } - - Return [ Ds\Collection ] } - Method [ <internal:ds, prototype Countable> public method count ] { - - - Parameters [0] { - } - - Return [ integer ] - } + Method [ <internal:ds> public method set ] { - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { - - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ <required> int $index ] + Parameter #1 [ <required> $value ] } - - Return [ boolean ] } - Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { + Method [ <internal:ds> public method shift ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method slice ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ <required> int $index ] + Parameter #1 [ <optional> ?int $length = <default> ] } - - Return [ array ] + - Return [ Ds\Sequence ] } - } - } - - Class [ <internal:ds> <iterateable> final class Ds\Queue implements Ds\Collection, JsonSerializable, Countable, Traversable ] { - - - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } - } - - Static properties [0] { - } - - - Static methods [0] { - } - - - Properties [0] { - } - - - Methods [12] { - Method [ <internal:ds, ctor> public method __construct ] { + Method [ <internal:ds> public method sort ] { - Parameters [1] { - Parameter #0 [ <optional> $values ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } } - Method [ <internal:ds> public method allocate ] { + Method [ <internal:ds> public method sorted ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] - } - } - - Method [ <internal:ds> public method capacity ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds> public method peek ] { - - - Parameters [0] { + Parameter #0 [ <optional> ?callable $comparator = <default> ] } + - Return [ Ds\Sequence ] } - Method [ <internal:ds> public method pop ] { + Method [ <internal:ds> public method sum ] { - Parameters [0] { } } - Method [ <internal:ds> public method push ] { + Method [ <internal:ds> public method unshift ] { - Parameters [1] { Parameter #0 [ <optional> ...$values ] } } - - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { - - - Parameters [0] { - } - - Return [ Ds\Collection ] - } - - Method [ <internal:ds, prototype Countable> public method count ] { - - - Parameters [0] { - } - - Return [ integer ] - } - - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { - - - Parameters [0] { - } - - Return [ boolean ] - } - - Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - - - Parameters [0] { - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { - - - Parameters [0] { - } - - Return [ array ] - } } } - Class [ <internal:ds> <iterateable> final class Ds\Map implements Ds\Collection, JsonSerializable, Countable, Traversable ] { + Class [ <internal:ds> <iterateable> final class Ds\Map implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } + Constant [ public int MIN_CAPACITY ] { 8 } } - Static properties [0] { @@ -1043,18 +448,18 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Properties [0] { } - - Methods [38] { + - Methods [45] { Method [ <internal:ds, ctor> public method __construct ] { - Parameters [1] { - Parameter #0 [ <optional> $values ] + Parameter #0 [ <optional> $values = <default> ] } } Method [ <internal:ds> public method allocate ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] + Parameter #0 [ <required> int $capacity ] } } @@ -1069,7 +474,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } Method [ <internal:ds> public method diff ] { @@ -1083,7 +488,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method filter ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $callback ] + Parameter #0 [ <optional> ?callable $callback = <default> ] } - Return [ Ds\Map ] } @@ -1099,7 +504,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [2] { Parameter #0 [ <required> $key ] - Parameter #1 [ <optional> $default ] + Parameter #1 [ <optional> $default = <default> ] } } @@ -1108,7 +513,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [1] { Parameter #0 [ <required> $key ] } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds> public method hasValue ] { @@ -1116,7 +521,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [1] { Parameter #0 [ <required> $value ] } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds> public method intersect ] { @@ -1137,14 +542,14 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method ksort ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } } Method [ <internal:ds> public method ksorted ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } - Return [ Ds\Map ] } @@ -1198,7 +603,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [2] { Parameter #0 [ <required> callable $callback ] - Parameter #1 [ <optional> $initial ] + Parameter #1 [ <optional> $initial = <default> ] } } @@ -1206,7 +611,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [2] { Parameter #0 [ <required> $key ] - Parameter #1 [ <optional> $default ] + Parameter #1 [ <optional> $default = <default> ] } } @@ -1226,7 +631,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method skip ] { - Parameters [1] { - Parameter #0 [ <required> integer $position ] + Parameter #0 [ <required> int $position ] } - Return [ Ds\Pair ] } @@ -1234,8 +639,8 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method slice ] { - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> integer or NULL $length ] + Parameter #0 [ <required> int $index ] + Parameter #1 [ <optional> ?int $length = <default> ] } - Return [ Ds\Map ] } @@ -1243,14 +648,14 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method sort ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } } Method [ <internal:ds> public method sorted ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } - Return [ Ds\Map ] } @@ -1284,52 +689,106 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Return [ Ds\Map ] } - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { + Method [ <internal:ds, prototype IteratorAggregate> public method getIterator ] { + + - Parameters [0] { + } + - Return [ Traversable ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetExists ] { + + - Parameters [1] { + Parameter #0 [ <required> $offset ] + } + - Return [ bool ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetGet ] { + + - Parameters [1] { + Parameter #0 [ <required> mixed $offset ] + } + - Tentative return [ mixed ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetSet ] { + + - Parameters [2] { + Parameter #0 [ <required> mixed $offset ] + Parameter #1 [ <required> mixed $value ] + } + - Tentative return [ void ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetUnset ] { + + - Parameters [1] { + Parameter #0 [ <required> mixed $offset ] + } + - Tentative return [ void ] + } + + Method [ <internal:ds> public method clear ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { + Method [ <internal:ds> public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ <internal:ds, prototype Countable> public method count ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { + Method [ <internal:ds> public method isEmpty ] { - Parameters [0] { } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - Parameters [0] { } + - Tentative return [ mixed ] } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method toArray ] { - Parameters [0] { } - Return [ array ] } + + Method [ <internal:ds> public method __serialize ] { + + - Parameters [0] { + } + - Return [ array ] + } + + Method [ <internal:ds> public method __unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $data ] + } + } } } - Class [ <internal:ds> <iterateable> final class Ds\Set implements Ds\Collection, JsonSerializable, Countable, Traversable ] { + Class [ <internal:ds> <iterateable> final class Ds\Set implements IteratorAggregate, Traversable, Countable, JsonSerializable, ArrayAccess ] { - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } + Constant [ public int MIN_CAPACITY ] { 8 } } - Static properties [0] { @@ -1341,11 +800,11 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Properties [0] { } - - Methods [30] { + - Methods [37] { Method [ <internal:ds, ctor> public method __construct ] { - Parameters [1] { - Parameter #0 [ <optional> $values ] + Parameter #0 [ <optional> $values = <default> ] } } @@ -1359,7 +818,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method allocate ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] + Parameter #0 [ <required> int $capacity ] } } @@ -1367,7 +826,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } Method [ <internal:ds> public method contains ] { @@ -1375,7 +834,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [1] { Parameter #0 [ <optional> ...$values ] } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds> public method diff ] { @@ -1389,7 +848,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method filter ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $predicate ] + Parameter #0 [ <optional> ?callable $predicate = <default> ] } - Return [ Ds\Set ] } @@ -1403,7 +862,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method get ] { - Parameters [1] { - Parameter #0 [ <required> integer $index ] + Parameter #0 [ <required> int $index ] } } @@ -1418,7 +877,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method join ] { - Parameters [1] { - Parameter #0 [ <optional> string $glue ] + Parameter #0 [ <optional> string $glue = <default> ] } } @@ -1448,7 +907,7 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [2] { Parameter #0 [ <required> callable $callback ] - Parameter #1 [ <optional> $initial ] + Parameter #1 [ <optional> $initial = <default> ] } } @@ -1475,8 +934,8 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method slice ] { - Parameters [2] { - Parameter #0 [ <required> integer $index ] - Parameter #1 [ <optional> integer or NULL $length ] + Parameter #0 [ <required> int $index ] + Parameter #1 [ <optional> ?int $length = <default> ] } - Return [ Ds\Set ] } @@ -1484,14 +943,14 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { Method [ <internal:ds> public method sort ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } } Method [ <internal:ds> public method sorted ] { - Parameters [1] { - Parameter #0 [ <optional> callable or NULL $comparator ] + Parameter #0 [ <optional> ?callable $comparator = <default> ] } - Return [ Ds\Set ] } @@ -1518,52 +977,106 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Return [ Ds\Set ] } - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { + Method [ <internal:ds, prototype IteratorAggregate> public method getIterator ] { + + - Parameters [0] { + } + - Return [ Traversable ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetExists ] { + + - Parameters [1] { + Parameter #0 [ <required> $offset ] + } + - Return [ bool ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetGet ] { + + - Parameters [1] { + Parameter #0 [ <required> mixed $offset ] + } + - Tentative return [ mixed ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetSet ] { + + - Parameters [2] { + Parameter #0 [ <required> mixed $offset ] + Parameter #1 [ <required> mixed $value ] + } + - Tentative return [ void ] + } + + Method [ <internal:ds, prototype ArrayAccess> public method offsetUnset ] { + + - Parameters [1] { + Parameter #0 [ <required> mixed $offset ] + } + - Tentative return [ void ] + } + + Method [ <internal:ds> public method clear ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { + Method [ <internal:ds> public method copy ] { - Parameters [0] { } - - Return [ Ds\Collection ] } Method [ <internal:ds, prototype Countable> public method count ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { + Method [ <internal:ds> public method isEmpty ] { - Parameters [0] { } - - Return [ boolean ] + - Return [ bool ] } Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - Parameters [0] { } + - Tentative return [ mixed ] + } + + Method [ <internal:ds> public method toArray ] { + + - Parameters [0] { + } + - Return [ array ] } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method __serialize ] { - Parameters [0] { } - Return [ array ] } + + Method [ <internal:ds> public method __unserialize ] { + + - Parameters [1] { + Parameter #0 [ <required> $data ] + } + } } } - Class [ <internal:ds> <iterateable> final class Ds\PriorityQueue implements Ds\Collection, JsonSerializable, Countable, Traversable ] { + Class [ <internal:ds> <iterateable> final class Ds\Heap implements IteratorAggregate, Traversable, Countable, JsonSerializable ] { - Constants [1] { - Constant [ public integer MIN_CAPACITY ] { 8 } + Constant [ public int MIN_CAPACITY ] { 8 } } - Static properties [0] { @@ -1575,17 +1088,19 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Properties [0] { } - - Methods [12] { + - Methods [15] { Method [ <internal:ds, ctor> public method __construct ] { - - Parameters [0] { + - Parameters [2] { + Parameter #0 [ <optional> $values = <default> ] + Parameter #1 [ <optional> ?callable $comparator = <default> ] } } Method [ <internal:ds> public method allocate ] { - Parameters [1] { - Parameter #0 [ <required> integer $capacity ] + Parameter #0 [ <required> int $capacity ] } } @@ -1593,12 +1108,13 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { - Parameters [0] { } - - Return [ integer ] + - Return [ int ] } - Method [ <internal:ds> public method peek ] { + Method [ <internal:ds> public method push ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <optional> ...$values ] } } @@ -1608,99 +1124,71 @@ Extension [ <persistent> extension #90 ds version 1.2.9 ] { } } - Method [ <internal:ds> public method push ] { - - - Parameters [2] { - Parameter #0 [ <required> $value ] - Parameter #1 [ <required> $priority ] - } - } - - Method [ <internal:ds, prototype Ds\Collection> public method clear ] { + Method [ <internal:ds> public method peek ] { - Parameters [0] { } } - Method [ <internal:ds, prototype Ds\Collection> public method copy ] { + Method [ <internal:ds, prototype IteratorAggregate> public method getIterator ] { - Parameters [0] { } - - Return [ Ds\Collection ] + - Return [ Traversable ] } - Method [ <internal:ds, prototype Countable> public method count ] { + Method [ <internal:ds> public method clear ] { - Parameters [0] { } - - Return [ integer ] } - Method [ <internal:ds, prototype Ds\Collection> public method isEmpty ] { + Method [ <internal:ds> public method copy ] { - Parameters [0] { } - - Return [ boolean ] } - Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { + Method [ <internal:ds, prototype Countable> public method count ] { - Parameters [0] { } + - Return [ int ] } - Method [ <internal:ds, prototype Ds\Collection> public method toArray ] { + Method [ <internal:ds> public method isEmpty ] { - Parameters [0] { } - - Return [ array ] + - Return [ bool ] } - } - } - - Class [ <internal:ds> final class Ds\Pair implements JsonSerializable ] { - - - Constants [0] { - } - - - Static properties [0] { - } - - - Static methods [0] { - } - - Properties [2] { - Property [ <default> public $key ] - Property [ <default> public $value ] - } - - - Methods [4] { - Method [ <internal:ds, ctor> public method __construct ] { + Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { - - Parameters [2] { - Parameter #0 [ <optional> $key ] - Parameter #1 [ <optional> $value ] + - Parameters [0] { } + - Tentative return [ mixed ] } - Method [ <internal:ds> public method copy ] { + Method [ <internal:ds> public method toArray ] { - Parameters [0] { } - - Return [ Ds\Pair ] + - Return [ array ] } - Method [ <internal:ds, prototype JsonSerializable> public method jsonSerialize ] { + Method [ <internal:ds> public method __serialize ] { - Parameters [0] { } + - Return [ array ] } - Method [ <internal:ds> public method toArray ] { + Method [ <internal:ds> public method __unserialize ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ <required> $data ] } - - Return [ array ] } } } diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0733777 --- /dev/null +++ b/composer.json @@ -0,0 +1,27 @@ +{ + "name": "php-ds/ext-ds", + "description": "An extension providing efficient internal data structures as an alternative to arrays", + "type": "php-ext", + "license": "MIT", + "keywords": [], + "authors": [ + { + "name": "Rudi Theunissen", + "email": "rudolf.theunissen@gmail.com" + } + ], + "minimum-stability": "dev", + "require": { + "php": ">= 8.2.0" + }, + "require-dev": { + "php-ds/tests": "^2.0" + }, + "scripts": { + "test" : "php test.php", + "memtest": "USE_ZEND_ALLOC=0 ZEND_DONT_UNLOAD_MODULES=1 valgrind php test.php" + }, + "php-ext": { + "extension-name": "ds" + } +} diff --git a/php-pecl-ds.spec b/php-pecl-ds.spec index 4514ec4..6cc37a5 100644 --- a/php-pecl-ds.spec +++ b/php-pecl-ds.spec @@ -1,109 +1,78 @@ -# remirepo spec file for php-pecl-ds +# remirepo spec file for php-pecl-ds2 # -# Copyright (c) 2016-2019 Remi Collet -# License: CC-BY-SA -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2016-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # -# we don't want -z defs linker flag -%undefine _strict_symbol_defs_build +%{?scl:%scl_package php-pecl-ds2} -%if 0%{?scl:1} -%scl_package php-pecl-ds -%global sub_prefix %{scl_prefix} -# No phpunit in SCL -%global with_tests 0 -%else -%global with_tests 0%{!?_without_tests:1} -%endif +%bcond_without tests -%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name ds -# After json +%global pie_vend php-ds +%global pie_proj ext-ds %global ini_name 40-%{pecl_name}.ini +%global _configure ../configure -# For test suite, see https://github.com/php-ds/tests/commits/master -%global gh_commit 31d238c463ff04b5bc8a6015b19be134175be141 -%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -%global gh_owner php-ds -%global gh_project tests +# Github forge +%global gh_vend %{pie_vend} +%global gh_proj %{pie_proj} +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag v%{version} +# for EL-8 to avoid TAG usage +%global archivename %{gh_proj}-%{version} -Summary: Data Structures for PHP -Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 1.2.9 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Summary: Data Structures for PHP version 2 +Name: %{?scl_prefix}php-pecl-%{pecl_name}2 License: MIT -URL: http://pecl.php.net/package/%{pecl_name} -Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# Only use for tests during the build, no value to be packaged separately -# in composer.json: "require-dev": { "php-ds/tests": "dev-master" } -Source1: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{gh_short}.tar.gz +Version: 2.0.0 +Release: 1%{?dist} +%forgemeta +URL: %{forgeurl} +Source0: %{forgesource} +BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7 -BuildRequires: %{?scl_prefix}php-pear -BuildRequires: %{?scl_prefix}php-gmp -BuildRequires: %{?scl_prefix}php-json -%if %{with_tests} -BuildRequires: %{_bindir}/phpunit6 -BuildRequires: %{_bindir}/phpab -%endif +BuildRequires: %{?scl_prefix}php-devel >= 8.2 Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -Requires: %{?scl_prefix}php-json%{?_isa} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} - -Provides: %{?scl_prefix}php-%{pecl_name} = %{version} -Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} -%if "%{?scl_prefix}" != "%{?sub_prefix}" -Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -%endif -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} -%if "%{php_version}" > "7.1" -Obsoletes: php71u-pecl-%{pecl_name} <= %{version} -Obsoletes: php71w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.2" -Obsoletes: php72u-pecl-%{pecl_name} <= %{version} -Obsoletes: php72w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.3" -Obsoletes: php73u-pecl-%{pecl_name} <= %{version} -Obsoletes: php73w-pecl-%{pecl_name} <= %{version} -%endif +%if 0%{?fedora} >= 45 || 0%{?rhel} >= 11 || "%{php_version}" > "8.6" +Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 2 +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +%else +# A single version can be installed +Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 2 %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter shared private -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif +# Extension +Provides: %{?scl_prefix}php-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} +# PECL +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description An extension providing specialized data structures as efficient alternatives to the PHP array. +This package provides API version 2. + Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. %prep -%setup -q -c -a 1 -mv %{pecl_name}-%{version} NTS -mv %{gh_project}-%{gh_commit} tests - -# Don't install/register tests, install examples as doc -%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml} - -cd NTS +%forgesetup # Sanity check, really often broken extver=$(sed -n '/#define PHP_DS_VERSION/{s/.* "//;s/".*$//;p}' php_ds.h) @@ -111,12 +80,8 @@ if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever:-%{prever}}. exit 1 fi -cd .. -%if %{with_zts} -# Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS -%endif +mkdir NTS # Create configuration file cat << 'EOF' | tee %{ini_name} @@ -133,115 +98,102 @@ peclbuild() { --enable-ds \ --with-php-config=$1 -make %{?_smp_mflags} +%make_build } -cd NTS -%{_bindir}/phpize -peclbuild %{_bindir}/php-config +%{__phpize} +sed -e 's/INSTALL_ROOT/DESTDIR/' -i build/Makefile.global -%if %{with_zts} -cd ../ZTS -%{_bindir}/zts-phpize -peclbuild %{_bindir}/zts-php-config -%endif +cd NTS +peclbuild %{__phpconfig} %install %{?dtsenable} -make -C NTS \ - install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} -# Install XML package description -install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -%if %{with_zts} -make -C ZTS \ - install INSTALL_ROOT=%{buildroot} +%check +: Minimal load test for NTS extension +%{__php} --no-php-ini \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep '^%{pecl_name}$' -install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} +%if %{with tests} +: Upstream test suite for NTS extension +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ +%{__php} -n run-tests.php -q --show-diff %{?_smp_mflags} %endif -# Documentation -for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i -done +%files +%license LICENSE +%doc composer.json +%doc *.md -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi +%config(noreplace) %{php_inidir}/%{ini_name} +%{php_extdir}/%{pecl_name}.so -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif +%changelog +* Tue Apr 14 2026 Remi Collet <remi@remirepo.net> - 2.0.0-1 +- update to 2.0.0 +- rename to php-pecl-ds2 +- run standard php test suite from extension sources + instead of separate tests using phpunit +- drop ZTS build +* Fri Mar 13 2026 Remi Collet <remi@remirepo.net> - 1.6.0-4 +- drop pear/pecl dependency +- sources from github -%check -modules="-d extension=json.so" +* Thu Sep 25 2025 Remi Collet <remi@remirepo.net> - 1.6.0-3 +- rebuild for PHP 8.5.0RC1 -cd NTS -: Minimal load test for NTS extension -%{__php} --no-php-ini \ - $modules \ - --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} - -%if %{with_zts} -cd ../ZTS -: Minimal load test for ZTS extension -%{__ztsphp} --no-php-ini \ - $modules \ - --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - --modules | grep %{pecl_name} -%endif -cd .. - -%if %{with_tests} -: Generate autoloader for tests -%{_bindir}/phpab \ - --output tests/autoload.php \ - tests - -: Run upstream test suite -%{_bindir}/php \ - -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - %{_bindir}/phpunit6 \ - --bootstrap tests/autoload.php \ - tests -%endif +* Wed Jul 30 2025 Remi Collet <remi@remirepo.net> - 1.6.0-2 +- rebuild for 8.5.0alpha3 +* Sat May 3 2025 Remi Collet <remi@remirepo.net> - 1.6.0-1 +- update to 1.6.0 +- re-license spec file to CECILL-2.1 -%files -%{?_licensedir:%license NTS/LICENSE} -%{!?_licensedir:%doc %{pecl_docdir}/%{pecl_name}} -%{pecl_xmldir}/%{name}.xml +* Wed Dec 20 2023 Remi Collet <remi@remirepo.net> - 1.5.0-1 +- update to 1.5.0 -%config(noreplace) %{php_inidir}/%{ini_name} -%{php_extdir}/%{pecl_name}.so +* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 1.4.0-3 +- rebuild for PHP 8.3.0RC1 -%if %{with_zts} -%config(noreplace) %{php_ztsinidir}/%{ini_name} -%{php_ztsextdir}/%{pecl_name}.so -%endif +* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 1.4.0-2 +- build out of sources tree +- add upstream patch for PHP 8.3 +* Tue Dec 14 2021 Remi Collet <remi@remirepo.net> - 1.4.0-1 +- update to 1.4.0 +- raise dependency on PHP 7.3 +- drop all patches merged upstream +- switch to phpunit8 + +* Wed Nov 3 2021 Remi Collet <remi@remirepo.net> - 1.3.0-6 +- add patches for PHP 8.1 from upstream and from + https://github.com/php-ds/ext-ds/pull/187 + +* Fri Mar 26 2021 Remi Collet <remi@remirepo.net> - 1.3.0-4 +- switch to phpunit7 + +* Tue Nov 3 2020 Remi Collet <remi@remirepo.net> - 1.3.0-2 +- fix segfault using patch from + https://github.com/php-ds/ext-ds/pull/165 + +* Wed Oct 14 2020 Remi Collet <remi@remirepo.net> - 1.3.0-1 +- update to 1.3.0 + +* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 1.2.9-2 +- rebuild for 7.4.0RC1 -%changelog * Mon May 13 2019 Remi Collet <remi@remirepo.net> - 1.2.9-1 - update to 1.2.9 |
