Browse Source

cfgutils: added more to docs for route exists functions

Daniel-Constantin Mierla 9 years ago
parent
commit
472782d2f0
2 changed files with 19 additions and 6 deletions
  1. 9 3
      modules/cfgutils/README
  2. 10 3
      modules/cfgutils/doc/cfgutils_admin.xml

+ 9 - 3
modules/cfgutils/README

@@ -542,7 +542,8 @@ unlock("$rU");
 
 4.17. check_route_exists(route)
 
-   Check if a route block exists
+   Check if a route block exists. It returns true (1) on found and false
+   on not found or error.
 
    Parameters:
 
@@ -553,7 +554,7 @@ unlock("$rU");
 
    Example 1.21. check_route_exists() usage
 ...
-if(check_route_exists("FROGJUMP") {
+if(check_route_exists("JUMP") {
         $var(jumping_frogs) = 1;
 };
 ...
@@ -563,6 +564,9 @@ if(check_route_exists("FROGJUMP") {
    Execute a routing block only if it is defined. If it's not defined,
    silently move to the next action in the configuration script.
 
+   It returns the code of last action in the route block, if that exists,
+   or false if the route doesn't exists or was an error executing it.
+
    Parameters:
 
    "name" of a route block in the config file, like "route[FROGJUMP]"
@@ -572,7 +576,9 @@ if(check_route_exists("FROGJUMP") {
 
    Example 1.22. route_if_exists() usage
 ...
-route_if_exists("PRESENCE_SANTA_CLAUS");
+if(route_if_exists("JUMP")) {
+    exit;
+}
 ...
 
 4.19. core_hash(string1, string2, size)

+ 10 - 3
modules/cfgutils/doc/cfgutils_admin.xml

@@ -529,7 +529,8 @@ unlock("$rU");
 	<section id="cfgutils.f.check_route_exists">
 		<title><function moreinfo="none">check_route_exists(route)</function></title>
 		<para>
-		Check if a route block exists
+		Check if a route block exists. It returns true (1) on found and false on
+		not found or error.
 		</para>
 		<para>Parameters:</para>
 		<para>
@@ -543,7 +544,7 @@ unlock("$rU");
 		<title><function moreinfo="none">check_route_exists()</function> usage</title>
 		<programlisting format="linespecific">
 ...
-if(check_route_exists("FROGJUMP") {
+if(check_route_exists("JUMP") {
 	$var(jumping_frogs) = 1;
 };
 ...
@@ -556,6 +557,10 @@ if(check_route_exists("FROGJUMP") {
 		Execute a routing block only if it is defined. If it's not defined, silently
 		move to the next action in the configuration script.
 		</para>
+		<para>
+		It returns the code of last action in the route block, if that exists, or
+		false if the route doesn't exists or was an error executing it.
+		</para>
 		<para>Parameters:</para>
 		<para>
 		<quote>name</quote> of a route block in the config file, like <quote>route[FROGJUMP]</quote>
@@ -568,7 +573,9 @@ if(check_route_exists("FROGJUMP") {
 		<title><function moreinfo="none">route_if_exists()</function> usage</title>
 		<programlisting format="linespecific">
 ...
-route_if_exists("PRESENCE_SANTA_CLAUS");
+if(route_if_exists("JUMP")) {
+    exit;
+}
 ...
 </programlisting>
 		</example>