feat: initial ACRIB WordPress deployment
- WordPress 6.9.4 (es_ES) with Kadence theme - Homepage: Hero, La Asociación, Pilares, Beneficios, Eventos, Miembros, Hazte Miembro, Contacto - Brand identity: #13294b navy, #a12932 burgundy, #c69c48 gold - Fonts: Raleway (headings) + Source Sans 3 (body) + Lato (UI) - Plugins: Kadence Blocks, Polylang, Contact Form 7 - Custom CSS with full brand styling and responsive layout - HTTPS enforced via wp-config.php proxy detection
This commit is contained in:
221
wp-includes/sodium_compat/src/PHP52/SplFixedArray.php
Normal file
221
wp-includes/sodium_compat/src/PHP52/SplFixedArray.php
Normal file
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
|
||||
if (class_exists('SplFixedArray')) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SplFixedArray class provides the main functionalities of array. The
|
||||
* main differences between a SplFixedArray and a normal PHP array is that
|
||||
* the SplFixedArray is of fixed length and allows only integers within
|
||||
* the range as indexes. The advantage is that it allows a faster array
|
||||
* implementation.
|
||||
*/
|
||||
class SplFixedArray implements Iterator, ArrayAccess, Countable
|
||||
{
|
||||
/** @var array<int, mixed> */
|
||||
private $internalArray = array();
|
||||
|
||||
/** @var int $size */
|
||||
private $size = 0;
|
||||
|
||||
/**
|
||||
* SplFixedArray constructor.
|
||||
* @param int $size
|
||||
*/
|
||||
public function __construct($size = 0)
|
||||
{
|
||||
$this->size = $size;
|
||||
$this->internalArray = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
ksort($this->internalArray);
|
||||
return (array) $this->internalArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $array
|
||||
* @param bool $save_indexes
|
||||
* @return SplFixedArray
|
||||
* @psalm-suppress MixedAssignment
|
||||
*/
|
||||
public static function fromArray(array $array, $save_indexes = true)
|
||||
{
|
||||
$self = new SplFixedArray(count($array));
|
||||
if($save_indexes) {
|
||||
foreach($array as $key => $value) {
|
||||
$self[(int) $key] = $value;
|
||||
}
|
||||
} else {
|
||||
$i = 0;
|
||||
foreach (array_values($array) as $value) {
|
||||
$self[$i] = $value;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $self;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function getSize()
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $size
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function setSize($size)
|
||||
{
|
||||
$this->size = $size;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int $index
|
||||
* @return bool
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetExists($index)
|
||||
{
|
||||
return array_key_exists((int) $index, $this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int $index
|
||||
* @return mixed
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetGet($index)
|
||||
{
|
||||
/** @psalm-suppress MixedReturnStatement */
|
||||
return $this->internalArray[(int) $index];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int $index
|
||||
* @param mixed $newval
|
||||
* @psalm-suppress MixedAssignment
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetSet($index, $newval)
|
||||
{
|
||||
$this->internalArray[(int) $index] = $newval;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|int $index
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function offsetUnset($index)
|
||||
{
|
||||
unset($this->internalArray[(int) $index]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rewind iterator back to the start
|
||||
* @link https://php.net/manual/en/splfixedarray.rewind.php
|
||||
* @return void
|
||||
* @since 5.3.0
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
reset($this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current array entry
|
||||
* @link https://php.net/manual/en/splfixedarray.current.php
|
||||
* @return mixed The current element value.
|
||||
* @since 5.3.0
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
/** @psalm-suppress MixedReturnStatement */
|
||||
return current($this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current array index
|
||||
* @return int The current array index.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function key()
|
||||
{
|
||||
return key($this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next()
|
||||
{
|
||||
next($this->internalArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the array contains more elements
|
||||
* @link https://php.net/manual/en/splfixedarray.valid.php
|
||||
* @return bool true if the array contains any more elements, false otherwise.
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function valid()
|
||||
{
|
||||
if (empty($this->internalArray)) {
|
||||
return false;
|
||||
}
|
||||
$result = next($this->internalArray) !== false;
|
||||
prev($this->internalArray);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return $this->internalArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing.
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
// NOP
|
||||
}
|
||||
|
||||
public function __serialize()
|
||||
{
|
||||
return array_values($this->internalArray);
|
||||
}
|
||||
|
||||
public function __unserialize(array $data)
|
||||
{
|
||||
$length = count($data);
|
||||
$values = array_values($data);
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$this->internalArray[$i] = $values[$i];
|
||||
}
|
||||
$this->size = $length;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user