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

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 31 of file Windowseol.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 59 of file Windowseol.php.

60 {
61 }

◆ startSession()

startSession ( $pkg,
$contents,
$dest )

Replace all line endings with windows line endings

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 74 of file Windowseol.php.

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

◆ 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 44 of file Windowseol.php.

45 {
46 if ($xml != '') {
47 return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed');
48 }
49
50 return true;
51 }
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 35 of file Windowseol.php.

◆ $phase

Definition at line 34 of file Windowseol.php.

◆ $type

$type = 'simple'

Definition at line 33 of file Windowseol.php.


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