-
Notifications
You must be signed in to change notification settings - Fork 8k
OPCache: Direct execution opcode file without php source code file #6146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e3f29b4
Merge pull request #1 from php/master
chopins f97a395
Merge pull request #2 from php/master
chopins 9850245
Merge pull request #3 from php/master
chopins 728d914
Merge pull request #4 from php/master
chopins b5f86a2
add <?pho support
chopins 92ec6b1
fix unlink bug
chopins 004b3da
add opcache.allow_direct_exec_opcode option
chopins ba5a880
remove opcache code support <?pho
chopins e8a2785
fix bug
chopins a6e2c52
add tests
chopins acae2a1
update
chopins 699c89e
fix bug
chopins ee2ba03
Merge pull request #5 from php/master
chopins 3bde3c9
fix conflicting
chopins 132be8b
fix conflicting
chopins ee22aa4
Merge pull request #6 from php/master
chopins e6e0c33
fix text
chopins f8534c5
merge
chopins 7617009
add php version info to opcode
chopins 8a4b729
change version not match error message
chopins 86e41ca
Merge pull request #7 from php/master
chopins dd61db7
Merge pull request #8 from php/master
chopins 75fbf64
add prohibit_different_version_opcode option
chopins 725f0ef
Merge pull request #9 from php/master
chopins 0e82b95
close fd at failure
chopins c44d191
Merge branch 'master' into add-pho-support
chopins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --TEST-- | ||
| Compile php and store opcode to the specified file | ||
| --INI-- | ||
| opcache.enable=1 | ||
| opcache.enable_cli=1 | ||
| opcache.file_cache_only=1 | ||
| opcache.optimization_level=-1 | ||
| opcache.jit=0 | ||
| opcache.file_cache={PWD}/opcode_store_specified_file_tmp | ||
| opcache.allow_direct_exec_opcode=1 | ||
| --SKIPIF-- | ||
| <?php require_once('skipif.inc'); | ||
| $cache_dir = __DIR__ . DIRECTORY_SEPARATOR. 'opcode_store_specified_file_tmp'; | ||
| if(!file_exists($cache_dir)) { | ||
| mkdir($cache_dir); | ||
| } | ||
| ?> | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| if(!isset($is_include)) { | ||
| $file = __FILE__; | ||
| $ret = opcache_compile_file($file, __DIR__ .DIRECTORY_SEPARATOR. 'opcode_store_specified_file.bin.php'); | ||
| var_dump($ret); | ||
| if(!$ret) { | ||
| exit; | ||
| } | ||
| $is_include = 1; | ||
| include_once __DIR__ . DIRECTORY_SEPARATOR. 'opcode_store_specified_file.bin.php'; | ||
| var_dump('include end'); | ||
| exit; | ||
| } else { | ||
| function message() { | ||
| var_dump('opcode include'); | ||
| } | ||
| message(); | ||
| } | ||
| ?> | ||
| --CLEAN-- | ||
| <?php | ||
| function rmdirr($dir_path) { | ||
| $d = dir($dir_path); | ||
| while(false !== ($f = $d->read())) { | ||
| if($f === '.' || $f === '..') { | ||
| continue; | ||
| } | ||
| $path = $dir_path. DIRECTORY_SEPARATOR. $f; | ||
| if(is_dir($path)) { | ||
| rmdirr($path); | ||
| } else { | ||
| unlink($path); | ||
| } | ||
| } | ||
| rmdir($dir_path); | ||
| } | ||
| rmdirr(__DIR__.DIRECTORY_SEPARATOR.'opcode_store_specified_file_tmp'); | ||
| unlink(__DIR__ .DIRECTORY_SEPARATOR. 'opcode_store_specified_file.bin.php'); | ||
| ?> | ||
| --EXPECT-- | ||
| bool(true) | ||
| string(14) "opcode include" | ||
| string(11) "include end" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.