Skip to content

Conversation

@JanTvrdik
Copy link
Contributor

Bored at school I got an idea to avoid touching disk for PHP 5.5.11+. It relies on undocumented function opcache_is_script_cached (http://stackoverflow.com/questions/23229849/opcache-is-script-cached-function-in-php5-5-11).

Not sure how to solve the atomicity. We may use @include and check return value for FALSE.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I am correct but I traced file reading back to zend_fopen_wrapper, is that the function that ultimately loads the script?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, why?

@mishak87
Copy link

For stated purpose (no disk touching) it would be necessary to use shared memory for locking ie.: shm_get_var or semaphore. It would be possible to this this on systems that have OPcache and Semaphore enabled (linux only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants