Skip to content

Commit 0eaac86

Browse files
committed
Made Script::append() be able to declare "nothing" params with numeric array keys;
Tweaked autoloader error message in roscon.php for clarity; Updated docs packaging related files.
1 parent 552361e commit 0eaac86

File tree

9 files changed

+268
-113
lines changed

9 files changed

+268
-113
lines changed

RELEASE-1.0.0b6

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Util stuff, mostly.
1313
- newRequest()
1414
* 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.
1515
* Stream parameters in Script::append() (and inherently, Script::prepare() and Util::exec()) now have ALL bytes escaped.
16+
* Script::escapeValue() converts NULL to "nil" instead of "nothing".
17+
* 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.
1618
* 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).
1719
* 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).
1820
* 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).

composer.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
}
1313
],
1414
"support": {
15-
"issues": "http://github.com/pear2/Net_RouterOS/issues",
16-
"wiki": "http://github.com/pear2/Net_RouterOS/wiki"
15+
"issues": "https://github.com/pear2/Net_RouterOS/issues",
16+
"wiki": "https://github.com/pear2/Net_RouterOS/wiki"
1717
},
1818
"require": {
1919
"php": ">=5.3.0",
20-
"pear2/net_transmitter": ">=1.0.0a5"
20+
"pear2/net_transmitter": ">=1.0.0b1"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "@stable",
@@ -30,8 +30,9 @@
3030
"pear2/cache_shm": "Enables persistent connections.",
3131
"pear2/console_commandline": "Enables the console",
3232
"pear2/console_color": "Enables colors in the console",
33-
"ext-apc": "This or Wincache is required for persistent connections.",
34-
"ext-wincache": "This or APC is required for persistent connections. Reccomended instead of APC on Windows.",
33+
"ext-apc": "This, APCu or Wincache is required for persistent connections.",
34+
"ext-apcu": "This, APC or Wincache is required for persistent connections.",
35+
"ext-wincache": "This, APC or APCu is required for persistent connections. Reccomended for Windows.",
3536
"ext-openssl": "Enables encrypted connections."
3637
},
3738
"autoload": {

docs/doxygen.ini

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Doxyfile 1.8.11
1+
# Doxyfile 1.8.12
22

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

41-
PROJECT_NUMBER = $Id$
41+
PROJECT_NUMBER = "GIT: $Id$"
4242

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

304304
MARKDOWN_SUPPORT = YES
305305

306+
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
307+
# to that level are automatically included in the table of contents, even if
308+
# they do not have an id attribute.
309+
# Note: This feature currently applies only to Markdown headings.
310+
# Minimum value: 0, maximum value: 99, default value: 0.
311+
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
312+
313+
TOC_INCLUDE_HEADINGS = 0
314+
306315
# When enabled doxygen tries to link words that correspond to documented
307316
# classes, or namespaces to their corresponding documentation. Such a link can
308317
# be prevented in individual cases by putting a % sign in front of the word or
@@ -803,8 +812,8 @@ INPUT_ENCODING = UTF-8
803812
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
804813
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
805814
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
806-
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
807-
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
815+
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
816+
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
808817

809818
FILE_PATTERNS = *.c \
810819
*.cc \

extrasetup.php

+25-30
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,35 @@
1414
* @link http://pear2.php.net/PEAR2_Net_RouterOS
1515
*/
1616

17-
$extrafiles = array();
18-
$phpDir = Pyrus\Config::current()->php_dir;
1917
$packages = array(
20-
'PEAR2/Autoload',
21-
'PEAR2/Cache/SHM',
22-
'PEAR2/Console/CommandLine',
23-
'PEAR2/Console/Color',
24-
'PEAR2/Net/Transmitter'
18+
'pear2.php.net' => array(
19+
'PEAR2_Autoload',
20+
'PEAR2_Cache_SHM',
21+
'PEAR2_Console_CommandLine',
22+
'PEAR2_Console_Color'
23+
)
2524
);
2625

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

32-
$oldCwd = getcwd();
33-
chdir($phpDir);
34-
foreach ($packages as $pkg) {
35-
if (is_dir($pkg)) {
36-
foreach (new RecursiveIteratorIterator(
37-
new RecursiveDirectoryIterator(
38-
$pkg,
39-
RecursiveDirectoryIterator::UNIX_PATHS
40-
| RecursiveDirectoryIterator::SKIP_DOTS
41-
),
42-
RecursiveIteratorIterator::LEAVES_ONLY
43-
) as $path) {
44-
$extrafiles['src/' . $path->getPathname()] = $path->getRealPath();
32+
foreach ($packages as $channel => $channelPackages) {
33+
foreach ($channelPackages as $package) {
34+
foreach ($registry->toPackage($package, $channel)->installcontents
35+
as $file => $info) {
36+
var_dump($package, $file);
37+
if (strpos($file, 'php/') === 0 || strpos($file, 'src/') === 0) {
38+
$filename = substr($file, 4);
39+
$extrafiles['src/' . $filename]
40+
= realpath($phpDir . DIRECTORY_SEPARATOR . $filename);
41+
} elseif (strpos($file, 'data/') === 0) {
42+
$filename = substr($file, 5);
43+
$extrafiles["data/{$channel}/{$package}/{$filename}"]
44+
= realpath($dataDir . DIRECTORY_SEPARATOR . $channel . DIRECTORY_SEPARATOR . $package . DIRECTORY_SEPARATOR . $filename);
45+
}
4546
}
4647
}
47-
48-
if (is_file($pkg . '.php')) {
49-
$extrafiles['src/' . $pkg . '.php']
50-
= $phpDir . DIRECTORY_SEPARATOR . $pkg . '.php';
51-
}
5248
}
53-
chdir($oldCwd);

0 commit comments

Comments
 (0)