Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are using a webserver on which you have installed an opcode cache, like <a href="http://php.net/apc" rel="noreferrer">APC</a>, <code>eval</code> will not be the "<em>best solution</em>" : eval'd code is not store in the opcode cache, if I remember correctly <em>(and another answer said the same thing, btw)</em>.</p> <p>A solution you could use, at least if the code is not often changed, is get a mix of code stored in database and included code :</p> <ul> <li>when necessary, fetch the code from DB, and store it in a file on disk</li> <li>include that file</li> <li>as the code is now in a file, on disk, opcode cache will be able to cache it -- which is better for performances</li> <li>and you will not need to make a request to the DB each time you have to execute the code.</li> </ul> <p>I've worked with software that uses this solution (the on-disk file being no more than a cache of the code stored in DB), and I worked not too bad -- way better that doing loads of DB requests of each page, anyway...</p> <p>Some not so good things, as a consequence :</p> <ul> <li>you have to fetch the code from the DB to put it in the file "when necessary" <ul> <li>this could mean re-generating the temporary file once every hour, or deleting it when the entry in DB is modified ? Do you have a way to identify when this happens ?</li> </ul></li> <li>you also have to change your code, to use the temporary file, or re-generate it if necessary <ul> <li>if you have several places to modifiy, this could mean some work</li> </ul></li> </ul> <p><em>BTW : would I dare saying something like "eval is evil" ?</em> </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload