first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
/**
* @author OnTheGo Systems
*/
class WPML_XML_Config_Read_File implements WPML_XML_Config_Read {
private $file_full_path;
private $transform;
private $validate;
function __construct( $file_full_path, WPML_XML_Config_Validate $validate, WPML_XML_Transform $transform ) {
$this->file_full_path = $file_full_path;
$this->validate = $validate;
$this->transform = $transform;
}
function get() {
if ( file_exists( $this->file_full_path ) && $this->validate->from_file( $this->file_full_path ) ) {
$xml = file_get_contents( $this->file_full_path );
return $this->transform->get( $xml );
}
return null;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* @author OnTheGo Systems
*/
class WPML_XML_Config_Read_Option implements WPML_XML_Config_Read {
private $option;
private $transform;
private $validate;
/**
* WPML_XML_Config_Read_Option constructor.
*
* @param \WPML_WP_Option $option
* @param \WPML_XML_Config_Validate $validate
* @param \WPML_XML_Transform $transform
*/
function __construct( WPML_WP_Option $option, WPML_XML_Config_Validate $validate, WPML_XML_Transform $transform ) {
$this->option = $option;
$this->validate = $validate;
$this->transform = $transform;
}
function get() {
if ( $this->option->get() ) {
$content = $this->option->get();
if ( $this->validate->from_string( $content ) ) {
return $this->transform->get( $content );
}
}
return null;
}
}

View File

@@ -0,0 +1,7 @@
<?php
/**
* @author OnTheGo Systems
*/
interface WPML_XML_Config_Read {
}