ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilBiblFileReaderBase Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 ()
 
- Public Member Functions inherited from ilBiblFileReaderInterface
 readContent ($path_to_file)
 
 parseContent ()
 

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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilBiblFileReaderBase

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Constructor & Destructor Documentation

◆ __construct()

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

ilBiblFileReaderBase constructor.

Parameters
ilBiblEntryFactoryInterface$entry_factory

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

References $attribute_factory, $DIC, $entry_factory, $field_factory, $path_to_file, convertStringToUTF8(), ilBiblFileReaderInterface\readContent(), setFileContent(), and setPathToFile().

67  {
68  $this->entry_factory = $entry_factory;
69  $this->field_factory = $field_factory;
70  $this->attribute_factory = $attribute_factory;
71  }
+ Here is the call graph for this function:

Member Function Documentation

◆ convertStringToUTF8()

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

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

Referenced by __construct().

97  {
98  if (!function_exists('mb_detect_encoding') || !function_exists('mb_detect_order')
99  || !function_exists("mb_convert_encoding")
100  ) {
101  return $string;
102  }
103  ob_end_clean();
104  $mb_detect_encoding = mb_detect_encoding($string);
105  mb_detect_order(array(self::ENCODING_UTF_8, self::ENCODING_ISO_8859_1));
106  switch ($mb_detect_encoding) {
107  case self::ENCODING_UTF_8:
108  break;
109  case self::ENCODING_ASCII:
110  $string = utf8_encode(iconv(self::ENCODING_ASCII, 'UTF-8//IGNORE', $string));
111  break;
112  default:
113  $string = mb_convert_encoding($string, self::ENCODING_UTF_8, $mb_detect_encoding);
114  break;
115  }
116 
117  return $string;
118  }
+ Here is the caller graph for this function:

◆ getAttributeFactory()

ilBiblFileReaderBase::getAttributeFactory ( )

Implements ilBiblFileReaderInterface.

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

References $attribute_factory.

Referenced by setPathToFile().

+ Here is the caller graph for this function:

◆ getEntryFactory()

ilBiblFileReaderBase::getEntryFactory ( )

Returns
ilBiblEntryFactoryInterface

Implements ilBiblFileReaderInterface.

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

References $entry_factory.

Referenced by setPathToFile().

+ Here is the caller graph for this function:

◆ getFieldFactory()

ilBiblFileReaderBase::getFieldFactory ( )

◆ getFileContent()

ilBiblFileReaderBase::getFileContent ( )
Returns
string

Definition at line 123 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 139 of file class.ilBiblFileReaderBase.php.

References $path_to_file.

◆ setFileContent()

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

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

References $file_content.

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

132  {
133  $this->file_content = $file_content;
134  }
+ Here is the caller graph for this function:

◆ setPathToFile()

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

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

References Vendor\Package\$a, $entry_factory, $path_to_file, $type, getAttributeFactory(), getEntryFactory(), ilObject\getId(), ilBiblFileReaderInterface\parseContent(), ilStr\strLen(), and ilStr\subStr().

Referenced by __construct().

148  {
149  $this->path_to_file = $path_to_file;
150  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $attribute_factory

ilBiblFileReaderBase::$attribute_factory
protected

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

Referenced by __construct(), and getAttributeFactory().

◆ $entry_factory

ilBiblFileReaderBase::$entry_factory
protected

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

Referenced by __construct(), getEntryFactory(), and setPathToFile().

◆ $field_factory

ilBiblFileReaderBase::$field_factory
protected

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

Referenced by __construct(), and getFieldFactory().

◆ $file_content

ilBiblFileReaderBase::$file_content = ''
protected

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

Referenced by getFileContent(), and setFileContent().

◆ $path_to_file

ilBiblFileReaderBase::$path_to_file = ''
protected

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

Referenced by __construct(), getPathToFile(), and setPathToFile().

◆ ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH

const ilBiblFileReaderBase::ATTRIBUTE_VALUE_MAXIMAL_TEXT_LENGTH = 4000

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

◆ ENCODING_ASCII

const ilBiblFileReaderBase::ENCODING_ASCII = 'ASCII'

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

◆ ENCODING_ISO_8859_1

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

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

◆ ENCODING_UTF_8

const ilBiblFileReaderBase::ENCODING_UTF_8 = 'UTF-8'

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


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