fix idl/sysdoc.php
They changed their html to have an extra attribute in the `div`.
Esse commit está contido em:
+461
-4
@@ -780,8 +780,8 @@ class ArrayIterator implements ArrayAccess, SeekableIterator, Countable {
|
||||
const STD_PROP_LIST = 1;
|
||||
const ARRAY_AS_PROPS = 2;
|
||||
|
||||
public function __construct($array, $flags = 0) {
|
||||
$this->arr = $array;
|
||||
public function __construct($array = array(), $flags = 0) {
|
||||
$this->arr = (array) $array;
|
||||
$this->flags = $flags;
|
||||
reset($this->arr);
|
||||
}
|
||||
@@ -811,7 +811,7 @@ class ArrayIterator implements ArrayAccess, SeekableIterator, Countable {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function asort() {
|
||||
return asort($this->arr, $this->flags);
|
||||
return asort($this->arr);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
@@ -889,7 +889,7 @@ class ArrayIterator implements ArrayAccess, SeekableIterator, Countable {
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function ksort() {
|
||||
return ksort($this->arr, $this->flags);
|
||||
return ksort($this->arr);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
@@ -6181,6 +6181,463 @@ interface Awaitable {
|
||||
public function getWaitHandle();
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/class.arrayobject.php )
|
||||
*
|
||||
* This class allows objects to work as arrays.
|
||||
*
|
||||
*/
|
||||
class ArrayObject implements IteratorAggregate, Traversable, ArrayAccess,
|
||||
Serializable, Countable {
|
||||
|
||||
const integer STD_PROP_LIST = 1;
|
||||
const integer ARRAY_AS_PROPS = 2;
|
||||
|
||||
private $storage;
|
||||
private $flags;
|
||||
private $iteratorClass;
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/arrayobject.construct.php )
|
||||
*
|
||||
* This constructs a new array object.
|
||||
*
|
||||
* @input mixed The input parameter accepts an array or an Object.
|
||||
* @flags mixed Flags to control the behaviour of the ArrayObject
|
||||
* object. See ArrayObject::setFlags().
|
||||
* @iterator_class
|
||||
* mixed Specify the class that will be used for iteration of
|
||||
* the ArrayObject object.
|
||||
*
|
||||
* @return mixed Returns an ArrayObject object on success.
|
||||
*/
|
||||
public function __construct($input = array(),
|
||||
int $flags = 0,
|
||||
string $iterator_class = "ArrayIterator") {
|
||||
$this->storage = $input;
|
||||
$this->flags = $flags;
|
||||
$this->iteratorClass = $iterator_class;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* ( excerpt from http://php.net/manual/en/arrayobject.append.php )
|
||||
*
|
||||
* Appends a new value as the last element. Note:
|
||||
*
|
||||
* This method cannot be called when the ArrayObject was constructed from
|
||||
* an object. Use ArrayObject::offsetSet() instead.
|
||||
*
|
||||
* @value mixed The value being appended.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function append($value) {
|
||||
if (!$this->isArray()) {
|
||||
throw new Exception(
|
||||
'Cannot append properties to objects, '.
|
||||
'use ArrayObject::offsetSet() instead'
|
||||
);
|
||||
}
|
||||
$this->storage[] = $value;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.asort.php )
|
||||
*
|
||||
* Sorts the entries such that the keys maintain their correlation with
|
||||
* the entries they are associated with. This is used mainly when sorting
|
||||
* associative arrays where the actual element order is significant.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function asort() {
|
||||
return asort($this->storage);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.count.php )
|
||||
*
|
||||
* Get the number of public properties in the ArrayObject.
|
||||
*
|
||||
* @return mixed The number of public properties in the ArrayObject.
|
||||
* Note:
|
||||
*
|
||||
* When the ArrayObject is constructed from an array
|
||||
* all properties are public.
|
||||
*/
|
||||
public function count() {
|
||||
return count($this->storage);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.exchangearray.php )
|
||||
*
|
||||
* Exchange the current array with another array or object.
|
||||
*
|
||||
* @input mixed The new array or object to exchange with the current
|
||||
* array.
|
||||
*
|
||||
* @return mixed Returns the old array.
|
||||
*/
|
||||
public function exchangeArray($input) {
|
||||
$old = $this->storage;
|
||||
$this->storage = $input;
|
||||
return $old;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.getarraycopy.php )
|
||||
*
|
||||
* Exports the ArrayObject to an array.
|
||||
*
|
||||
* @return mixed Returns a copy of the array. When the ArrayObject
|
||||
* refers to an object an array of the public
|
||||
* properties of that object will be returned.
|
||||
*/
|
||||
public function getArrayCopy() {
|
||||
return (array) $this->storage;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.getflags.php )
|
||||
*
|
||||
* Gets the behavior flags of the ArrayObject. See the
|
||||
* ArrayObject::setFlags method for a list of the available flags.
|
||||
*
|
||||
* @return mixed Returns the behavior flags of the ArrayObject.
|
||||
*/
|
||||
public function getFlags() {
|
||||
return $this->flags;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.getiterator.php )
|
||||
*
|
||||
* Create a new iterator from an ArrayObject instance.
|
||||
*
|
||||
* @return mixed An iterator from an ArrayObject.
|
||||
*/
|
||||
public function getIterator() {
|
||||
$class = $this->iteratorClass;
|
||||
return new $class($this->storage, $this->flags);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.getiteratorclass.php
|
||||
* )
|
||||
*
|
||||
* Gets the class name of the array iterator that is used by
|
||||
* ArrayObject::getIterator().
|
||||
*
|
||||
* @return mixed Returns the iterator class name that is used to
|
||||
* iterate over this object.
|
||||
*/
|
||||
public function getIteratorClass() {
|
||||
return $this->iteratorClass;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.ksort.php )
|
||||
*
|
||||
* Sorts the entries by key, maintaining key to entry correlations. This
|
||||
* is useful mainly for associative arrays.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function ksort() {
|
||||
return ksort($this->storage);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.natcasesort.php )
|
||||
*
|
||||
* This method is a case insensitive version of ArrayObject::natsort.
|
||||
*
|
||||
* This method implements a sort algorithm that orders alphanumeric
|
||||
* strings in the way a human being would while maintaining key/value
|
||||
* associations. This is described as a "natural ordering".
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function natcasesort() {
|
||||
return natcasesort($this->storage);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.natsort.php )
|
||||
*
|
||||
* This method implements a sort algorithm that orders alphanumeric
|
||||
* strings in the way a human being would while maintaining key/value
|
||||
* associations. This is described as a "natural ordering". An example of
|
||||
* the difference between this algorithm and the regular computer string
|
||||
* sorting algorithms(used in ArrayObject::asort) method can be seen in
|
||||
* the example below.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function natsort() {
|
||||
return natsort($this->storage);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.offsetexists.php )
|
||||
*
|
||||
*
|
||||
* @index mixed The index being checked.
|
||||
*
|
||||
* @return mixed TRUE if the requested index exists, otherwise FALSE
|
||||
*/
|
||||
public function offsetExists($index) {
|
||||
if ($this->isArray()) {
|
||||
return isset($this->storage[$index]);
|
||||
} else {
|
||||
return property_exists($this->storage, $index);
|
||||
}
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.offsetget.php )
|
||||
*
|
||||
*
|
||||
* @index mixed The index with the value.
|
||||
*
|
||||
* @return mixed The value at the specified index or NULL.
|
||||
*/
|
||||
public function offsetGet($index) {
|
||||
if ($this->isArray()) {
|
||||
return $this->storage[$index];
|
||||
} else {
|
||||
$obj = $this->storage;
|
||||
return $obj->$index;
|
||||
}
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.offsetset.php )
|
||||
*
|
||||
* Sets the value at the specified index to newval.
|
||||
*
|
||||
* @index mixed The index being set.
|
||||
* @newval mixed The new value for the index.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function offsetSet($index, $newval) {
|
||||
if ($this->isArray()) {
|
||||
$this->storage[$index] = $newval;
|
||||
} else {
|
||||
$obj = $this->storage;
|
||||
$obj->$index = $newval;
|
||||
}
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.offsetunset.php )
|
||||
*
|
||||
* Unsets the value at the specified index.
|
||||
*
|
||||
* @index mixed The index being unset.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function offsetUnset($index) {
|
||||
if ($this->isArray()) {
|
||||
unset($this->storage[$index]);
|
||||
} else {
|
||||
$obj = $this->storage;
|
||||
unset($obj->$index);
|
||||
}
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.serialize.php )
|
||||
*
|
||||
* Serializes an ArrayObject. WarningThis function is currently not
|
||||
* documented; only its argument list is available.
|
||||
*
|
||||
* @return mixed The serialized representation of the ArrayObject.
|
||||
*/
|
||||
public function serialize() {
|
||||
return serialize(array(
|
||||
'storage' => $this->storage,
|
||||
'flags' => $this->flags,
|
||||
'iteratorClass' => $this->iteratorClass,
|
||||
));
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.setflags.php )
|
||||
*
|
||||
* Set the flags that change the behavior of the ArrayObject.
|
||||
*
|
||||
* @flags mixed The new ArrayObject behavior. It takes on either a
|
||||
* bitmask, or named constants. Using named constants
|
||||
* is strongly encouraged to ensure compatibility for
|
||||
* future versions.
|
||||
*
|
||||
* The available behavior flags are listed below. The
|
||||
* actual meanings of these flags are described in the
|
||||
* predefined constants. ArrayObject behavior flags
|
||||
* value constant 1 ArrayObject::STD_PROP_LIST 2
|
||||
* ArrayObject::ARRAY_AS_PROPS
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setFlags(int $flags) {
|
||||
$this->flags = $flags;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.setiteratorclass.php
|
||||
* )
|
||||
*
|
||||
* Sets the classname of the array iterator that is used by
|
||||
* ArrayObject::getIterator().
|
||||
*
|
||||
* @iterator_class
|
||||
* mixed The classname of the array iterator to use when
|
||||
* iterating over this object.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function setIteratorClass(string $iterator_class) {
|
||||
$this->iteratorClass = $iterator_class;
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.uasort.php )
|
||||
*
|
||||
* This function sorts the entries such that keys maintain their
|
||||
* correlation with the entry that they are associated with, using a
|
||||
* user-defined comparison function.
|
||||
*
|
||||
* This is used mainly when sorting associative arrays where the actual
|
||||
* element order is significant.
|
||||
*
|
||||
* @cmp_function
|
||||
* mixed Function cmp_function should accept two parameters
|
||||
* which will be filled by pairs of entries. The
|
||||
* comparison function must return an integer less
|
||||
* than, equal to, or greater than zero if the first
|
||||
* argument is considered to be respectively less than,
|
||||
* equal to, or greater than the second.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function uasort($cmp_function) {
|
||||
uasort($this->storage, $cmp_function);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.uksort.php )
|
||||
*
|
||||
* This function sorts the keys of the entries using a user-supplied
|
||||
* comparison function. The key to entry correlations will be maintained.
|
||||
*
|
||||
* @cmp_function
|
||||
* mixed The callback comparison function.
|
||||
*
|
||||
* Function cmp_function should accept two parameters
|
||||
* which will be filled by pairs of entry keys. The
|
||||
* comparison function must return an integer less
|
||||
* than, equal to, or greater than zero if the first
|
||||
* argument is considered to be respectively less than,
|
||||
* equal to, or greater than the second.
|
||||
*
|
||||
* @return mixed No value is returned.
|
||||
*/
|
||||
public function uksort($cmp_function) {
|
||||
uksort($this->storage, $cmp_function);
|
||||
}
|
||||
|
||||
// Do NOT modifiy this doc comment block generated by idl/sysdoc.php
|
||||
/**
|
||||
* * excerpt from http://php.net/manual/en/arrayobject.unserialize.php )
|
||||
*
|
||||
* Unserializes a serialized ArrayObject. WarningThis function is
|
||||
* currently not documented; only its argument list is available.
|
||||
*
|
||||
* @serialized mixed The serialized ArrayObject.
|
||||
*
|
||||
* @return mixed The unserialized ArrayObject.
|
||||
*/
|
||||
public function unserialize($serialized) {
|
||||
if (empty($serialized)) {
|
||||
throw new UnexpectedValueException(
|
||||
'Empty serialized string cannot be empty'
|
||||
);
|
||||
}
|
||||
$data = unserialize($serialized);
|
||||
$this->storage = $data['storage'];
|
||||
$this->flags = $data['flags'];
|
||||
$this->iteratorClass = $data['iteratorClass'];
|
||||
}
|
||||
|
||||
public function __set (string $name, $value) {
|
||||
if (!$this->hasProps()) {
|
||||
$this->$name = $value;
|
||||
} else {
|
||||
return $this->offsetSet($name, $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function __get (string $name) {
|
||||
if (!$this->hasProps()) {
|
||||
return $this->$name;
|
||||
} else {
|
||||
return $this->offsetGet($name);
|
||||
}
|
||||
}
|
||||
|
||||
public function __isset (string $name) {
|
||||
if (!$this->hasProps()) {
|
||||
return isset($this->$name);
|
||||
} else {
|
||||
return $this->offsetExists($name);
|
||||
}
|
||||
}
|
||||
|
||||
public function __unset (string $name) {
|
||||
if (!$this->hasProps()) {
|
||||
unset($this->$name);
|
||||
} else {
|
||||
return $this->offsetUnset($name);
|
||||
}
|
||||
}
|
||||
|
||||
private function isArray() {
|
||||
return is_array($this->storage);
|
||||
}
|
||||
|
||||
private function hasProps() {
|
||||
return $this->flags & self::ARRAY_AS_PROPS;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Used to represent resources
|
||||
class __resource {
|
||||
public function __toString() {
|
||||
|
||||
+6
-5
@@ -1135,7 +1135,7 @@ function phpnet_clean($text) {
|
||||
$text = preg_replace('#<div class="example-contents">.*?</div>#s',
|
||||
'<>', $text);
|
||||
$text = preg_replace('#<p class="para">#', '<>', $text);
|
||||
$text = preg_replace('#<b class="note">Note</b>:#', '', $text);
|
||||
$text = preg_replace('#<strong class="note">Note</strong>:#', '', $text);
|
||||
$text = preg_replace('#<.+?>#', '', $text);
|
||||
$text = preg_replace('#[ \t\n]+#s', ' ', $text);
|
||||
$text = preg_replace('# ?<> ?#', "\n\n", $text);
|
||||
@@ -1147,14 +1147,15 @@ function phpnet_clean($text) {
|
||||
|
||||
function phpnet_get_function_info($name, $clsname = 'function') {
|
||||
$clsname = preg_replace('#_#', '-', strtolower($clsname));
|
||||
$name = preg_replace('#_#', '-', strtolower($name));
|
||||
$name = preg_replace('#__#', '', strtolower($name));
|
||||
$name = preg_replace('#_#', '-', $name);
|
||||
$doc = @file_get_contents("http://php.net/manual/en/$clsname.$name.php");
|
||||
if ($doc === false) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$ret = array();
|
||||
if (preg_match('#<div class="refsect1 description">(.*?)'.
|
||||
if (preg_match('#<div class="refsect1 description"[^>]*>(.*?)'.
|
||||
'<div class="refsect1 #s', $doc, $m)) {
|
||||
$desc = $m[1];
|
||||
if (preg_match('#<p class="para rdfs-comment">(.*)</div>#s', $desc, $m)) {
|
||||
@@ -1162,7 +1163,7 @@ function phpnet_get_function_info($name, $clsname = 'function') {
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('#<div class="refsect1 parameters">(.*?)'.
|
||||
if (preg_match('#<div class="refsect1 parameters"[^>]*>(.*?)'.
|
||||
'<div class="refsect1 #s', $doc, $m)) {
|
||||
$desc = $m[1];
|
||||
if (preg_match_all('#<tt class="parameter">(.*?)</tt>#s', $desc, $m)) {
|
||||
@@ -1183,7 +1184,7 @@ function phpnet_get_function_info($name, $clsname = 'function') {
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('#<div class="refsect1 returnvalues">(.*?)'.
|
||||
if (preg_match('#<div class="refsect1 returnvalues"[^>]*>(.*?)'.
|
||||
'(<div class="refsect1 |<div id="usernotes">)#s', $doc, $m)) {
|
||||
$desc = $m[1];
|
||||
$desc = preg_replace('#<h3.*</h3>#', '', $desc);
|
||||
|
||||
@@ -5,9 +5,10 @@ require_once 'base.php';
|
||||
$filename = $argv[1];
|
||||
$lines = explode("\n", file_get_contents($filename));
|
||||
|
||||
$sig = '// Do NOT modifiy this doc comment block generated by idl/sysdoc.php';
|
||||
$sig = '// This doc comment block generated by idl/sysdoc.php';
|
||||
|
||||
$file = '';
|
||||
$class = 'function';
|
||||
for ($i = 0; $i < count($lines) - 1; $i++) {
|
||||
$line = $lines[$i];
|
||||
|
||||
@@ -18,7 +19,7 @@ for ($i = 0; $i < count($lines) - 1; $i++) {
|
||||
$line = $lines[++$i];
|
||||
}
|
||||
|
||||
if (preg_match('/(?:class|interface) (\w+)/', $line, $m)) {
|
||||
if (preg_match('/^\s*(?:class|interface)\s+(\w+)/', $line, $m)) {
|
||||
$class = $m[1];
|
||||
$info['name'] = $class;
|
||||
$doc = phpnet_get_class_desc($class);
|
||||
@@ -29,7 +30,7 @@ for ($i = 0; $i < count($lines) - 1; $i++) {
|
||||
$file .= get_class_doc_comments($info)."\n";
|
||||
}
|
||||
} else if (preg_match('/function /', $line)) {
|
||||
while (!preg_match('/function (\w+) *\(([^\)]*)\)/s', $line, $m)) {
|
||||
while (!preg_match('/function\s+(\w+)\s*\(([^\)]*)\)/s', $line, $m)) {
|
||||
$line .= "\n".$lines[++$i];
|
||||
}
|
||||
$func = $m[1];
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário