Skip to content

Removed Logo GUIDs and replaced with Data URIs and div hidden with JS - #132

Merged
php-pulls merged 5 commits into
php:masterfrom
hikari-no-yume:data_uri_logos
Aug 6, 2012
Merged

php-pulls merged 5 commits into
php:masterfrom
hikari-no-yume:data_uri_logos

Conversation

@hikari-no-yume

Copy link
Copy Markdown
Contributor
  • removed php_logo_guid()
  • removed php_egg_logo_guid()
  • removed php_real_logo_guid()
  • removed zend_logo_guid()
  • removed logo GUID handling
  • removed logo GUIDs from source
  • added logo data URIs instead for phpinfo()
  • added credits to phpinfo() page, but hidden by default

- removed php_logo_guid()
- removed php_egg_logo_guid()
- removed php_real_logo_guid()
- removed zend_logo_guid()
- removed logo GUID handling
- removed logo GUIDs from source
- added logo data URIs instead for phpinfo()
- added credits to phpinfo() page, but hidden by default
Comment thread ext/standard/info.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A small misalign :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

@smalyshev

Copy link
Copy Markdown
Contributor

I like the idea, but I am a bit concerned on Javascript thing - it looks like it'd be impossible to see credits in a browser that doesn't have Javascript enabled.

@nikic

nikic commented Jul 14, 2012

Copy link
Copy Markdown
Member

@smalyshev The credits are hidden using JS. So if JS is disabled the credits won't get hidden ;)

@hikari-no-yume

Copy link
Copy Markdown
Contributor Author

No, it's visible by default, it's just hidden by the JavaScript when the page loads. So if you have JS turned off, you can see it fine. If you have it turned on, you'll have to click the link to see it.

Edit: nikic beat me to it :)

@laruence

Copy link
Copy Markdown
Member

Hi:

  1. it's better use a local var hold the result of getElementById
  2. 'use strict' is not necessary here, since we only have less than 10 lines js codes
  3. seems we can only 'display' the credits, but can not 'hidden' it again.

thanks :)

@nikic

nikic commented Jul 15, 2012

Copy link
Copy Markdown
Member

@laruence The use strict doesn't hurt anyone though ^^

@hikari-no-yume

Copy link
Copy Markdown
Contributor Author

If it matters so much I'll clear up the code a little, but 'use strict' is best practise.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of laruence at php.net:

closed

@php-pulls php-pulls closed this Jul 16, 2012
@laruence

Copy link
Copy Markdown
Member

damned, I am testing the pull request list bug, closed this by accident...

@bjori bjori reopened this Jul 16, 2012
@laruence

Copy link
Copy Markdown
Member

@bjori thanks :)

Comment thread ext/standard/info.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Won't this cause strange behavior if somebody is embedding the phpinfo() page in a page already overwriting window.onload? People are embedding phpinfo() in installers or configuration areas for different applications.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They shouldn't be including a full HTML page, that's bound to break
things anyway. They should be using an iframe or a popup. I feel no
sympathy for them if they're doing that, things can break.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

window.onload should just be onload [edited], since window is a reference to the global object.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, what? If you replace window.onload with window you'd overwrite the global scope with said function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I prefer to be more specific (and hence verbose). I always use, e.g.,
window.onload, window.WebSocket, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

phpinfo and phpcredits aren't the same thing.

Please give me an actual example.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@TazeTSchnitzel I think your Facebook just went wild ;)

@hikari-no-yume hikari-no-yume Aug 11, 2012 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it did. Last time I trust them with my contact list.

This is very irritating, I apologise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Under normal circumstances I'd mock you for having a Facebook account in
the first place. But o think you've already seen the error of your ways ;)
On Aug 11, 2012 2:51 PM, "Andrew Faulds" notifications@github.com wrote:

In ext/standard/info.c:

    php_info_print_hr();
  •   php_info_print("<h1><a href=\"");
    
  •   php_info_print_request_uri(TSRMLS_C);
    
  •   php_info_print("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000\">");
    
  •   php_info_print("<script>(function () {\n");
    
  •   php_info_print("    'use strict';\n");
    
  •   php_info_print("    window.onload = function () {\n");
    

Yes it did. Last time I trust them with my contact list. This is very
irritating, I apologise.
-- Sent from Samsung Mobile Andrew Faulds http://ajf.me/ nikic <
notifications@github.com> hat geschrieben: In ext/standard/info.c:
php_info_print_hr(); - php_info_print("

<a href=""); -
php_info_print_request_uri(TSRMLS_C); -
php_info_print("?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000">"); +
php_info_print("<script>(function () {\n"); + php_info_print(" 'use
strict';\n"); + php_info_print(" window.onload = function () {\n");
@TazeTSchnitzel https://github.com/TazeTSchnitzel I think your
Facebook just went wild ;) — Reply to this email directly or view it on
GitHub.

—
Reply to this email directly or view it on GitHubhttps://github.com//pull/132/files#r1357361.

@hikari-no-yume hikari-no-yume Aug 11, 2012 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought rejoining Facebook was a good thing.

I was sadly mistaken ;)

@ghost

ghost commented Jul 26, 2012

Copy link
Copy Markdown

+1 for this request

@pilif

pilif commented Jul 28, 2012

Copy link
Copy Markdown
Contributor

You could use window.addEventListener for compatibility with pages that embed the phpinfo() output.

This of course would produce very broken HTML as the phpinfo() output contains a full html page including the root element and a doctype and pretty nonspecific CSS which would certainly clash with the embedding pages.

For these reasons, I would guess that enbedding via an iframe makes more sense anyways - but who knows what people are doing.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

merged

@php-pulls php-pulls closed this Aug 6, 2012
@php-pulls
php-pulls merged commit b1a997e into php:master Aug 6, 2012
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 13, 2026
Problem:
Master gained php#131 (`count()` on List and Map through `INLINED_COLLECTION_METHODS`) and php#132
(`type_test_of`, the one decision of which types `is` and `as` have a PHP test for). Three
files conflicted. php#132's `type_test_of` treats every `Hint::Identifier` as a class, so on this
branch `value as T` would pass the checker and lower to `instanceof T`, against a class named
`T`: false for every value, a silent wrong answer. The branch also refused type tests of type
arguments with its own `untested_type` rule beside php#132's, and the analyzer had a third,
`erased_type`. R3a's `SHARP_IS_TYPE` and `SHARP_TYPE_OF` lowering, its `tested_types` record
and the two node kinds stayed in the tree although the refusal means no accepted program
reaches them, and the engine never compiled either kind.

Solution:
- `crates/syntax/src/utils/pattern.rs`: master's `type_test_of` and `Shape::type_test`. It now
  takes `is_type_parameter`, so a type parameter has no PHP test. `has_type_test` and
  `php_shape` pass it in, from the names their callers already resolve.
- `crates/semantics/src/internal/checker/sharp.rs`: master's `as` and pattern arms, reading
  `is_tested`, which asks `has_type_test`. `is T`, `as T`, a `match` arm of `T`, and a class
  with type arguments are "This type is not supported yet in PHP#.", as `as List<int>` is on
  master. `untested_type` and `report_erased_test` are deleted. A catch clause of a type
  parameter keeps its refusal through `untested_catch_name`, which asks the same decision.
- `crates/analyzer/src/expression/mod.rs`: `is_untestable` asks `has_type_test` too, and
  `typeof` of a type parameter is refused again. `erased_type` and its syntax test are deleted.
- `crates/sharp-bridge/src/lower.rs`: master's plain property read in a tested null-safe link,
  with this branch's `method_value` signature. R3a's lowering is deleted: `SHARP_IS_TYPE`,
  `SHARP_TYPE_OF`, `Types::tested_type`, the analyzer's `tested_types` record, its narrowing
  and `instanceof` type, `typeof(T)` as `Class<T>`, and the four analyzer tests that narrowed
  to type arguments. R3c restores them from df78eac. The two kinds leave `kind.rs`, and
  `SHARP_UNIT_ABI` is regenerated from php-sharp's `Zend/zend_ast.h` without them.

crates/
├── syntax/src/utils/pattern.rs              <- type_test_of takes is_type_parameter
├── syntax/src/cst/cst/type_hint.rs, mod.rs  <- erased_type deleted
├── syntax/tests/sharp.rs                    <- erased_type's test deleted
├── semantics/src/internal/checker/sharp.rs  <- conflict: master's arms through is_tested
├── semantics/tests/sharp.rs                 <- one refusal test for type arguments
├── analyzer/src/context/assertion.rs        <- passes is_type_parameter
├── analyzer/src/expression/mod.rs           <- is_untestable reads has_type_test
├── analyzer/src/expression/type_of.rs       <- typeof of a class only
├── analyzer/src/expression/binary/mod.rs    <- R3a's instanceof type deleted
├── analyzer/src/assertion.rs, artifacts.rs  <- R3a's tested_types deleted
├── analyzer/src/statement/function_like/mod.rs
├── analyzer/tests/sharp.rs                  <- R3a narrowing tests deleted, refused rows added
├── codex/src/ttype/builder.rs               <- get_class_strings_of crate-private again
└── sharp-bridge/
    ├── src/lower.rs                         <- conflict: master's link read; R3a lowering deleted
    ├── src/lower/types.rs                   <- tested_type deleted
    ├── src/kind.rs                          <- two kinds out, ABI regenerated
    └── tests/lower.rs                       <- is, as, match and typeof of T refused
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.

10 participants