As soon as I found out about the phar executable PHP archives, I immediately wanted to try them. Developers, and on Habré, this good was pretty well advertised. There was information that the use of archives + APC gives a performance increase of 6 times.
Charged with this statement, I wanted to check everything in practice, not just an example from the documentation, but an example from life. Since I am developing on yii, yii was chosen as a guinea pig. Honestly, there were many attempts to create an archive (yii), but all of them were not working until the last moment. I’ll say right away that the archive collection script is not mine, but a person named Rasmus Schultz, for which he is very grateful! I just made minor minor changes.
Expected from the phar'a claimed 6x increase, but in practice, in combat conditions, the result is more earthly. So, I tested on 6 different machines + on a local machine. On 5 out of 6 earned, on 3 of them without any problems. As the developers have said, it is useless to use archives without APC, in any case, as practice has shown. The speed and memory consumption increase slightly. With APC, the increase in speed is on average 20-40%, and memory consumption -10%.
phar archive yii framework can be downloaded
here
')
How to use
It's simple, download, put the archive where you have a folder with the framework.
In index.php we replace your framework connection with:
$yii="phar://".dirname(dirname(FILE)).'/yii.phar/yii.php'; $yii="phar://".dirname(dirname(FILE)).'/yii.phar/yiilite.php';
(for the directory structure out of the box, change the path to your own)
In principle, everything.
If an error occurs like:
asset "phar:///home/yoyoCMF/yii.phar/web/js/source" .
we register in a config
'clientScript'=>array ( ...
I haven't had any other problems with using the framework file.
PS: I don't see any point in describing which machines were tested, php version 5.3.2, 5.3.5, 5.3.8, 5.4.4, 5.4.6.
In the archive yii framework 1.1.12.