Selon Dan Langille <[email protected]> le ven. 13 janv. 11:20:25 2023 :

Hello,

I'm looking at porting https://github.com/vstelmakh/url-highlight for use by FreshPorts.

My current solution:

% sudo pkg install php81-composer
% fetch -o url-highlight-v3.0.1.tar.gz https://github.com/vstelmakh/url-highlight/archive/refs/tags/v3.0.1.tar.gz
% tar -xzf url-highlight-v3.0.1.tar.gz
% composer require vstelmakh/url-highlight

At this point, everything I need is in the newly-created vendor directory.

If I copy that vendor directory to /usr/local/www/freshports/, I can use it like this:

<?php

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

... etc


What is the proper way to port code like this?

It would be very interesting to have a Mk/Uses/composer.mk, like we have Mk/Uses/pear.mk.

Adding [email protected] to the list: do you think it is possible?

--
Th. Thomas.

Reply via email to