Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a wrapper for PHP scripts #14

Closed
zwettemaan opened this issue Apr 11, 2019 · 2 comments
Closed

Create a wrapper for PHP scripts #14

zwettemaan opened this issue Apr 11, 2019 · 2 comments
Assignees

Comments

@zwettemaan
Copy link
Collaborator

zwettemaan commented Apr 11, 2019

To make manipulating HTML files easier, I am building a Mac/Windows 'wrapper' tool for PHP scripts.

The idea is that you can take any specific PHP script (e.g. one that clears InDesign style overrides from HTML), and insert it into a specific folder of the wrapper.

Screen Shot 2019-04-11 at 6 54 42 PM

From then on, the wrapper tool becomes a drag/drop icon for HTML files. Drop any HTML files onto the wrapper icon, and it'll process them with the PHP script.

This to avoid having to use a command line to call any PHP scripts.

I will probably extend the wrapper to also handle Python scripts.

On Mac, no additional software is needed.

On Windows, a copy of PHP needs to be downloaded and expanded (it does not need to be installed, merely expanded from the ZIP file)

The current version I use is

https://windows.php.net/downloads/releases/php-7.3.4-Win32-VC15-x64.zip

from

https://windows.php.net/download/

@zwettemaan
Copy link
Collaborator Author

I had some further thoughts, and the way I would set it up would be as follows:

  1. You can put as many shell or php or python files into the Plugins folder as you like. Each of these script files would also be a regular command-line PHP or Python script (which is kind of a 'standard').

People who are familiar with command line work would be able to use the same scripts straight from the command line.

The wrapper is mostly a convenience tool - it does not really add any functionality beyond making command-line scripts drag/droppable.

  1. Double-click the wrapper tool icon -> it would bring up a preferences screen. The preferences screen shows a list of all the script files it has found in Plugins folder.

On the preferences screen, the user can configure the wrapper to match their system. On a Mac, the wrapper tool would automatically 'latch on' to existing stuff that is installed on a standard Mac (Macs have PHP and python on board out of the box).

On Windows, the user would first have to download a copy of python or PHP, and install it anywhere they prefer. I'd write a manual on how to easily install this

Once installed the Windows user would then point out to the tool where they installed PHP and python

On the same preferences screen, the user can also select a 'default script', one of the scripts font in the Plugins folder. If they do this then the wrapper tool will use this script on any drag/dropped files. If no 'default script' is selected amongst the scripts, then each time they drag/drop a dialog would come up allowing them to select whatever script they want to use.

This would allow a user to either opt for 'quick work': always executing the same script on whatever you drag/drop, or 'flexible work': always allow the user to select the script to execute when files are drag/dropped.

Something like that.

I've already gotten a fair bit of this wrapper done. I am writing it in Xojo, which means that anyone wanting to re-compile this would need Xojo. That's a hurdle, but not an important one: once the wrapper tool is done, there would be no need to recompile it as all the 'smarts' are outside of the wrapper tool: it uses whatever copy of PHP you install and whatever scripts you store into the Plugins folder: all the smarts are 'outside' of the wrapper tool.

I could also make the wrapper tool offer service capability, with a small web-browser interface where users can put stuff into a web browser window and have it processed by a script. Not sure if that's worth doing. Will keep that on the back burner, but it might be handy for situations where users are not allowed to install PHP or Python on their IT-department-managed workstations. Moving the tool off to a separate server would open up the tool to those people too.

@zwettemaan
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant