https://t.me/AnonymousX5
Server : Apache
System : Linux ls31.server.ly 3.10.0-962.3.2.lve1.5.68.el7.x86_64 #1 SMP Wed Apr 6 11:12:23 UTC 2022 x86_64
User : medchoco ( 2906)
PHP Version : 8.3.16
Disable Function : mail
Directory :  /home/medchoco/public_html/wp-content/plugins/jetpack-boost-git/app/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/medchoco/public_html/wp-content/plugins/jetpack-boost-git/app/lib/class-collection.php
<?php

namespace Automattic\Jetpack_Boost\Lib;

/**
 * A collection of WordPress options that's stored as a single ar
 */
class Collection {

	private $key;

	/**
	 * Collections imply that they may carry more data than regular options,
	 * This might unnecessarily slow down sites.
	 * Disable autoloading by default.
	 *
	 * @see autoload() to enable autoloading.
	 */
	private $autoload = false;

	/**
	 * @param string $key Collection key.
	 */
	public function __construct( $key ) {
		$this->key = $key;
	}

	/*
	 * Allow autoloading collections
	 */
	public function autoload() {
		$this->autoload = true;
		return $this;
	}

	/**
	 * Get the whole collection
	 *
	 * @return array
	 */
	public function get() {
		$result = get_option( $this->key, array() );
		if ( is_array( $result ) ) {
			return $result;
		}
		return array();
	}

	/**
	 * Append a single item to the collection
	 *
	 * @param $item
	 *
	 * @return bool
	 */
	public function append( $item ) {
		$items = $this->get();

		if ( ! in_array( $item, $items, true ) ) {
			$items[] = $item;
			return update_option( $this->key, $items, $this->autoload );
		}

		return false;
	}

	/**
	 * Delete the whole collection
	 *
	 * @return bool
	 */
	public function delete() {
		return delete_option( $this->key );
	}
}

https://t.me/AnonymousX5 - 2025