[57854] trunk/dports/www/phpmyadmin/Portfile
Ryan Schmidt
ryandesign at macports.org
Sat Sep 19 22:11:50 PDT 2009
On Sep 19, 2009, at 21:01, Olivier Le Floch wrote:
>> I didn't quite understand: why did you have to rename
>> config.inc.php and differ from phpMyAdmin's documentation? Sure it
>> might be nice to have the config file in ${prefix}/etc along with
>> other programs' config files, but I don't see what forced you to do
>> that. It would have been fine to keep the config file where it was,
>> no? Also I think it's pretty usual for web apps to have their
>> config files within their own directories, and not within ${prefix}/
>> etc. I haven't sampled many web apps, but I would assume they're
>> written to be used on web hosts where users don't usually have
>> access to system-wide directories like /etc.
>
> There are actually two parts to this question :
>
> - Why did I choose to have the configuration file live in ${prefix}/
> etc/ instead of the application's own directory ?
>
> Because if I'm not mistaken, future upgrade of phpmyadmin, and
> uninstalls, etc., would not handle this user edited file very well.
> If this is not the case (i.e. upgrading the phpmyadmin port won't
> risk erasing this file), then I fully agree that this whole "copy
> the file and add a symlink" stuff is not useful at all (and I should
> remove it to avoid confusing users with a non standard phpMyAdmin
> config).
Upgrades will delete any file registered to the port, regardless where
the file is, and will not touch files not registered to the port. So
all you have to do is make sure ${prefix}/www/phpmyadmin/
config.inc.php is not registered to the port. Looking into the
distfile, it does not contain a file config.inc.php; it contains a
file config.sample.inc.php. So there is no problem. You can install
the files contained in the distfile without modification, and explain
to the user in a post-activate ui_msg that they should copy
config.sample.inc.php to config.inc.php and then make changes.
MacPorts will not touch config.inc.php on upgrade or uninstall,
because it is not any of the files installed by the port. In the php5
port I check whether the php.ini exists, and vary the message I print:
if the file does not exist, I tell the user to copy the sample
php.ini; if the file exists, I advise the user they should compare
their php.ini with the new sample php.ini because they may need to
merge in changes.
> - Why did I choose to rename the configuration file from
> config.inc.php to phpmyadmin.inc.php ?
>
> Since I was putting the file in a directory common to many ports, I
> most definitely did not want it to have a name that might conflict
> with other ports.
True. Another option, if you want to continue to have the file within $
{prefix}/etc, would be to not rename it but put it in ${prefix}/etc/$
{name}.
More information about the macports-dev
mailing list