php / php/php-src

Install `*.stub.php` for use with the `phpize` build environment

Open
#18,520 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I'm trying to use gen_stub.php to define an attribute class in an extension. gen_stub.php requires the zend_attributes.stub.php to be available to resolve the \Attribute::TARGET_X constants. For that purpose gen_stub.php has support for including other files as a dependency, which is already used for zend_test:

https://github.com/php/php-src/blob/e3715cddf075e2dcfb44aae2c8fa2a36069fc965/ext/zend_test/test.stub.php#L9

However this is not usable for external extensions, since the stub files are not part of a PHP installation / the phpize build environment. Only gen_stub.php itself and the generated arginfo.h headers are.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading gen_stub.php and the zend_test test.stub.php dependency example, then trace how phpize exposes gen_stub.php and generated arginfo.h. Identify the installation rules that omit *.stub.php and make the stubs available in a PHP installation or phpize environment for external extensions. Verify that an external extension can resolve zend_attributes.stub.php and the Attribute::TARGET_X constants.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.