Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP phar possible usage

Tags:

php

phar

I am going to start a new portal application in php which would have 5 7 components. I read about php phar a few months back and wondering if it would be beneficial for me to create phar of each component separately and use them in some manner. I am about to start the application and have no prior phar experience so that am willing to get some input from stack-overflow people that I use it or not.

The main theme in my mind for using phar is to create some panel where the site admin would be able to enable / disable entire component also for future I would plug in more components if requires. same concept we have in .net DLLs

Regards Junaid

like image 525
Junaid Avatar asked Mar 20 '12 08:03

Junaid


1 Answers

If you are going for some sort of plugin architecture where you allow users to add custom plugins as phar files it sure makes sense. It allows for cleaner file structure, easy distribution and installation of your plugins/components.

On the other hand, if this is an application that's not going to be redistributed or won't accept 3rd party components you are just introducing an extra build step in your plugins which not be worth it.

But yes, in your case it sure makes sense, but be aware that not everybody knows the ins and outs of phars so you might make your plugin/component ecosystem a lot more complex for novice users.

like image 124
ChrisR Avatar answered Oct 12 '22 07:10

ChrisR