If you see this page, you have sucessfully installed Parser and trying to test it.
To see full paths to configuration files and DOCUMENT_ROOT comment out postprocess[] method.
If something is marked as red, then something is configured the wrong way or automatic detection is impossible (related to library files and codepages search with relative paths).
koi8-r | $charsetsdir/koi8-r.cfg (5104 Bytes) |
windows-1251 | $charsetsdir/windows-1251.cfg (5128 Bytes) |
string | protocWol | driver | client |
---|---|---|---|
1 | mysql | $sqldriversdir/libparser3mysql.so | /usr/local/lib/mysql/libmysqlclient.so |
DOCUMENT_ROOT: equal with test script directory (comment postprocess method for view)
Путь к скрипту: comment postprocess method for view
$response:charset: UTF-8
$request:charset: UTF-8
$request:uri: /_test_eng.html?a=321&b=%D0%90
$request:query: a=321&b=%D0%90 (for get values use $form class)
$SQL.connect-string: defined
$MAIL.SMTP: undefined
$CLASS_PATH:
/../data/classes/sql | directory exist |
/../data/classes/auth | directory exist |
/../data/classes/io | directory exist |
/../data/classes/utils | directory exist |
/../data/classes/engine | directory exist |
/../data/classes | directory exist |
Read $cookie:test: undefined
Write to cookie value ABC $cookie:test[ABC] (press Reload)
^eval(5+4): 9
^math:random(1000): 805
^math:log(1000): 6.90775527898214
^math:log10(1000): 3
^math:uuid[]: D33E7AB0-EC6D-43EA-A7CB-4C94DF2419F0
^math:uid64[]: 50F97C9151E621D4
^math:md5[StRiNg]: ed4577017f40ccb66fcf09dda2fe2a3c
^math:crypt[StRiNg;$apr1$]: $apr1$/x./LGqX$lKFtQPMnnKVRjltFL7nIw.
^math:crc32[StRiNg]: 2896444419
Definition $str[АбвГде]
String length ^str.length[]: 6
Uppercase string ^str.upper[]: АБВГДЕ
Lowercase string ^str.lower[]: абвгде
First 2 chars ^str.left(2): Аб
Last 3 chars ^str.right(3): Где
Substring ^str.mid(1;3): бвГ
Position of 'б' char ^str.pos[б]: 1
Position of 'б' char starting from position 2 ^str.pos[б](2): -1
Position of 'X' char ^str.pos[X]: -1
Replacement substring 'вГ' to XX using match ^str.match[вГ][]{XX}: АбXXде
Replacement chars 'в' to 'Y', 'Г' to 'Z' using ^str.replace[$repl]: АбYZде
^str.trim[both;е]: АбвГд
^str.trim[start;е]: АбвГде
^str.trim[end;е]: АбвГд
^str.trim[left;е]: АбвГде
^str.trim[right;е]: АбвГд
^str.base64[]: 0JDQsdCy0JPQtNC1
^str.js-escape[]: %u0410%u0431%u0432%u0413%u0434%u0435
^str:js-unescape[%u0410%u0431%u0432%u0413%u0434%u0435]: АбвГде
$form:a: 321
Safe conversion $form:a to integer: ^form:a.int(1): 321
1 value $form:b: А
$form:qtail: undefined
$hash1[ $.a[1] $.b[2] $.c[3] ] ^hash1.foreach[key;value]{ $key=$value }[<br />]a=1
$tbl1[^table::create{name col1 col2 Vasya 3 5 Dima 4 14}]$tbl1 rows quantity: 2
string | column |
---|---|
1 | name |
2 | col1 |
3 | col2 |
Print content $tbl1:
string | name | col1 | col2 |
---|---|---|---|
1 | Vasya | 3 | 5 |
2 | Dima | 4 | 14 |
$tbl2[^table::create{name col1 col2 Vova 3 44}]$tbl2 rows quantity: 1
join $tbl1 to $tbl2 [^tbl2.join[$tbl1]]
$tbl2 rows quantity ^tbl2.count[]: 3
Print table:
string | name | col1 | col2 |
---|---|---|---|
1 | Vova | 3 | 44 |
2 | Vasya | 3 | 5 |
3 | Dima | 4 | 14 |
select table rows where col1 values are equal 3: ^tbl2.select($tbl2.col1 == 3)
string | name | col1 | col2 |
---|---|---|---|
1 | Vova | 3 | 44 |
2 | Vasya | 3 | 5 |
Making hash with tables (where hash keys are col1 values): $hData[^tbl2.hash[col1][$.distinct[tables]]]
Print hash data:
Key | Value | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 |
|
||||||||||||
4 |
|
Making hash with strings (where hash keys are col2 values and values are name values): $hData[^tbl2.hash[col2;name][$.type[string]]]
Print hash data:
Key | Value |
---|---|
44 | Vova |
5 | Vasya |
14 | Dima |
$now[^date::now[]]
$now.day/$now.month/$now.year ${now.hour}:${now.minute}:$now.second: 22/12/2024 6:34:42
$now.week: 51
$now.weekyear: 2024
Print now in sql format ^now.sql-string[]: 2024-12-22 06:34:42
Print now in UNIX timestamp format ^now.unix-timestamp[]: 1734838482
Print now in GMT format ^now.gmt-string[]: Sun, 22 Dec 2024 03:34:42 GMT
Number of last day in current month ^now.last-day[]: 31
Roll date to 5 days ahead ^now.roll[day](-5): 17/12/2024
Roll date to 30 days behind ^now.roll[day](30): 16/1/2025
Write table $tbl1 to file _test.cfg (^tbl1.save[_test.cfg]):
File created successfully
^file:dirname[/_test.cfg]: /
^file:basename[/_test.cfg]: _test.cfg
^file:justname[/_test.cfg]: _test
^file:justext[/_test.cfg]: cfg
Get saved file information $fstat[^file::stat[_test.cfg]]:
File size [$fstat.size]: 35
cdate: 22/12/2024
adate: 22/12/2024
mdate: 22/12/2024
Loading data into $tbl3 from file DOCUMENT_ROOT/_test.cfg and out table content ($tbl3[^table::load[_test.cfg]]):
string | name | col1 | col2 |
---|---|---|---|
1 | Vasya | 3 | 5 |
2 | Dima | 4 | 14 |
File copy (^file:copy[_test.cfg;_copy.cfg]): ok
File delete (^file:delete[_test.cfg]): ok
Create object: $hf [$hf[^hashfile::open[_test]]]: object was created sucessfully
Number of records: 32
Adding record (1CC242E4-CE62-47CE-9184-11B05DF570AF) for 3 days:
$hf.[1CC242E4-CE62-47CE-9184-11B05DF570AF][ $.value[77170717] $.expires(3) ]Cleanup hashfile from expired records (^hf.cleanup[]): ok
Variable | Value | Comment |
---|---|---|
SERVER_NAME | www.parser.ru | DNS Server name |
QUERY_STRING | a=321&b=%D0%90 | For get values use $form class |
HTTP_REFERER | https://parser.ru/_test_eng.html?a=321&b=%D0%90 | |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) | Browser USER_AGENT string |
HTTP_X_FORWARDED_FOR | Filled if visitor come through proxy server | |
REMOTE_HOST | ||
REMOTE_ADDR | 13.59.67.189 | Visitors' IP address |
PARSER_VERSION | 3.5.0rc (compiled on amd64-unknown-freebsd11.4) | Parser3 version (if not defined - parser3 before 3.1.5) |
^int:sql{SELECT 2+2}:
4
Create xdoc:
$document[^xdoc::create{<?xml version="1.0" encoding="UTF-8" ?> <document> <t attr="Hello" n="123"/> <t attr="Bye" n="234" n2="xxx"/> <text>Text</text> </document>}]Object xdoc created successfully.
Field | Description | Value | ||
---|---|---|---|---|
on start | now | after ^memory:compact[] | ||
$status:rusage.utime (secs) | process time | 0.017364 | 0.026267 | 0.029708 |
$status:rusage.stime (secs) | time for reading files | 0 | 0 | 0 |
$status:rusage.maxrss (blocks) | memory, used by process | 6008 | 8436 | 11680 |
$status:memory.used (KB) | user | 2228 | 2484 | 2304 |
$status:memory.free (KB) | free (fragmentated) | 456 | 200 | 380 |
$status:memory.ever_allocated_since_compact (KB) | allocated since last garbage collection | 2916.34375 | 3625.765625 | 0 |
$status:memory.ever_allocated_since_start (KB) | allocated since start | 2916.34375 | 3625.765625 | 3629.765625 |