Bug 294236 - www/url-highlight: new port - PHP library to parse URLs from string input
Summary: www/url-highlight: new port - PHP library to parse URLs from string input
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-03 18:59 UTC by Dan Langille
Modified: 2026-04-05 14:50 UTC (History)
2 users (show)

See Also:


Attachments
patch obtained via: git format-patch -1 HEAD (4.09 KB, patch)
2026-04-03 18:59 UTC, Dan Langille
no flags Details | Diff
Add new port: textproc/url-highlight (4.28 KB, patch)
2026-04-05 12:35 UTC, Dan Langille
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Langille freebsd_committer freebsd_triage 2026-04-03 18:59:59 UTC
Created attachment 269347 [details]
patch obtained via: git format-patch -1 HEAD

I've been using https://github.com/vstelmakh/url-highlight for years and just realized I never ported it. I've cobbled together a port which builds and installs.

I'm looking for help with this port because I'm unfamiliar with composer and how to correctly install a port which relies upon it. At present, it installs to  /usr/local/www/url-highlight - I'm not sure that's the appropriate location.

In the code I was doing this:

require_once($_SERVER['DOCUMENT_ROOT'] .  '/../vendor/autoload.php');
use VStelmakh\UrlHighlight\Encoder\HtmlSpecialcharsEncoder;
use VStelmakh\UrlHighlight\UrlHighlight;

That code appears here: https://github.com/FreshPorts/freshports/blob/main/include/htmlify.php#L87

and I had:

[18:56 test-nginx01 dvl /usr/local/www/freshports/vendor] % ls -l
total 14
-r-xr-xr-x  1 root wheel 771 2026.03.20 11:53 autoload.php
drwxr-xr-x  2 root wheel  14 2026.03.20 11:57 composer/
drwxr-xr-x  3 root wheel   3 2026.01.22 12:29 symfony/
drwxr-xr-x  3 root wheel   3 2026.01.22 12:29 vstelmakh/

Which is included here:

https://github.com/FreshPorts/freshports/tree/main/vendor

Thank you.
Comment 1 Piotr Smyrak 2026-04-04 16:07:30 UTC
Shall this be rather placed in a textproc category?

Also should you rather copytree from within src subdir? This way it shall prevent duplicating of LICENSE within a package:

@${MKDIR} ${STAGEDIR}${WWWDIR}
@cd ${WRKSRC}/src && ${COPYTREE_SHARE} . ${STAGEDIR}${WWWDIR}
Comment 2 Dan Langille freebsd_committer freebsd_triage 2026-04-05 12:35:11 UTC
Created attachment 269386 [details]
Add new port: textproc/url-highlight

Good points. Thank you. New patch attached.
Comment 3 Paavo-Einari Kaipila 2026-04-05 13:46:00 UTC
Why not just use composer? It handles PHP libraries 100X better than the ports tree and even gives you an autoloader out of the box.
Comment 4 Dan Langille freebsd_committer freebsd_triage 2026-04-05 14:15:52 UTC
(In reply to Paavo-Einari Kaipila from comment #3)

I'm unfamiliar with composer and how to correctly install a port which relies upon it.
Comment 5 Dan Langille freebsd_committer freebsd_triage 2026-04-05 14:50:19 UTC
(In reply to Paavo-Einari Kaipila from comment #3)

I see now. You recommend not building a port and just use composer instead.