PHP Classes

File: tests/Generates.php

Recommend this page to a friend!
  Classes of Max Base   PHP Auto Style Fixer   tests/Generates.php   Download  
File: tests/Generates.php
Role: Example script
Content type: text/plain
Description: Create Generates.php
Class: PHP Auto Style Fixer
Beautify PHP source code fixing its style
Author: By
Last change:
Date: 3 years ago
Size: 478 bytes
 

Contents

Class file image Download
<?php
// https://github.com/BaseMax/PHPAS
include "../PHPAS.php";

$dir = './php/';
if(
$files = opendir($dir)) {
   
$index=1;
    while(
false !== ($file = readdir($files))) {
        if(
$file != "." && $file != "..") {
           
$AS=new PHPAutoStyle();
           
$AS->loadFile($dir . $file);
           
$output_filename="output/". $file;
           
// print_r($AS->result);
           
file_put_contents($output_filename, $AS->result);
            print
"[$index]=> $output_filename created!\n";
           
$index++;
        }
    }
   
closedir($files);
}