I am using the following code to convert files from php to html. In order for it to work, I have to enter the name of each file on the second line.
p "convert files"
%w(file1 file2 file3).each do |name|
system %(php #{DIR}/#{name}.php > #{DIR2}/#{name}.htm)
end
Can someone tell me how to make it so it will automatically find any .php files in the main directory and look in any defined folder and their sub-folders for additional .php and save them in similar folder names?
For example:
file1.php -> file1.htm
about-us/file2.php -> about-us/file2.htm
contact-us/department/file3.php -> contact-us/department/file3.htm