User Tools

Site Tools


uphp:uphp_compiler

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:uphp_compiler [2018/09/01 07:29]
jeff Hover title for graphic
uphp:uphp_compiler [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======The uPHP Compiler====== ======The uPHP Compiler======
  
-uPHP scripts are written by humans as text files. But to speed things up the Wattmon system actually executes a compiled binary version, which loads and runs much faster after the first time it is created.+uPHP scripts are written by humans as text files. But to speed things up the [[hardware:wattmons|Wattmon]] system actually executes a compiled binary version, which loads and runs much faster after the first time it is created.
  
 Mainline PHP is not a compiled language. However, uPHP is designed to run with limited memory constraints and uses a compiler to reduce requirements and speed loading and execution of scripts. Compilation is performed automatically by the firmware "in the background" as needed:  usually the programmer does not need to be concerned about this step after writing a script. Mainline PHP is not a compiled language. However, uPHP is designed to run with limited memory constraints and uses a compiler to reduce requirements and speed loading and execution of scripts. Compilation is performed automatically by the firmware "in the background" as needed:  usually the programmer does not need to be concerned about this step after writing a script.
  
-If you have spent some time looking at the files on the Wattmon you may have noticed that there are ".cgi" script files and sometimes a second version with the same name but extension ".cgc" (this is the 'cached' or 'compiled' version). You might also have noticed that there are other uPHP script files that are not of type .cgi, such as .inc files (these other types are not compiled, but they can be included in a compiled script).+If you have spent some time looking at the files on the [[hardware:wattmons|Wattmon]] you may have noticed that there are ".cgi" script files and sometimes a second version with the same name but extension ".cgc" (this is the 'cached' or 'compiled' version). You might also have noticed that there are other uPHP script files that are not of type .cgi, such as .inc files (these other types are not compiled, but they can be included in a compiled script).
  
-This page provides some practical information on when and how the uPHP Compiler works, of interest to those who are customizing the Wattmon, writing their own scripts or modifying the scripts provided with the Wattmon OS.+This page provides some practical information on when and how the uPHP Compiler works, of interest to those who are customizing the [[hardware:wattmons|Wattmon]], writing their own scripts or modifying the scripts provided with the Wattmon OS.
  
 ====When Does the Firmware Compile a Script?==== ====When Does the Firmware Compile a Script?====
Line 81: Line 81:
 In these situations, the system will run an existing .cgc without examining the .cgi text file or included file(s) for changes, so be sure to delete the corresponding .cgc file at the same time. (Note from the author of this page: I learned this "the hard way" because I didn't have this documentation at the time, which led to the creation of this page.) In these situations, the system will run an existing .cgc without examining the .cgi text file or included file(s) for changes, so be sure to delete the corresponding .cgc file at the same time. (Note from the author of this page: I learned this "the hard way" because I didn't have this documentation at the time, which led to the creation of this page.)
  
-In most cases, an easy way to delete compiled versions is to use the dropdown menu option "Clear Cache" (in the header of most displayed pages on the Wattmon):+In most cases, an easy way to delete compiled versions is to use the dropdown menu option "Clear Cache" (in the header of most displayed pages on the [[hardware:wattmons|Wattmon]]):
  
 {{ 20180420_130046_screenshot.jpg?600 |Clear Cache}} {{ 20180420_130046_screenshot.jpg?600 |Clear Cache}}
uphp/uphp_compiler.1535786960.txt.gz · Last modified: 2021/09/13 05:56 (external edit)