PHP Classes

File: bin/peol

Recommend this page to a friend!
  Classes of Michael Cummings   PHP EOL Conversion   bin/peol   Download  
File: bin/peol
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP EOL Conversion
Convert the end of line characters of given files
Author: By
Last change:
Date: 6 years ago
Size: 2,275 bytes


Class file image Download
#!/usr/bin/env php
 * Contains PhpEOL cli console.
 * PHP version 5.3
 * This file is part of PhpEOL which is a simple Non-OS specific PHP script to
 * change line endings on a group of files.
 * Copyright (C) 2014 Michael Cummings
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option)
 * any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 * You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
 * <>.
 * You should be able to find a copy of this license in the file. A copy of the GNU GPL should also be
 * available in the file.
 * @copyright 2014 Michael Cummings
 * @license GNU LGPL
 * @author Michael Cummings <>
namespace peol;

 * Find auto loader from one of
 * vendor/bin/
 * OR ./
 * OR bin/
 * OR lib/PhpEOL/
 * OR vendor/PhpEOL/PhpEOL/bin/
(@include_once dirname(__DIR__) . '/autoload.php')
|| (@include_once
__DIR__ . '/vendor/autoload.php')
|| (@include_once
dirname(__DIR__) . '/vendor/autoload.php')
|| (@include_once
dirname(dirname(__DIR__)) . '/vendor/autoload.php')
|| (@include_once
dirname(dirname(dirname(__DIR__))) . '/autoload.php')
|| die(
'Could not find required auto class loader. Aborting ...');

$cwd = getcwd();
$converter = new Converter();
$application = new Application('Php End Of Line (peol) Converter', '0.0.1');
$application->add(new ToUnixCommand('EolToUnix', $cwd, $converter));
$application->add(new ToWinCommand('EolToWin', $cwd, $converter));
$application->add(new ToOldMacCommand('EolToOldMac', $cwd, $converter));