Skip to content

Commit

Permalink
Made Script::append() be able to declare "nothing" params with numeri…
Browse files Browse the repository at this point in the history
…c array keys;

Tweaked autoloader error message in roscon.php for clarity;
Updated docs packaging related files.
  • Loading branch information
boenrobot committed Nov 7, 2016
1 parent 552361e commit 0eaac86
Show file tree
Hide file tree
Showing 9 changed files with 268 additions and 113 deletions.
2 changes: 2 additions & 0 deletions RELEASE-1.0.0b6
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Util stuff, mostly.
- newRequest()
* 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.
* Stream parameters in Script::append() (and inherently, Script::prepare() and Util::exec()) now have ALL bytes escaped.
* Script::escapeValue() converts NULL to "nil" instead of "nothing".
* The $params array in Script::append() can declare variables with a value of type "nothing" by using numeric keys, and the variable names as values.
* 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).
* 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).
* 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).
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
],
"support": {
"issues": "http://github.com/pear2/Net_RouterOS/issues",
"wiki": "http://github.com/pear2/Net_RouterOS/wiki"
"issues": "https://github.com/pear2/Net_RouterOS/issues",
"wiki": "https://github.com/pear2/Net_RouterOS/wiki"
},
"require": {
"php": ">=5.3.0",
"pear2/net_transmitter": ">=1.0.0a5"
"pear2/net_transmitter": ">=1.0.0b1"
},
"require-dev": {
"phpunit/phpunit": "@stable",
Expand All @@ -30,8 +30,9 @@
"pear2/cache_shm": "Enables persistent connections.",
"pear2/console_commandline": "Enables the console",
"pear2/console_color": "Enables colors in the console",
"ext-apc": "This or Wincache is required for persistent connections.",
"ext-wincache": "This or APC is required for persistent connections. Reccomended instead of APC on Windows.",
"ext-apc": "This, APCu or Wincache is required for persistent connections.",
"ext-apcu": "This, APC or Wincache is required for persistent connections.",
"ext-wincache": "This, APC or APCu is required for persistent connections. Reccomended for Windows.",
"ext-openssl": "Enables encrypted connections."
},
"autoload": {
Expand Down
17 changes: 13 additions & 4 deletions docs/doxygen.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Doxyfile 1.8.11
# Doxyfile 1.8.12

# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
Expand Down Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = PEAR2_Net_RouterOS
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = $Id$
PROJECT_NUMBER = "GIT: $Id$"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down Expand Up @@ -303,6 +303,15 @@ EXTENSION_MAPPING =

MARKDOWN_SUPPORT = YES

# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.

TOC_INCLUDE_HEADINGS = 0

# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
Expand Down Expand Up @@ -803,8 +812,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.

FILE_PATTERNS = *.c \
*.cc \
Expand Down
55 changes: 25 additions & 30 deletions extrasetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,35 @@
* @link http://pear2.php.net/PEAR2_Net_RouterOS
*/

$extrafiles = array();
$phpDir = Pyrus\Config::current()->php_dir;
$packages = array(
'PEAR2/Autoload',
'PEAR2/Cache/SHM',
'PEAR2/Console/CommandLine',
'PEAR2/Console/Color',
'PEAR2/Net/Transmitter'
'pear2.php.net' => array(
'PEAR2_Autoload',
'PEAR2_Cache_SHM',
'PEAR2_Console_CommandLine',
'PEAR2_Console_Color'
)
);

//Quick&dirty workaround for Console_CommandLine's xmlschema.rng file.
$extrafiles['data/pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng']
= Pyrus\Config::current()->data_dir . DIRECTORY_SEPARATOR .
'pear2.php.net/PEAR2_Console_CommandLine/xmlschema.rng';
$extrafiles = array();
$config = Pyrus\Config::current();
$registry = $config->registry;
$phpDir = $config->php_dir;
$dataDir = $config->data_dir;

$oldCwd = getcwd();
chdir($phpDir);
foreach ($packages as $pkg) {
if (is_dir($pkg)) {
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$pkg,
RecursiveDirectoryIterator::UNIX_PATHS
| RecursiveDirectoryIterator::SKIP_DOTS
),
RecursiveIteratorIterator::LEAVES_ONLY
) as $path) {
$extrafiles['src/' . $path->getPathname()] = $path->getRealPath();
foreach ($packages as $channel => $channelPackages) {
foreach ($channelPackages as $package) {
foreach ($registry->toPackage($package, $channel)->installcontents
as $file => $info) {
var_dump($package, $file);
if (strpos($file, 'php/') === 0 || strpos($file, 'src/') === 0) {
$filename = substr($file, 4);
$extrafiles['src/' . $filename]
= realpath($phpDir . DIRECTORY_SEPARATOR . $filename);
} elseif (strpos($file, 'data/') === 0) {
$filename = substr($file, 5);
$extrafiles["data/{$channel}/{$package}/{$filename}"]
= realpath($dataDir . DIRECTORY_SEPARATOR . $channel . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . $filename);
}
}
}

if (is_file($pkg . '.php')) {
$extrafiles['src/' . $pkg . '.php']
= $phpDir . DIRECTORY_SEPARATOR . $pkg . '.php';
}
}
chdir($oldCwd);
Loading

0 comments on commit 0eaac86

Please sign in to comment.