403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.168
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/d2m/sofident_cz/wp-content/plugins/wordpress-seo/src/builders/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/d2m/sofident_cz/wp-content/plugins/wordpress-seo/src/builders/indexable-rebuilder.php
<?php

namespace Yoast\WP\SEO\Builders;

use Exception;
use Yoast\WP\SEO\Loggers\Logger;
use Yoast\WP\SEO\Repositories\Indexable_Repository;
use YoastSEO_Vendor\Psr\Log\LogLevel;

/**
 * Rebuilder for the indexables.
 *
 * Contains methods to find and build indexables.
 */
class Indexable_Rebuilder {

	/**
	 * The indexable repository.
	 *
	 * @var Indexable_Repository
	 */
	protected $repository;

	/**
	 * The indexable builder.
	 *
	 * @var Indexable_Builder
	 */
	protected $builder;

	/**
	 * Holds the logger.
	 *
	 * @var Logger
	 */
	protected $logger;

	/**
	 * Indexable_Rebuilder constructor.
	 *
	 * @codeCoverageIgnore No point in testing this constructor without side-effects.
	 *
	 * @param Indexable_Repository $repository The repository to use.
	 * @param Indexable_Builder    $builder    The post builder to use.
	 * @param Logger               $logger     The logger.
	 */
	public function __construct( Indexable_Repository $repository, Indexable_Builder $builder, Logger $logger ) {
		$this->repository = $repository;
		$this->builder    = $builder;
		$this->logger     = $logger;
	}

	/**
	 * Rebuilds the indexables for an object type.
	 *
	 * @param string $object_type The object type.
	 */
	public function rebuild_for_type( $object_type ) {
		try {
			$indexables = $this->repository->find_all_with_type( $object_type );
			foreach ( $indexables as $indexable ) {
				$this->builder->build_for_id_and_type( $indexable->object_id, $object_type, $indexable );
			}
		} catch ( Exception $exception ) {
			$this->logger->log( LogLevel::ERROR, $exception->getMessage() );
		}
	}

	/**
	 * Rebuilds the indexables that have the given object type and sub type.
	 *
	 * @param string $object_type     The object type.
	 * @param string $object_sub_type The object sub type.
	 */
	public function rebuild_for_type_and_sub_type( $object_type, $object_sub_type ) {
		try {
			$indexables = $this->repository->find_all_with_type_and_sub_type( $object_type, $object_sub_type );
			foreach ( $indexables as $indexable ) {
				$this->builder->build_for_id_and_type( $indexable->object_id, $object_type, $indexable );
			}
		} catch ( Exception $exception ) {
			$this->logger->log( LogLevel::ERROR, $exception->getMessage() );
		}
	}

	/**
	 * Rebuilds the post type archive indexable.
	 *
	 * Note: this does build the post type archive indexable, even when it did not exist before.
	 *
	 * @param string $post_type The post type.
	 */
	public function rebuild_for_post_type_archive( $post_type ) {
		try {
			$indexable = $this->repository->find_for_post_type_archive( $post_type, false );
			$this->builder->build_for_post_type_archive( $post_type, $indexable );
		} catch ( Exception $exception ) {
			$this->logger->log( LogLevel::ERROR, $exception->getMessage() );
		}
	}

	/**
	 * Rebuilds the indexable for the date archive.
	 *
	 * Note: this does build the date archive indexable, even when it did not exist before.
	 */
	public function rebuild_for_date_archive() {
		try {
			$indexable = $this->repository->find_for_date_archive( false );
			$this->builder->build_for_date_archive( $indexable );
		} catch ( Exception $exception ) {
			$this->logger->log( LogLevel::ERROR, $exception->getMessage() );
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit