Arrrg... passtrhu('cls'); works but do not clear the screen... only outputs this charancter: ♀
So, how can i clean all lines of console?... i know the trick to print 10000 empty lines, but i would preffer a better way than that.
I can not beleve there is no way to do such easy task... on PHP. It would then be impossible to create PHP applications with menus, interactive, etc... and there is also a GUI-PHP (Graphical applications programed on PHP language)... i only need PHP for batch console scripts (by the moment), maybe on a near future i will learn how to create with PHP some graphical windows and applications... i actually sue Delphi, Lazarus, etc... when i will have more knonledge on PHP i will try PHP-GSDK... etc.
First thing i need is a way to do this tasks:
-Read Directory entries for a real path and create an array with names
-Iterate such array
-Call an executable with some parameters (one of them the array item)
-End iteration
-Detect system (Windows or Linux) just to call the correct executable and pass the correct arguments in the correct orther (Linux version differ a little form Windows version)
-etc...
Need some help.
The script i want to create... i have it done in CMD batch (windows version) and in Bash (Linux version)... but i want to convert them to justo only one (in PHP).
The general idea of the script is to let an executable treat each file on a directory... imagine this: extract each episode from a DVD-Video and convert it to H.264/AAC dual... and name file following a pattern S##E###.mp4 ... i need some code to detect where the episodes are on DVD-Video (calling such executable with some arguments give me such info)... parse that info, extract the info i want... (where is English audio stream, etc...) and create a command line that will do the conversion, then run it
As you can see not an easy task... since i like to control by my self the quality ans final size... i can not use any application for that... i must use scripts... worst for that... i use more than on PC to do the job in parallel (distributed computation) so less easy to find an application as i need / want to... so i create my own scripts... and use a Linux NFS central filesystem over a 100Mbit/s LAN... etc...
Too much complicated to explain it here as you can see!!!
So i start by first step, then will continue with the next step, etc... i do not want to jump before knowing how to stay up!!!
Thats why i ask for the very first thing i need... clear the screen, just because it is the first sentence of my script.
Next i will echo some literal not variable text (php echo command with fixed strings).
Next i need to know how to read directoies.... but i think it would be the same as i do for WebServers scripts i had allready created... so i can imagine how to get them to work!!!
Next i will need to call an executable... and such i do not know how to do it...
Next i will need to know if the system is Windows or Linux... just to create such command properly... windows version differs on name and arguments than Linux version of the executable i want to run to extract the info i need.
Next i need to read a file (generated by the execution of such command), i imagine there is not much difference on PHP command line than on WebServer versions, and i know for WebServers how to read, write, create and delete files and folders... so maybe similar code.
So will all in mind i just need to know how to do this three things, just to start:
-PHP clear console code
-PHP detect system (Windows or Linux) code
-PHP call an executable (Windows version on WIndows and Linux version on Linux) with arguments
Thanks in advance for any help.
P.D.: I preffer a direct answer, but i will also appreciate much a tutorial link about PHP console applications, thanks!