About External Files
Large source files such as videos and other media resources may be kept outside of the application to significantly reduce their loading times. Initially, all files compiled into the application .exe must be unpacked in memory to be accessible. This unpacking step requires time, which can be substantial for very large files.
To minimize this loading time, you can store your files externally to the application EXE file; this way, the file does not need to unpack them, only to load them.
Warning
External files must be deployed alongside the application .exe file. Therefore, using an installer for your application is the best deployment method: the installers generated by ExeOutput for PHP can include external files in the "Data" subfolder.
Keeping large amounts of files external¶
Some PHP applications may contain tens of thousands of files. Compiling these directly into your application can significantly slow it down. Keeping your files external, however, ensures that even if your application is compiled with ExeOutput for PHP, its performance remains high compared to a server-hosted environment.
Important
We recommend keeping file-heavy and non-essential directories external to the application EXE file. Directories such as "vendor" or framework dependencies, which are often open-source, do not need to be protected and can thus be stored externally.
Set a file as external¶
To designate a file as external, select it in the File Manager and click Properties. The "File Properties" window will appear; enable "Keep the selected file(s) external". ExeOutput for PHP will automatically copy the external files to the appropriate location in the "Data" subfolder.
Important
If external files already exist in the destination folders, they will be overwritten by ExeOutput for PHP if the source file is more recent than the one in the destination folder.
Encoding external PHP files for further security¶
ExeOutput for PHP allows you to encrypt external PHP files, ensuring that their contents can only be accessed by the application and remain hidden from end users.
The downside is that external files will be encrypted at each application compilation, extending the compilation time when encryption is used.
It also slightly reduces the application’s performance, as it introduces an additional decryption step that must be executed at runtime when running the external encrypted PHP scripts.
Note
A new encryption key is generated with each build of your application, preventing external encrypted PHP files from being shared between different applications.
See also File Properties Editor