Changeset 221

Show
Ignore:
Timestamp:
08/21/07 00:57:09 (1 year ago)
Author:
hans
Message:

ticket:72 - Replace Phing::getProperty("line.separator") with PHP_EOL

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/INSTALL.UNIX

    r123 r221  
    1515 
    1616  At this point we assume you have a running Linux or other UNIX dialect with 
    17   a properly installed release of PHP5.0.1+. You need the CLI version of PHP, 
     17  a properly installed release of PHP 5.0.2+. You need the CLI version of PHP, 
    1818  since there is no WEB-Application for Phing provided, and the ISAPI module 
    1919  will not work on command line. The PHP binary must have compiled-in XML 
  • trunk/INSTALL.WIN32

    r123 r221  
    1313 
    1414  At this point we assume you have a running Windows NT/2000/XP system  
    15   running and you properly installed PHP5.0.1+. Windows 9x versions will 
     15  running and you properly installed PHP 5.0.2+. Windows 9x versions will 
    1616  probably work, but are not supported. Make sure that XSL is enabled (e.g. 
    1717  enable php_xsl.dll in your php.ini file) if you want to perform builds  
  • trunk/classes/phing/Phing.php

    r218 r221  
    406406 
    407407        if ($filename !== null && self::$msgOutputLevel >= Project::MSG_VERBOSE) { 
    408                 self::$out->write("Searching in $filename" . self::getProperty("line.separator")); 
     408                self::$out->write("Searching in $filename" . PHP_EOL); 
    409409        } 
    410410 
     
    428428    private function _findBuildFile($start, $suffix) { 
    429429        if (self::$msgOutputLevel >= Project::MSG_INFO) { 
    430                 self::$out->write("Searching for $suffix ..." . self::getProperty("line.separator")); 
     430                self::$out->write("Searching for $suffix ..." . PHP_EOL); 
    431431        } 
    432432        $startf = new PhingFile($start); 
     
    731731    /**  Prints the usage of how to use this class */ 
    732732    public static function printUsage() { 
    733         $lSep = self::getProperty("line.separator"); 
     733         
    734734        $msg = ""; 
    735         $msg .= "phing [options] [target [target2 [target3] ...]]" . $lSep
    736         $msg .= "Options: " . $lSep
    737         $msg .= "  -h -help               print this message" . $lSep
    738         $msg .= "  -l -list               list available targets in this project" . $lSep
    739         $msg .= "  -v -version            print the version information and exit" . $lSep
    740         $msg .= "  -q -quiet              be extra quiet" . $lSep
    741         $msg .= "  -verbose               be extra verbose" . $lSep
    742         $msg .= "  -debug                 print debugging information" . $lSep
    743         $msg .= "  -logfile <file>        use given file for log" . $lSep
    744         $msg .= "  -logger <classname>    the class which is to perform logging" . $lSep
    745         $msg .= "  -f -buildfile <file>   use given buildfile" . $lSep
    746         $msg .= "  -D<property>=<value>   use value for given property" . $lSep
    747         $msg .= "  -find <file>           search for buildfile towards the root of the" . $lSep
    748         $msg .= "                         filesystem and use it" . $lSep
    749         //$msg .= "  -recursive <file>      search for buildfile downwards and use it" . $lSep
    750         $msg .= $lSep
    751         $msg .= "Report bugs to <dev@phing.tigris.org>".$lSep
     735        $msg .= "phing [options] [target [target2 [target3] ...]]" . PHP_EOL
     736        $msg .= "Options: " . PHP_EOL
     737        $msg .= "  -h -help               print this message" . PHP_EOL
     738        $msg .= "  -l -list               list available targets in this project" . PHP_EOL
     739        $msg .= "  -v -version            print the version information and exit" . PHP_EOL
     740        $msg .= "  -q -quiet              be extra quiet" . PHP_EOL
     741        $msg .= "  -verbose               be extra verbose" . PHP_EOL
     742        $msg .= "  -debug                 print debugging information" . PHP_EOL
     743        $msg .= "  -logfile <file>        use given file for log" . PHP_EOL
     744        $msg .= "  -logger <classname>    the class which is to perform logging" . PHP_EOL
     745        $msg .= "  -f -buildfile <file>   use given buildfile" . PHP_EOL
     746        $msg .= "  -D<property>=<value>   use value for given property" . PHP_EOL
     747        $msg .= "  -find <file>           search for buildfile towards the root of the" . PHP_EOL
     748        $msg .= "                         filesystem and use it" . PHP_EOL
     749        //$msg .= "  -recursive <file>      search for buildfile downwards and use it" . PHP_EOL
     750        $msg .= PHP_EOL
     751        $msg .= "Report bugs to <dev@phing.tigris.org>".PHP_EOL
    752752        self::$err->write($msg); 
    753753    } 
     
    757757     */ 
    758758    public static function printVersion() { 
    759         self::$out->write(self::getPhingVersion().self::getProperty("line.separator")); 
     759        self::$out->write(self::getPhingVersion().PHP_EOL); 
    760760    } 
    761761         
     
    789789    public static function printDescription(Project $project) { 
    790790        if ($project->getDescription() !== null) { 
    791             self::$out->write($project->getDescription() . self::getProperty("line.separator")); 
     791            self::$out->write($project->getDescription() . PHP_EOL); 
    792792        } 
    793793    } 
     
    871871     */ 
    872872    private function _printTargets($names, $descriptions, $heading, $maxlen) { 
    873         $lSep = self::getProperty("line.separator"); 
     873         
    874874        $spaces = '  '; 
    875875        while (strlen($spaces) < $maxlen) { 
     
    877877        } 
    878878        $msg = ""; 
    879         $msg .= $heading . $lSep
    880         $msg .= str_repeat("-",79) . $lSep
     879        $msg .= $heading . PHP_EOL
     880        $msg .= str_repeat("-",79) . PHP_EOL
    881881 
    882882        $total = count($names); 
     
    888888                $msg .= $descriptions[$i]; 
    889889            } 
    890             $msg .= $lSep
     890            $msg .= PHP_EOL
    891891        } 
    892892        if ($total > 0) { 
    893           self::$out->write($msg . $lSep); 
     893          self::$out->write($msg . PHP_EOL); 
    894894        } 
    895895   } 
     
    959959            // really where speed matters more. 
    960960             
    961             $curr_parts = explode(PATH_SEPARATOR, ini_get('include_path')); 
     961            $curr_parts = explode(PATH_SEPARATOR, get_include_path()); 
    962962            $add_parts = explode(PATH_SEPARATOR, $classpath); 
    963963            $new_parts = array_diff($add_parts, $curr_parts); 
    964964            if ($new_parts) { 
    965                 ini_set('include_path', implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts))); 
     965                set_include_path(implode(PATH_SEPARATOR, array_merge($new_parts, $curr_parts))); 
    966966            } 
    967967        } 
     
    986986         
    987987        if (self::$importPaths === null) { 
    988             $paths = ini_get("include_path");             
     988            $paths = get_include_path();           
    989989            self::$importPaths = explode(PATH_SEPARATOR, ini_get("include_path")); 
    990990        } 
     
    10801080        self::setProperty('user.home', getenv('HOME')); 
    10811081        self::setProperty('application.startdir', getcwd()); 
    1082         self::setProperty('line.separator', "\n"); 
    10831082 
    10841083        // try to detect machine dependent information 
     
    11301129    /** 
    11311130     * Returns property value for a System property. 
    1132      * System properties are "global" properties like line.separator, 
     1131     * System properties are "global" properties like application.startdir, 
    11331132     * and user.dir.  Many of these correspond to similar properties in Java 
    11341133     * or Ant. 
     
    11801179         
    11811180        if (defined('PHP_CLASSPATH')) { 
    1182             $success = ini_set('include_path', PHP_CLASSPATH); 
     1181            $success = set_include_path(PHP_CLASSPATH); 
    11831182        } else { 
    11841183            // don't do anything, just assume that include_path has been properly set. 
  • trunk/classes/phing/listener/AnsiColorLogger.php

    r147 r221  
    229229            } 
    230230             
    231             $stream->write($message . $this->lSep); 
     231            $stream->write($message . PHP_EOL); 
    232232        } 
    233233    } 
  • trunk/classes/phing/listener/DefaultLogger.php

    r147 r221  
    5555     */ 
    5656    protected $startTime; 
    57  
    58     /** 
    59      *  Char that should be used to seperate lines. Default is the system 
    60      *  property <em>line.seperator</em>. 
    61      *  @var string 
    62      */ 
    63     protected $lSep; 
    6457     
    6558    /** 
     
    7770     */ 
    7871    public function __construct() { 
    79         $this->lSep = Phing::getProperty("line.separator"); 
     72        
    8073    } 
    8174 
     
    148141        $error = $event->getException(); 
    149142        if ($error === null) { 
    150             $msg = $this->lSep . $this->getBuildSuccessfulMessage() . $this->lSep
     143            $msg = PHP_EOL . $this->getBuildSuccessfulMessage() . PHP_EOL
    151144        } else { 
    152             $msg = $this->lSep . $this->getBuildFailedMessage() . $this->lSep
     145            $msg = PHP_EOL . $this->getBuildFailedMessage() . PHP_EOL
    153146            if (Project::MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) { 
    154                 $msg .= $error->__toString().$this->lSep
     147                $msg .= $error->__toString().PHP_EOL
    155148            } else { 
    156149                $msg .= $error->getMessage(); 
    157150            } 
    158151        } 
    159         $msg .= $this->lSep . "Total time: " .self::formatTime(Phing::currentTimeMillis() - $this->startTime) . $this->lSep
     152        $msg .= PHP_EOL . "Total time: " .self::formatTime(Phing::currentTimeMillis() - $this->startTime) . PHP_EOL
    160153         
    161154        if ($error === null) { 
     
    191184    public function targetStarted(BuildEvent $event) { 
    192185        if (Project::MSG_INFO <= $this->msgOutputLevel) { 
    193                 $msg = $this->lSep . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . $this->lSep
     186                $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . PHP_EOL
    194187                $this->printMessage($msg, $this->out, $event->getPriority()); 
    195188        } 
     
    281274     */ 
    282275    protected function printMessage($message, OutputStream $stream, $priority) { 
    283         $stream->write($message . $this->lSep); 
     276        $stream->write($message . PHP_EOL); 
    284277    }     
    285278} 
  • trunk/classes/phing/listener/NoBannerLogger.php

    r147 r221  
    5050                 
    5151                if ($this->targetName !== null) { 
    52                         $msg = $this->lSep . $event->getProject()->getName() . ' > ' . $this->targetName . ':' . $this->lSep
     52                        $msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $this->targetName . ':' . PHP_EOL
    5353                        $this->printMessage($msg, $this->out, $event->getPriority()); 
    5454                        $this->targetName = null; 
  • trunk/classes/phing/system/io/BufferedWriter.php

    r147 r221  
    5151     
    5252    public function newLine() { 
    53         $this->write(Phing::getProperty('line.separator')); 
     53        $this->write(PHP_EOL); 
    5454    } 
    5555     
  • trunk/classes/phing/system/util/Properties.php

    r147 r221  
    156156            $fw = new FileWriter($file); 
    157157            if ($header !== null) { 
    158                 $fw->write( "# " . $header . Phing::getProperty("line.separator") ); 
     158                $fw->write( "# " . $header . PHP_EOL ); 
    159159            } 
    160160            $fw->write($this->toString()); 
  • trunk/classes/phing/tasks/ext/CreoleSQLExecTask.php

    r144 r221  
    474474     */ 
    475475    protected function printResults($out = null) { 
    476         $lSep = Phing::getProperty('line.separator'); 
     476         
    477477        $rs = null;         
    478478        do { 
     
    500500                            $out->newLine(); 
    501501                        } else { 
    502                             print($line.$lSep); 
     502                            print($line.PHP_EOL); 
    503503                        } 
    504504                        $line = ""; 
     
    525525                        $out->newLine(); 
    526526                    } else {                     
    527                         print($line . $lSep); 
     527                        print($line . PHP_EOL); 
    528528                    } 
    529529                    $line = ""; 
     
    532532            } 
    533533        } while ($this->statement->getMoreResults()); 
    534         print($lSep); 
     534        print(PHP_EOL); 
    535535        if ($out !== null) $out->newLine(); 
    536536    } 
  • trunk/classes/phing/tasks/ext/PDOSQLExecTask.php

    r144 r221  
    449449     */ 
    450450    protected function printResults($out = null) { 
    451         $lSep = Phing::getProperty('line.separator'); 
     451 
    452452        $rs = null;         
    453453           
     
    472472                        $out->newLine(); 
    473473                    } else { 
    474                         print($line.$lSep); 
     474                        print($line.PHP_EOL); 
    475475                    } 
    476476                    $line = ""; 
     
    497497                    $out->newLine(); 
    498498                } else {                     
    499                     print($line . $lSep); 
     499                    print($line . PHP_EOL); 
    500500                } 
    501501                $line = ""; 
     
    504504        } 
    505505 
    506         print($lSep); 
     506        print(PHP_EOL); 
    507507        if ($out !== null) $out->newLine(); 
    508508    } 
  • trunk/classes/phing/tasks/system/CvsPassTask.php

    r144 r221  
    101101                while (($line = $reader->readLine()) !== null) { 
    102102                    if (!StringHelper::startsWith($this->cvsRoot, $line)) { 
    103                         $buf .= $line . Phing::getProperty("line.separator")
     103                        $buf .= $line . PHP_EOL
    104104                    } 
    105105                } 
  • trunk/classes/phing/tasks/system/CvsTask.php

    r144 r221  
    209209                throw new BuildException("cvs exited with error code " 
    210210                                         . $retCode  
    211                                          . Phing::getProperty("line.separator") 
     211                                         . PHP_EOL 
    212212                                         . "Command line was [" 
    213213                                         . $toExecute->describeCommand() . "]", $this->getLocation()); 
  • trunk/classes/phing/types/Commandline.php

    r123 r221  
    358358            $buf .= "s"; 
    359359        } 
    360         $buf .= ":" . Phing::getProperty("line.separator")
     360        $buf .= ":" . PHP_EOL
    361361        for ($i = $offset, $alen=count($args); $i < $alen; $i++) { 
    362             $buf .= "'" . $args[$i] . "'" . Phing::getProperty("line.separator")
     362            $buf .= "'" . $args[$i] . "'" . PHP_EOL
    363363        } 
    364364        $buf .= self::DISCLAIMER; 
  • trunk/docs/phing_guide/book/chapters/Setup.html

    r214 r221  
    5858  <tbody> 
    5959    <tr> 
    60       <td>PHP 5.0.1+</td> 
     60      <td>PHP 5.0.2+</td> 
    6161      <td>Execution</td> 
    6262      <td><a href="http://www.php.net">http://www.php.net</a></td> 
     
    6868    </tr> 
    6969    <tr> 
    70       <td>Xdebug 2.0.0b2+</td> 
     70      <td>Xdebug 2.0.0+</td> 
    7171      <td>Additional functionality</td> 
    7272      <td><a href="http://www.xdebug.org">http://www.xdebug.org</a></td>