-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updated for windows and bash #5
base: master
Are you sure you want to change the base?
Conversation
…ws and standard bash shell. Changed a split character in parsing method.
unset($result[0]); | ||
$words = array_map('trim', explode(" ", $words)); | ||
$result = explode("\n", trim($input)); | ||
array_shift($result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mention in the notes that I also changed the split char from " " to a regex \W because when people search for things on my site like blue/black it chokes up. I also added a catch in case something else breaks a warning is not thown if vars of two sizes are going to be passed to array_combine.
…return null which would cuase warnings when used.
Added - Added PHP8.0 typed class, - Added constructor to main `HunspellPHP` class where the `$dictionary`, `$encoding` and `$dictionary_path` cal be set/overridden during initialization. - Added `$dictionary_path` as a new argument were the dictionary files path may be specified (system default search locations are used otherwise). Additional `get()` and `set()`methods added. - Added functionality to `findCommand` method via new `(bool)$stem_mode` argument. Removed - Removed `findStemCommand` method. - Removed unused exception classes. - Removed `HunspellPHP\Exceptions` namespace. - Removed composer.lock from repo. Fixed - Renamed `$language` more appropriately `$dictionary` since that is what that property is referencing. - Moved HunspellMatchTypeException up one directory to \HunspellPHP namespace. - Fixed an issue where not all `$match` values were returned from the command response resulting in PHP warnings. - Fixed a missing type `-` extraction from the matcher regex which resulted in PHP warnings and bad responses.
This fork changes the shell commands with windows and bash style shells. This will no longer work on the system the original author wrote it on. I'm not sure what type of shell they were using but the manner in which they were setting the environment variable does not work on windows or centos/bash. This fork addresses that problem by using the windows "set" command via powershell which supports piping. The command for non windows machines was changed to use "export" for setting the environment.
An additional change was made to the parsing of the return value as the PHP_EOL value used in the original source was not working on my machine. This was changed to "\n" and it works great.