You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Made Script::escapeString() not encode bytes above 0x7F, in turn allowing for script's parameter string values to be influenced by charset settings;
Added a $full parameter to Script::escapeString() that encodes all bytes (binary mode, basically);
Made Script::append() escape stream values in full, meaning that script stream values are NOT influenced by charset settings;
Util::fileGetContents() properly strips out the success token from the result when in streaming mode (by copying the stream to a new stream);
Util::count() now has a second argument passed as the request's "from" argument;
Streamlined Util::exec() result collection creation;
Doc and CS fixes.
Copy file name to clipboardExpand all lines: RELEASE-1.0.0b6
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Util stuff, mostly.
2
2
3
3
* __BREAKING CHANGES:__
4
-
- Removed all $mode arguments from all Countable implementations (turns out no stable 5.6+ releases uses it...), and the COUNT_RECURSIVE implementations (which were mostly useless anyway). Util::count() has the $query argument as its first and only one.
4
+
- Removed all $mode arguments from all Countable implementations (turns out no stable 5.6+ releases uses it...), and the COUNT_RECURSIVE implementations (which were mostly useless anyway). Util::count() has the $query argument as its first one, and a new $from argument as a second one.
5
5
- All Util CRUD methods throw RouterErrorException when the router returns an error. Previously, you'd need to inspect the returned value to check if there's an error.
6
6
- Util::edit() is no longer an alias of Util::set(). It's now its own method that can modify or unset a single specified property.
7
7
- Util::fileGetContents() now throws RouterErrorException if the file doesn't exist or if there are other problems with getting its contents. Previously, it returned FALSE for such cases.
@@ -11,6 +11,8 @@ Util stuff, mostly.
11
11
- comment()
12
12
- getCurrentTime()
13
13
- newRequest()
14
+
* Script::escapeString() no longer escapes bytes above 0x7F. This means that parameter string values are now influenced by charset settings, and thus no additional conversion is necessary. A new second argument can be set to TRUE to escape all bytes, including the previously untouched ASCII alphanumeric characters and underscores.
15
+
* Stream parameters in Script::append() (and inherently, Script::prepare() and Util::exec()) now have ALL bytes escaped.
14
16
* Script::parseValue() now supports letter notation for time (1h2m3s), not just double colon notation (01:02:03), modeled after RouterOS. Related to that is also that leading zeroes, and zero minutes and seconds are now optional (e.g. "1:" is a valid way of saying 1 hour). Sub-second information is rounded up to the nearest second on current PHP versions (future versions are expected to support sub-second information in DateInterval by allowing seconds to be a double; The code currently attempts to give DateInterval a double, falling back to rounding to a second).
15
17
* Script::parseValue() now recognizes dates in the "M/d/Y H:i:s" format (used across RouterOS), and turns that into a DateTime object for that time (or midnight in UTC if the time part is omitted).
16
18
* Util::getAll() now throws a NotSupportedException if the arguments "follow", "follow-only" or "count-only" are used. The first two, because PHP would hang (since Client::sendSync() is used under the hood), and the last one because it's unredable in the returned output (use Util::count() instead).
0 commit comments