# A patch for APC harklinks problem

- Thread: https://externals.io/message/52025
- Original archive: https://news-web.php.net/php.internals/52025
- Started by simpcl2008@gmail.com on 2011-04-27T09:52:35+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #52025 — simpcl2008@gmail.com — 2011-04-27T09:52:35+00:00

URL: https://externals.io/message/52025#52025

Hi,

I come from sae team of sina. We meet with a problem of APC harklinks
mentioned in the buglist of PHP and APC long time ago.

The key word __FILE__ is a magic constants, and it is generated after
the php source code is compiled.
When the APC is used as a php extension for performence reason, the
compiling and executing are independent.
So, there are some problems. Please refer to the bug links:
http://bugs.php.net/bug.php?id=45421
http://pecl.php.net/bugs/bug.php?id=14055&thanks=3
<http://pecl.php.net/bugs/bug.php?id=14055&thanks=3>

I thinks there shoule be a feature in PHP Runtime to get the current
executed file name at execute-time(not compile-time).
apc_auto_hardlinks_for_php_5.3.5.diff is a patch for PHP 5.3.5, and the
patch is to add a new key word "executed_filename".

When the following code is running:
<?php
echo executed_filename;
?>

In PHP Runtime, zend_get_executed_filename() is called to returne the
current executed file name and being displayed.

To fixed the APC hardlinks problem, the other patch
auto_hardlinks_for_apc_3.1.6.diff must be used. The filename of
opcodearray should be updated when both setting and getting get opcode
array to caches in APC.

Hope the php patch should be reviewed and php runime will provide the
way to get current executed file name at
execute-time in the future.

Thanks so much.

BRs,
Chen Lei
simpcl2008@gmail.com

---

## #52028 — Pierre Joye — 2011-04-27T10:34:55+00:00

URL: https://externals.io/message/52025#52028 · In reply to: #52025

hi,

Please report bug and patches to the pecl.php.net/apc bug tracker.

Thanks for your work,

Cheers,

2011/4/27 陈磊 <simpcl2008@gmail.com>:
> Hi,
>
> I come from sae team of sina. We meet with a problem of APC harklinks
> mentioned in the buglist of PHP and APC long time ago.
>
> The key word __FILE__ is a magic constants, and it is generated after the
> php source code is compiled.
> When the APC is used as a php extension for performence reason, the
> compiling and executing are independent.
> So, there are some problems. Please refer to the bug links:
> http://bugs.php.net/bug.php?id=45421
> http://pecl.php.net/bugs/bug.php?id=14055&thanks=3
>
> I thinks there shoule be a feature in PHP Runtime to get the current
> executed file name at execute-time(not compile-time).
> apc_auto_hardlinks_for_php_5.3.5.diff is a patch for PHP 5.3.5, and the
> patch is to add a new key word "executed_filename".
>
> When the following code is running:
>  <?php
>  echo executed_filename;
>  ?>
>
> In PHP Runtime, zend_get_executed_filename() is called to returne the
> current executed file name and being displayed.
>
> To fixed the APC hardlinks problem, the other patch
> auto_hardlinks_for_apc_3.1.6.diff must be used. The filename of
> opcode array should be updated when both setting and getting get opcode
> array to caches in APC.
>
> Hope the php patch should be reviewed and php runime will provide the way to
> get current executed file name at
> execute-time in the future.
>
> Thanks so much.
>
> BRs,
> Chen Lei
> simpcl2008@gmail.com
>
> --
> 
> 
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
