Open Data Catalog v2.0.0
Drupal\datastore_mysql_import\Service\MysqlImport Class Reference
Inheritance diagram for Drupal\datastore_mysql_import\Service\MysqlImport:

Protected Member Functions

 runIt ()
 
 getFirstLineFromFile (string $file_path)
 
 getEol (string $line)
 
 sanitizeHeader (string $column)
 
 truncateHeader (string $column)
 

Protected Attributes

const MAX_COLUMN_LENGTH = 64
 
const RESERVED_WORDS
 

Detailed Description

Expiremental MySQL LOAD DATA importer.

@codeCoverageIgnore

Definition at line 16 of file MysqlImport.php.

Member Function Documentation

◆ getEol()

Drupal\datastore_mysql_import\Service\MysqlImport::getEol ( string  $line)
protected

Attempt to detect the EOL character for the given line.

Parameters
string$lineLine being analyzed.
Returns
string|null The EOL character for the given line, or NULL on failure.

Definition at line 177 of file MysqlImport.php.

◆ getFirstLineFromFile()

Drupal\datastore_mysql_import\Service\MysqlImport::getFirstLineFromFile ( string  $file_path)
protected

Read the first line from the given file.

Parameters
string$file_pathFile path.
Returns
string First line from file.
Exceptions
Symfony

Definition at line 142 of file MysqlImport.php.

◆ runIt()

Drupal\datastore_mysql_import\Service\MysqlImport::runIt ( )
protected

Override.

{}

Definition at line 82 of file MysqlImport.php.

◆ sanitizeHeader()

Drupal\datastore_mysql_import\Service\MysqlImport::sanitizeHeader ( string  $column)
protected

Sanitize table column name according to the MySQL supported characters.

Parameters
string$columnThe column name being sanitized.
Returns
string Sanitized column name.

Definition at line 255 of file MysqlImport.php.

◆ truncateHeader()

Drupal\datastore_mysql_import\Service\MysqlImport::truncateHeader ( string  $column)
protected

Truncate column name if longer than the max column length for the database.

Parameters
string$columnThe column name being truncated.
Returns
string Truncated column name.

Definition at line 278 of file MysqlImport.php.

Member Data Documentation

◆ MAX_COLUMN_LENGTH

const Drupal\datastore_mysql_import\Service\MysqlImport::MAX_COLUMN_LENGTH = 64
protected

Definition at line 23 of file MysqlImport.php.

◆ RESERVED_WORDS

const Drupal\datastore_mysql_import\Service\MysqlImport::RESERVED_WORDS
protected

Definition at line 30 of file MysqlImport.php.