Skip to content

Commit 06ba401

Browse files
committed
Rename extension from "html" to "markup" so it is more open to future
1 parent 768dc33 commit 06ba401

34 files changed

Lines changed: 964 additions & 964 deletions

Zend/tests/markup_operand_position_bc.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $g = gen_lt_nospace(); $g->current(); $g->send("aaa");
8080
// Inverse direction: in operand position (after `=`, `(`, `,`, `=>`, `return`,
8181
// and parenthesized after `yield`) a "<tag" IS markup. Compile-time
8282
// classification only - never executed, so this parses even in builds where
83-
// the Html\ runtime classes are unavailable.
83+
// the Markup\ runtime classes are unavailable.
8484
function never_runs() {
8585
$x = <div/>;
8686
take(<p>hi</p>, <br/>);

Zend/zend_language_scanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
21422142

21432143
<ST_MARKUP_TAG,ST_MARKUP_CLOSE>"$"{LABEL} {
21442144
/* A dynamic tag name (<$tag>…</$tag>): an ordinary variable whose runtime
2145-
* value decides element vs component (see Html\render_dynamic). */
2145+
* value decides element vs component (see Markup\render_dynamic). */
21462146
RETURN_TOKEN_WITH_STR(T_VARIABLE, 1);
21472147
}
21482148

Zend/zend_markup.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* attribute values;
2323
* - AST lowering, called by the grammar actions
2424
* (Zend/zend_language_parser.y) to turn markup elements into ordinary
25-
* `new \Html\Element(...)` / `\Html\render_component(...)` ASTs, so no
25+
* `new \Markup\Element(...)` / `\Markup\render_component(...)` ASTs, so no
2626
* new AST node kinds or zend_compile.c support are needed.
2727
*
2828
* The lexing mechanics themselves (scanner states, operand-position
@@ -257,8 +257,8 @@ zend_string *zend_markup_decode_entities(zend_string *str)
257257
}
258258

259259
/* Native markup AST lowering.
260-
* Lower a markup element into an ordinary `new \Html\Element(tag, [], [children])`
261-
* (or `new \Html\Fragment([children])` when the tag name is empty) so no new AST
260+
* Lower a markup element into an ordinary `new \Markup\Element(tag, [], [children])`
261+
* (or `new \Markup\Fragment([children])` when the tag name is empty) so no new AST
262262
* node kind or zend_compile.c support is needed. `name` is the tag-name zval AST
263263
* or NULL for a fragment; `children` is a ZEND_AST_ARRAY of ZEND_AST_ARRAY_ELEM.
264264
*
@@ -277,7 +277,7 @@ static zend_ast *zend_ast_markup_fq_name(const char *name, size_t len)
277277
* uppercase, which is namespace-qualified (contains "\"), or which names a
278278
* static method via "::", dispatches as a component; anything else is a literal
279279
* HTML element. The single home for this rule: the compiler applies it to
280-
* static tag names here, and Html\render_dynamic applies it to a dynamic tag's
280+
* static tag names here, and Markup\render_dynamic applies it to a dynamic tag's
281281
* runtime value (hence ZEND_API). */
282282
ZEND_API bool zend_markup_name_is_component(zend_string *tag)
283283
{
@@ -286,7 +286,7 @@ ZEND_API bool zend_markup_name_is_component(zend_string *tag)
286286
|| strstr(ZSTR_VAL(tag), "::") != NULL;
287287
}
288288

289-
/* Wrap a list of children in `new \Html\Fragment([children])`. Consumes (and, if
289+
/* Wrap a list of children in `new \Markup\Fragment([children])`. Consumes (and, if
290290
* NULL, creates) the children list. */
291291
static zend_ast *zend_ast_wrap_fragment(zend_ast *children)
292292
{
@@ -301,7 +301,7 @@ static zend_ast *zend_ast_wrap_fragment(zend_ast *children)
301301
zend_ast_create_list(1, ZEND_AST_ARG_LIST, children));
302302
}
303303

304-
/* Wrap a string AST in a `\Html\raw(...)` call (trusted passthrough). Used for
304+
/* Wrap a string AST in a `\Markup\raw(...)` call (trusted passthrough). Used for
305305
* `<!-- … -->` comments, which are emitted as literal HTML. */
306306
zend_ast *zend_ast_create_markup_raw(zend_ast *str)
307307
{
@@ -311,7 +311,7 @@ zend_ast *zend_ast_create_markup_raw(zend_ast *str)
311311
}
312312

313313
/* Wrap a children list in
314-
* `new \Html\LazyFragment(fn() => new \Html\Fragment([children]))` (the
314+
* `new \Markup\LazyFragment(fn() => new \Markup\Fragment([children]))` (the
315315
* `:lazy` directive). The arrow function defers building the child subtree -
316316
* and running any side effects in its interpolations - until the component
317317
* actually renders the slot, so a component that discards its body never
@@ -320,7 +320,7 @@ static zend_ast *zend_ast_wrap_lazy_fragment(zend_ast *children, uint32_t lineno
320320
{
321321
zend_ast *frag = zend_ast_wrap_fragment(children);
322322

323-
/* fn() => new \Html\Fragment([...]) - an arrow function so its body
323+
/* fn() => new \Markup\Fragment([...]) - an arrow function so its body
324324
* auto-captures by value whatever it references, exactly as a hand-written
325325
* one would; only the expression evaluation is deferred. */
326326
zend_ast *params = zend_ast_create_list(0, ZEND_AST_PARAM_LIST);
@@ -361,19 +361,19 @@ static bool zend_markup_extract_lazy(zend_ast *attrs)
361361
}
362362

363363
/* Lower a component tag (a capitalized or namespace-qualified name, or
364-
* "Class::method") into a call to \Html\render_component(component, props, slot)
364+
* "Class::method") into a call to \Markup\render_component(component, props, slot)
365365
* Attributes become the props array and the body content becomes a
366-
* single \Html\Fragment passed as the slot (or a lazy \Html\LazyFragment when
366+
* single \Markup\Fragment passed as the slot (or a lazy \Markup\LazyFragment when
367367
* the `:lazy` directive is present).
368368
*
369369
* Component resolution is two-stage, and every tag resolves through the *class*
370370
* name rules only: a bare/qualified tag lowers to ZEND_AST_CLASS_NAME (the
371371
* `Component::class` machinery), and a "Class::method" tag lowers the class
372372
* part the same way with "::method" appended - both honor `use` imports and
373373
* the current namespace, with a leading "\" fully qualified. The runtime then
374-
* resolves the name to a class implementing Html\Htmlable (instantiated) or a
375-
* public static method (called) - see PHP_FUNCTION(Html_render_component) in
376-
* ext/html/html.c.
374+
* resolves the name to a class implementing Markup\Html (instantiated) or a
375+
* public static method (called) - see PHP_FUNCTION(Markup_render_component) in
376+
* ext/markup/markup.c.
377377
*
378378
* Plain *function* components are deliberately out of v1: a bare tag gives no
379379
* signal whether a class or a function is meant, and functions resolve through
@@ -419,7 +419,7 @@ static zend_ast *zend_ast_create_markup_component(zend_ast *name, zend_ast *attr
419419
bool lazy = zend_markup_extract_lazy(attrs);
420420

421421
/* The body becomes a single slot Fragment, or null when there is no body.
422-
* With `:lazy` the fragment is wrapped in a deferred Html\LazyFragment. */
422+
* With `:lazy` the fragment is wrapped in a deferred Markup\LazyFragment. */
423423
zend_ast *slot;
424424
if (children != NULL && zend_ast_get_list(children)->children > 0) {
425425
children->attr = ZEND_ARRAY_SYNTAX_SHORT;
@@ -540,7 +540,7 @@ zend_ast *zend_ast_create_markup_checked(zend_ast *open, zend_ast *attrs, zend_a
540540
: zend_ast_create_markup_element(open, attrs, children);
541541
}
542542

543-
/* Build the \Html\render_dynamic(tag_expr, attributes, children) call both
543+
/* Build the \Markup\render_dynamic(tag_expr, attributes, children) call both
544544
* dynamic-tag forms lower into. `tag_expr` is an already-built expression AST
545545
* producing the tag name; `lineno` is the opening-tag line (see
546546
* zend_ast_create_markup_element for why it is stamped explicitly). */
@@ -569,7 +569,7 @@ static zend_ast *zend_markup_dynamic_call(zend_ast *tag_expr, zend_ast *attrs, z
569569
}
570570

571571
/* Lower a dynamic tag `<$tag …>…</$tag>` into a call to
572-
* \Html\render_dynamic($tag, attributes, children). The variable's runtime
572+
* \Markup\render_dynamic($tag, attributes, children). The variable's runtime
573573
* value decides what a static tag name decides at compile time, by the same
574574
* classification rule (zend_markup_name_is_component); only classification
575575
* moves to runtime. `name` is the T_VARIABLE zval AST (without the "$"). */

Zend/zend_markup.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@
2323
/* The fully-qualified names that Native Markup Expressions
2424
* lowers into. This is the single home for the markup-to-runtime vocabulary:
2525
* the parser (Zend/zend_language_parser.y) lowers markup expressions to exactly
26-
* these symbols, and the ext/html runtime registers exactly them (asserted at
27-
* MINIT, see PHP_MINIT_FUNCTION(html)).
26+
* these symbols, and the ext/markup runtime registers exactly them (asserted at
27+
* MINIT, see PHP_MINIT_FUNCTION(markup)).
2828
*
29-
* Renaming the markup namespace (e.g. the open `Html\` vs `PHP\Html\` question)
29+
* Renaming the markup namespace (e.g. the open `Markup\` vs `PHP\Markup\` question)
3030
* is a one-line edit here rather than a hunt across the parser, stub, and
31-
* runtime. Keep in sync with ext/html/html.stub.php, which declares the classes
31+
* runtime. Keep in sync with ext/markup/html.stub.php, which declares the classes
3232
* and functions these names refer to. */
3333

34-
#define ZEND_MARKUP_ELEMENT_FQ "Html\\Element"
35-
#define ZEND_MARKUP_FRAGMENT_FQ "Html\\Fragment"
36-
#define ZEND_MARKUP_LAZY_FRAGMENT_FQ "Html\\LazyFragment"
37-
#define ZEND_MARKUP_RAW_FQ "Html\\raw"
38-
#define ZEND_MARKUP_COMPONENT_FQ "Html\\render_component"
39-
#define ZEND_MARKUP_DYNAMIC_FQ "Html\\render_dynamic"
34+
#define ZEND_MARKUP_ELEMENT_FQ "Markup\\Element"
35+
#define ZEND_MARKUP_FRAGMENT_FQ "Markup\\Fragment"
36+
#define ZEND_MARKUP_LAZY_FRAGMENT_FQ "Markup\\LazyFragment"
37+
#define ZEND_MARKUP_RAW_FQ "Markup\\raw"
38+
#define ZEND_MARKUP_COMPONENT_FQ "Markup\\render_component"
39+
#define ZEND_MARKUP_DYNAMIC_FQ "Markup\\render_dynamic"
4040

4141
BEGIN_EXTERN_C()
4242

4343
/* Element vs component classification: uppercase first character,
4444
* a "\", or a "::" dispatches as a component; anything else is a literal HTML
4545
* element. The single home for this rule - the compiler applies it to static
46-
* tag names, and Html\render_dynamic applies it to a dynamic tag's runtime
46+
* tag names, and Markup\render_dynamic applies it to a dynamic tag's runtime
4747
* value, so `<$tag>` decides at runtime exactly what `<tag>` decides at
4848
* compile time. */
4949
ZEND_API bool zend_markup_name_is_component(zend_string *tag);

ext/html/CREDITS

Lines changed: 0 additions & 2 deletions
This file was deleted.

ext/html/config.w32

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)