| mn8 Language Reference | Index | ||
EnvHandler |
||
|
||
Helper concept to use mn8 environment variables. Env Handler concept can only read mn8 environment variables from memory.
URL format is : env://<path>
Possible options :
print the '/system/protocols/' names
$x from "env:/system/protocols/"
print $x
print the '/system/protocols/' names where names contains tp string
$x from "env:/system/protocols/" options "filter"=Simplex.create("*tp")
print $x
| Version: | 0.1 |
| Authors: | Szabo Csaba () |
| Location: | |
| Inherits: | Concept, URIHandler |
| create (String $url) |
| static Logical | acceptsURI (String $uri) |
| Logical | closeConnection |
| Concept | getContent |
| Logical | initialize (Map $options) |
| Logical | openConnection |
| create (String $url) |
| Parameters: | ||
|
Creates a new EnvHandler with the given $url.
| static acceptsURI (String $uri) |
| Parameters: | ||
|
| Returns: Logical |
Returns true if the given $uri is acceptable by this handler, false otherwise.
print EnvHandler.acceptsURI("env://system/protocol")
-- the result is --
true
| closeConnection |
| Returns: Logical |
Returns true and close this connection.
$url = "env://system/protocols"
$env = EnvHandler.create($url)
if $env.acceptsURI( $url ) then [
$m typeof Map
if ( $env.initialize( $m ) ) then [
if ( $env.openConnection ) then [
print $env.getContent
$env.closeConnection
]
]
]
-- the result is --
env://system/protocols/mbox
env://system/protocols/file
env://system/protocols/beep
env://system/protocols/google
env://system/protocols/smtp
env://system/protocols/env
env://system/protocols/xmlrpc
env://system/protocols/pop3
env://system/protocols/mem
env://system/protocols/http
env://system/protocols/ftp
| getContent |
| Returns: Concept |
| Exceptions: | |
| badURLException : (Warning) | The URL isn't valid. |
Returns the content of this handler.
$url = "env://system/protocols"
$env = EnvHandler.create($url)
if $env.acceptsURI( $url ) then [
$m typeof Map
if ( $env.initialize( $m ) ) then [
if ( $env.openConnection ) then [
print $env.getContent
$env.closeConnection
]
]
]
-- the result is --
env://system/protocols/mbox
env://system/protocols/file
env://system/protocols/beep
env://system/protocols/google
env://system/protocols/smtp
env://system/protocols/env
env://system/protocols/xmlrpc
env://system/protocols/pop3
env://system/protocols/mem
env://system/protocols/http
env://system/protocols/ftp
| initialize (Map $options) |
| Parameters: | ||
|
| Returns: Logical |
Returns true.
$url = "env://system/protocols"
$env = EnvHandler.create($url)
if $env.acceptsURI( $url ) then [
$m typeof Map
if ( $env.initialize( $m ) ) then [
if ( $env.openConnection ) then [
print $env.getContent
$env.closeConnection
]
]
]
-- the result is --
env://system/protocols/mbox
env://system/protocols/file
env://system/protocols/beep
env://system/protocols/google
env://system/protocols/smtp
env://system/protocols/env
env://system/protocols/xmlrpc
env://system/protocols/pop3
env://system/protocols/mem
env://system/protocols/http
env://system/protocols/ftp
| openConnection |
| Returns: Logical |
Returns true.
$url = "env://system/protocols"
$env = EnvHandler.create($url)
if $env.acceptsURI( $url ) then [
$m typeof Map
if ( $env.initialize( $m ) ) then [
if ( $env.openConnection ) then [
print $env.getContent
$env.closeConnection
]
]
]
-- the result is --
env://system/protocols/mbox
env://system/protocols/file
env://system/protocols/beep
env://system/protocols/google
env://system/protocols/smtp
env://system/protocols/env
env://system/protocols/xmlrpc
env://system/protocols/pop3
env://system/protocols/mem
env://system/protocols/http
env://system/protocols/ftp