ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBiblFileReaderBase Class Reference

Class ilBiblFileReaderBase. More...

+ Inheritance diagram for ilBiblFileReaderBase:
+ Collaboration diagram for ilBiblFileReaderBase:

Public Member Functions

 __construct (ilBiblEntryFactoryInterface $entry_factory, ilBiblFieldFactoryInterface $field_factory, ilBiblAttributeFactoryInterface $attribute_factory)
 ilBiblFileReaderBase constructor. More...
 
 getFileContent ()
 
 setFileContent ($file_content)
 
 getPathToFile ()
 
 setPathToFile ($path_to_file)
 
 getEntryFactory ()
 
Returns
ilBiblEntryFactoryInterface
More...
 
 getFieldFactory ()
 
Returns
ilBiblFieldFactoryInterface
More...
 
 getAttributeFactory ()
 @inheritDoc More...
 
- Public Member Functions inherited from ilBiblFileReaderInterface
 readContent ($path_to_file)
 
 parseContent ()
 
 getEntryFactory ()
 
 getFieldFactory ()
 
 getAttributeFactory ()
 

Data Fields

const ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH = 4000
 
const ENCODING_UTF_8 = 'UTF-8'
 
const ENCODING_ASCII = 'ASCII'
 
const ENCODING_ISO_8859_1 = 'ISO-8859-1'
 

Protected Member Functions

 convertStringToUTF8 ($string)
 

Protected Attributes

 $file_content = ''
 
 $path_to_file = ''
 
 $entry_factory
 
 $field_factory
 
 $attribute_factory
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBiblFileReaderBase::__construct ( ilBiblEntryFactoryInterface  $entry_factory,
ilBiblFieldFactoryInterface  $field_factory,
ilBiblAttributeFactoryInterface  $attribute_factory 
)

ilBiblFileReaderBase constructor.

Parameters
ilBiblEntryFactoryInterface$entry_factory

Definition at line 47 of file class.ilBiblFileReaderBase.php.

48 {
49 $this->entry_factory = $entry_factory;
50 $this->field_factory = $field_factory;
51 $this->attribute_factory = $attribute_factory;
52 }

References $attribute_factory, $entry_factory, and $field_factory.

Member Function Documentation

◆ convertStringToUTF8()

ilBiblFileReaderBase::convertStringToUTF8 (   $string)
protected
Parameters
$string
Returns
string

Definition at line 79 of file class.ilBiblFileReaderBase.php.

80 {
81 if (!function_exists('mb_detect_encoding') || !function_exists('mb_detect_order')
82 || !function_exists("mb_convert_encoding")) {
83 return $string;
84 }
85 ob_end_clean();
86 $mb_detect_encoding = mb_detect_encoding($string);
87 mb_detect_order(array( self::ENCODING_UTF_8, self::ENCODING_ISO_8859_1 ));
88 switch ($mb_detect_encoding) {
90 break;
92 $string = utf8_encode(iconv(self::ENCODING_ASCII, 'UTF-8//IGNORE', $string));
93 break;
94 default:
95 $string = mb_convert_encoding($string, self::ENCODING_UTF_8, $mb_detect_encoding);
96 break;
97 }
98
99 return $string;
100 }

References ENCODING_ASCII, and ENCODING_UTF_8.

◆ getAttributeFactory()

ilBiblFileReaderBase::getAttributeFactory ( )

@inheritDoc

Implements ilBiblFileReaderInterface.

Definition at line 213 of file class.ilBiblFileReaderBase.php.

214 {
216 }

References $attribute_factory.

◆ getEntryFactory()

ilBiblFileReaderBase::getEntryFactory ( )

Returns
ilBiblEntryFactoryInterface

Implements ilBiblFileReaderInterface.

Definition at line 196 of file class.ilBiblFileReaderBase.php.

197 {
199 }

References $entry_factory.

◆ getFieldFactory()

ilBiblFileReaderBase::getFieldFactory ( )

Returns
ilBiblFieldFactoryInterface

Implements ilBiblFileReaderInterface.

Definition at line 204 of file class.ilBiblFileReaderBase.php.

205 {
207 }

References $field_factory.

◆ getFileContent()

ilBiblFileReaderBase::getFileContent ( )
Returns
string

Definition at line 106 of file class.ilBiblFileReaderBase.php.

References $file_content.

Referenced by ilBiblTexFileReader\convertBibSpecialChars(), ilBiblTexFileReader\normalizeContent(), and ilBiblTexFileReader\parseContent().

+ Here is the caller graph for this function:

◆ getPathToFile()

ilBiblFileReaderBase::getPathToFile ( )
Returns
string

Definition at line 124 of file class.ilBiblFileReaderBase.php.

References $path_to_file.

◆ setFileContent()

ilBiblFileReaderBase::setFileContent (   $file_content)
Parameters
string$file_content

Definition at line 115 of file class.ilBiblFileReaderBase.php.

116 {
117 $this->file_content = $file_content;
118 }

References $file_content.

Referenced by ilBiblTexFileReader\convertBibSpecialChars(), and ilBiblTexFileReader\normalizeContent().

+ Here is the caller graph for this function:

◆ setPathToFile()

ilBiblFileReaderBase::setPathToFile (   $path_to_file)
Parameters
string$path_to_file

Definition at line 133 of file class.ilBiblFileReaderBase.php.

134 {
135 $this->path_to_file = $path_to_file;
136 }

References $path_to_file.

Field Documentation

◆ $attribute_factory

ilBiblFileReaderBase::$attribute_factory
protected

Definition at line 39 of file class.ilBiblFileReaderBase.php.

Referenced by __construct(), and getAttributeFactory().

◆ $entry_factory

ilBiblFileReaderBase::$entry_factory
protected

Definition at line 31 of file class.ilBiblFileReaderBase.php.

Referenced by __construct(), and getEntryFactory().

◆ $field_factory

ilBiblFileReaderBase::$field_factory
protected

Definition at line 35 of file class.ilBiblFileReaderBase.php.

Referenced by __construct(), and getFieldFactory().

◆ $file_content

ilBiblFileReaderBase::$file_content = ''
protected

Definition at line 23 of file class.ilBiblFileReaderBase.php.

Referenced by getFileContent(), and setFileContent().

◆ $path_to_file

ilBiblFileReaderBase::$path_to_file = ''
protected

Definition at line 27 of file class.ilBiblFileReaderBase.php.

Referenced by getPathToFile(), and setPathToFile().

◆ ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH

const ilBiblFileReaderBase::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH = 4000

Definition at line 16 of file class.ilBiblFileReaderBase.php.

◆ ENCODING_ASCII

const ilBiblFileReaderBase::ENCODING_ASCII = 'ASCII'

Definition at line 18 of file class.ilBiblFileReaderBase.php.

Referenced by convertStringToUTF8().

◆ ENCODING_ISO_8859_1

const ilBiblFileReaderBase::ENCODING_ISO_8859_1 = 'ISO-8859-1'

Definition at line 19 of file class.ilBiblFileReaderBase.php.

◆ ENCODING_UTF_8

const ilBiblFileReaderBase::ENCODING_UTF_8 = 'UTF-8'

Definition at line 17 of file class.ilBiblFileReaderBase.php.

Referenced by convertStringToUTF8().


The documentation for this class was generated from the following file: