PMA\libraries\File::getError PHP 메소드

getError() 공개 메소드

Returns possible error message.
public getError ( ) : Message | null
리턴 Message | null error message
    public function getError()
    {
        return $this->_error_message;
    }

Usage Example

예제 #1
0
} else {
    if (isset($_POST['submit_get_json'])) {
        $settings = PMA_loadUserprefs();
        $response = PMA\libraries\Response::getInstance();
        $response->addJSON('prefs', json_encode($settings['config_data']));
        $response->addJSON('mtime', $settings['mtime']);
        exit;
    } else {
        if (isset($_POST['submit_import'])) {
            // load from JSON file
            $json = '';
            if (isset($_POST['import_type']) && $_POST['import_type'] == 'text_file' && isset($_FILES['import_file']) && $_FILES['import_file']['error'] == UPLOAD_ERR_OK && is_uploaded_file($_FILES['import_file']['tmp_name'])) {
                $import_handle = new File($_FILES['import_file']['tmp_name']);
                $import_handle->checkUploadedFile();
                if ($import_handle->isError()) {
                    $error = $import_handle->getError();
                } else {
                    // read JSON from uploaded file
                    $json = $import_handle->getRawContent();
                }
            } else {
                // read from POST value (json)
                $json = isset($_POST['json']) ? $_POST['json'] : null;
            }
            // hide header message
            $_SESSION['userprefs_autoload'] = true;
            $config = json_decode($json, true);
            $return_url = isset($_POST['return_url']) ? $_POST['return_url'] : null;
            if (!is_array($config)) {
                if (!isset($error)) {
                    $error = __('Could not import configuration');
All Usage Examples Of PMA\libraries\File::getError