Updated for windows and bash#5
Open
RickKukiela wants to merge 15 commits into
Open
Conversation
added 3 commits
August 2, 2018 01:02
…ws and standard bash shell. Changed a split character in parsing method.
RickKukiela
commented
Aug 3, 2018
| unset($result[0]); | ||
| $words = array_map('trim', explode(" ", $words)); | ||
| $result = explode("\n", trim($input)); | ||
| array_shift($result); |
Author
There was a problem hiding this comment.
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.
…a path to a custom word list to be merged with the dictionary at runtime. - Windows/Linux environments now use the same process execution code. - Hunspell process invocation is now handled through `proc_open` instead of `shell_exec`. - Hunspell `stderr` output is now logged via `error_log()` call. #### Changed - Changed constructor argument `$encoding` default value from 'en_US.utf-8' to 'UTF-8'.
… property for caching to ensure the call is not made more than once per instance. - Refactored `hunspellSuggest()` to work with space-separated list of words and return parsed result batch - This avoids needing to invoke the proc for each word which was a major performance issue.
…he stem branch of this library works correctly after the batch improvement made in the previous commit.
- Bumped version in composer.json to 4.0.0.
…arameter when instantiating `HunspellResponse` objects. - Updated readme/changelog and bumped version to 4.0.1
…he offest param to `HunspellResponse::__construct()`. - Updated changelog and bumped version to 4.0.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.