René's URL Explorer Experiment


Title: add sourcecode link by LordSimal · Pull Request #246 · cakephp/cakephp-api-docs · GitHub

Open Graph Title: add sourcecode link by LordSimal · Pull Request #246 · cakephp/cakephp-api-docs

X Title: add sourcecode link by LordSimal · Pull Request #246 · cakephp/cakephp-api-docs

Description: Hello fellow CakePHP consumers 😄 This PR started with the basic desire to add a sourcecode link to the API docs so that one can easily jump to the logic they want to examine. This now looks like that Here I started to create a new TwigFilter called srcPath to get the path to that file which contains the function/method/property/whatever. But to have that data available in that LoadedXYZ object I had to adjust all the classes and how they are created. Some of them either already had the "correct" LoadedFile instance in them so I just had to extract the originale file path from that. Others (like the global namespaced ones) I had to manually add another parameter to the constructor and set the data via that. With that out of the way I stumbled upon my next problem: How do I generate the correct link to that file in the current active version/tag? Well, I first thought I can just link to e.g. https://github.com/cakephp/cakephp/blob/4.3/src/I18n/functions.php but this doesn't work. Either it has to be a specific tagged version or the branch name. Therefore I first went for the tagged version. But now the next question: * How do I get the tag from that repo?* Well, as you can see in the changed files I went for a shell_exec which executes git describe and I parse that string. But we have another inconsistency here: For the current queue repo I get fatal: No annotated tags can describe '414fa2d2caadb0494a9017eb6e8d3fcf0547485d'. However, there were unannotated tags: try --tags. For chronos both the 1.x and 2.x branch result in the "same" tag kevinpfeifer@Kevins-MBP [00:02:22] [~/Documents/CakePHP/chronos] [1.x] -> % git checkout 1.x && git describe Switched to branch '1.x' Your branch is up to date with 'origin/1.x'. 1.2.1-88-g4be4bb6 kevinpfeifer@Kevins-MBP [00:02:22] [~/Documents/CakePHP/chronos] [1.x] -> % git checkout 2.x && git describe Switched to branch '2.x' Your branch is up to date with 'origin/2.x'. 1.2.1-284-ga900965 Only for the main cakephp/cakephp repo I can used the tagged versions. This logic can be seen in src/Command/GenerateCommand.php Update phpdocumentor/reflection In the process of doing that I also updated the composer modules / did a major upgrade for phpdocumentor/reflection from 4.x to 5.x The main change/addition I had to do to make this work can be seen in src/Reflection/Loader.php Here I just had to adjust the construtor parameters. Non interactive composer updates I added the -n option to all composer update commands so composer 2.2 doesn't ask about Do you trust ..... And thats basically it. I re-generated the whole docs and put it on my server so you can check it yourself if you want. https://cakephp.pfiff.me/docs/cakephp/4.next/ https://cakephp.pfiff.me/docs/chronos/1.x/ https://cakephp.pfiff.me/docs/elastic-search/2.x/ https://cakephp.pfiff.me/docs/queue/0.x/

Open Graph Description: Hello fellow CakePHP consumers 😄 This PR started with the basic desire to add a sourcecode link to the API docs so that one can easily jump to the logic they want to examine. This now looks like th...

X Description: Hello fellow CakePHP consumers 😄 This PR started with the basic desire to add a sourcecode link to the API docs so that one can easily jump to the logic they want to examine. This now looks like th...

Opengraph URL: https://github.com/cakephp/cakephp-api-docs/pull/246

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:29e35033-ca23-5c90-328a-f5068e856e3a
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBD74:36E792:12EE18:19E7A7:6B04B1B8
html-safe-nonce149ef5865dfe77bf89d6087a3053bfbf5477d2a17a243a5447a5317864eccab3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDc0OjM2RTc5MjoxMkVFMTg6MTlFN0E3OjZCMDRCMUI4IiwidmlzaXRvcl9pZCI6IjEwMTM2MzYyMTUyMDkyNDMwNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac4bf75c9a9164c028fc1367181e4d2676f9e8b33819164003406aac43be849d7d
hovercard-subject-tagpull_request:880782291
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/cakephp/cakephp-api-docs/pull/246/files
twitter:imagehttps://avatars.githubusercontent.com/u/9105243?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/9105243?s=400&v=4
og:image:altHello fellow CakePHP consumers 😄 This PR started with the basic desire to add a sourcecode link to the API docs so that one can easily jump to the logic they want to examine. This now looks like th...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonef1d110ea058a0915c1d8aa3fc2069fa15801e128f591e5762525abe77490ecb1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/cakephp/cakephp-api-docs git https://github.com/cakephp/cakephp-api-docs.git
octolytics-dimension-user_id23666
octolytics-dimension-user_logincakephp
octolytics-dimension-repository_id8281882
octolytics-dimension-repository_nwocakephp/cakephp-api-docs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id8281882
octolytics-dimension-repository_network_root_nwocakephp/cakephp-api-docs
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseffa22a65e4c46d376940fe34b05e6a7e9c7fdb9b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cakephp/cakephp-api-docs/pull/246/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcakephp%2Fcakephp-api-docs%2Fpull%2F246%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcakephp%2Fcakephp-api-docs%2Fpull%2F246%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=cakephp%2Fcakephp-api-docs
Reloadhttps://github.com/cakephp/cakephp-api-docs/pull/246/files
Reloadhttps://github.com/cakephp/cakephp-api-docs/pull/246/files
Reloadhttps://github.com/cakephp/cakephp-api-docs/pull/246/files
cakephphttps://github.com/cakephp
cakephp-api-docshttps://github.com/cakephp/cakephp-api-docs
Codehttps://github.com/cakephp/cakephp-api-docs
Issues5 (5)https://github.com/cakephp/cakephp-api-docs/issues
Pull requests3 (3)https://github.com/cakephp/cakephp-api-docs/pulls
Actionshttps://github.com/cakephp/cakephp-api-docs/actions
Projectshttps://github.com/cakephp/cakephp-api-docs/projects
Wikihttps://github.com/cakephp/cakephp-api-docs/wiki
Security and qualityhttps://github.com/cakephp/cakephp-api-docs/security
Insightshttps://github.com/cakephp/cakephp-api-docs/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcakephp%2Fcakephp-api-docs%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcakephp%2Fcakephp-api-docs%2Fissues%2Fnew%2Fchoose
LordSimalhttps://github.com/LordSimal
2.xhttps://github.com/cakephp/cakephp-api-docs/tree/2.x
add-sourcecode-linkhttps://github.com/cakephp/cakephp-api-docs/tree/add-sourcecode-link
Conversation 1 https://github.com/cakephp/cakephp-api-docs/pull/246
Commits 1 https://github.com/cakephp/cakephp-api-docs/pull/246/commits
Checks 0 https://github.com/cakephp/cakephp-api-docs/pull/246/checks
Files changed https://github.com/cakephp/cakephp-api-docs/pull/246/files
Please reload this pagehttps://github.com/cakephp/cakephp-api-docs/pull/246/files
add sourcecode link https://github.com/cakephp/cakephp-api-docs/pull/246/files#top
Show all changes 1 commit https://github.com/cakephp/cakephp-api-docs/pull/246/files
7093a3d add sourcecode link LordSimal Mar 15, 2022 https://github.com/cakephp/cakephp-api-docs/pull/246/commits/7093a3de7ce86d24e0dd68d80a07c09dd7ffd6de
Clear filters https://github.com/cakephp/cakephp-api-docs/pull/246/files
Please reload this pagehttps://github.com/cakephp/cakephp-api-docs/pull/246/files
Please reload this pagehttps://github.com/cakephp/cakephp-api-docs/pull/246/files
Makefile https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
composer.json https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34
composer.lock https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-f37acfaa6b11f575a9a6f41a75fa73a61d0f8ebc2c9b8cddc215d8aca10e44f5
GenerateCommand.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-692be511d92a18f85e87915b7d8302ab94e702c5b4ef05a8b701ca013f5d78b8
LoadedConstant.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-d69d5513d671fd0f817fd2c4af0aa588edcf4f6a3505399bd0985ca41596c582
LoadedFunction.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-bc57007e183110d6a34199e212cd5f429bbc45fa65a26b3a0591c90d7d2b241c
LoadedMethod.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-e05a42d36211358d7ce641de1a2ce54cec4a1ee9d4fdf98b26665ea4cc415306
LoadedProperty.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-7b33b278801afddbf0a9928b5927c3aa18e882783c72c2d3c52aca1329eaa4b9
Loader.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-e73ed17c10622d2cfc3409e4b91401a7395812d0c6c7ce40943ec5597b822e29
Project.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-43d5e26ccfb69a47fd243fc918f437c8d26c166eee2aeb8cdaa733cbc35fce7d
ReflectionExtension.php https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-e0cf8c8e6fc47a7491ae4cc112ba5a63dfbf03661f1a0ef00a60be8c5059db2e
classlike.twig https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-5ce476339200bd7b222f5d54d5475096d695002095242ee8e7c6a16a6c82b946
namespace.twig https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-1cd95eadabcc4d6216bf192f3b873d849655ab9cea6ebdc834aeb23f518d033b
Makefilehttps://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
View file https://github.com/cakephp/cakephp-api-docs/blob/7093a3de7ce86d24e0dd68d80a07c09dd7ffd6de/Makefile
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cakephp/cakephp-api-docs/pull/246/{{ revealButtonHref }}
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
composer.jsonhttps://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34
View file https://github.com/cakephp/cakephp-api-docs/blob/7093a3de7ce86d24e0dd68d80a07c09dd7ffd6de/composer.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/cakephp/cakephp-api-docs/pull/246/{{ revealButtonHref }}
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34
https://github.com/cakephp/cakephp-api-docs/pull/246/files#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34
Please reload this pagehttps://github.com/cakephp/cakephp-api-docs/pull/246/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.