Bearsampp 2026.9.23
Loading...
Searching...
No Matches
PEAR_Task_Unixeol Class Reference
Inheritance diagram for PEAR_Task_Unixeol:
Collaboration diagram for PEAR_Task_Unixeol:

Public Member Functions

 init ($xml, $attribs, $lastVersion=null)
 startSession ($pkg, $contents, $dest)
Public Member Functions inherited from PEAR_Task_Common
 __construct (&$config, &$logger, $phase)
 isScript ()
 throwError ($msg, $code=-1)

Static Public Member Functions

static validateXml ($pkg, $xml, $config, $fileXml)
Static Public Member Functions inherited from PEAR_Task_Common
static hasPostinstallTasks ()
static run ($tasks)
static runPostinstallTasks ()

Data Fields

 $_replacements
 $phase = PEAR_TASK_PACKAGE
 $type = 'simple'
Data Fields inherited from PEAR_Task_Common
 $logger
 $phase = PEAR_TASK_INSTALL

Additional Inherited Members

Protected Attributes inherited from PEAR_Task_Common
 $config
 $installphase
 $registry
 $type = 'simple'

Detailed Description

Definition at line 30 of file Unixeol.php.

Member Function Documentation

◆ init()

init ( $xml,
$attribs,
$lastVersion = null )

Initialize a task instance with the parameters

Parameters
arrayraw, parsed xml
unused
unused

Reimplemented from PEAR_Task_Common.

Definition at line 58 of file Unixeol.php.

59 {
60 }

◆ startSession()

startSession ( $pkg,
$contents,
$dest )

Replace all line endings with line endings customized for the current OS

See validateXml() source for the complete list of allowed fields

Parameters
PEAR_PackageFile_v1|PEAR_PackageFile_v2
stringfile contents
stringthe eventual final file location (informational only)
Returns
string|false|PEAR_Error false to skip this file, PEAR_Error to fail (use $this->throwError), otherwise return the new contents

Reimplemented from PEAR_Task_Common.

Definition at line 73 of file Unixeol.php.

74 {
75 $this->logger->log(3, "replacing all line endings with \\n in $dest");
76
77 return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents);
78 }

◆ validateXml()

validateXml ( $pkg,
$xml,
$config,
$fileXml )
static

Validate the raw xml at parsing-time.

Parameters
PEAR_PackageFile_v2
arrayraw, parsed xml
PEAR_Config

Reimplemented from PEAR_Task_Common.

Definition at line 43 of file Unixeol.php.

44 {
45 if ($xml != '') {
46 return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
47 }
48
49 return true;
50 }
const PEAR_TASK_ERROR_INVALID
Definition Common.php:21

References PEAR_Task_Common\$config, and PEAR_TASK_ERROR_INVALID.

Field Documentation

◆ $_replacements

$_replacements

Definition at line 34 of file Unixeol.php.

◆ $phase

Definition at line 33 of file Unixeol.php.

◆ $type

$type = 'simple'

Definition at line 32 of file Unixeol.php.


The documentation for this class was generated from the following file:
  • E:/Bearsampp-development/sandbox/core/libs/php/pear/pear/PEAR/Task/Unixeol.php