Skip to content

Commit

Permalink
Merge branch 'hotfix/doc-hooks-class-pass-by-ref'
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Krause committed Feb 22, 2015
2 parents 9540c83 + 94ab358 commit 7d12916
Show file tree
Hide file tree
Showing 12 changed files with 158 additions and 22 deletions.
5 changes: 1 addition & 4 deletions doc/API.md
Expand Up @@ -80,7 +80,4 @@ Hooks classes are a subset of the Gustav classes. Like the Gustav classes' ones,
For each Gustav class one Hooks class exists. When including a Gustav class, the corresponding Hooks class is included automatically.
You should never include a Hooks class manually. Instead simply include the corresponding Gustav class.

Hooks classes make all static functions of the corresponding Gustav class publically available. They are all defined as `abstract` and can therefore not be instantiated.
When calling a function via a Hooks class and passing a variable as reference to a parameter, it's important to pass it as `myfunc(&$myvar)` for example, while the corresponding Gustav class's function would accept `myfunc($myvar)`.

Hooks classes can be used to call functions documented in the [private API](Private-API).
Hooks classes make all static functions of the corresponding Gustav class that belong to the [private API](Private-API] publically available. They are all defined as `abstract` and can therefore not be instantiated.
25 changes: 16 additions & 9 deletions doc/Dev-API.md
Expand Up @@ -2,12 +2,19 @@ The Dev API contains class member that are not defined as `private` or those tha
Please note, that, like the private API's ones, any class members documented in this section may change without releasing a new major version of Gustav. Therfore you should not rely on these members if you wish to update easily to future (non-major) versions.
The Dev API is spread across the following Gustav classes.

+ [`Gustav`](Dev-API%3A-Gustav)
+ [`GustavSrc`](Dev-API%3A-GustavSrc)
+ [`GustavDest`](Dev-API%3A-GustavDest)
+ [`GustavContent`](Dev-API%3A-GustavContent)
+ [`GustavBlock`](Dev-API%3A-GustavBlock)
+ [`GustavMatch`](Dev-API%3A-GustavMatch)
+ [`GustavGenerator`](Dev-API%3A-GustavGenerator)
+ [`GustavBase`](Dev-API%3A-GustavBase)
+ [`Hooks classes`](Dev-API%3A-Hooks-classes)
+ [Gustav](Dev-API%3A-Gustav)
+ [GustavHooks](Dev-API%3A-GustavHooks)
+ [GustavSrc](Dev-API%3A-GustavSrc)
+ [GustavSrcHooks](Dev-API%3A-GustavSrcHooks)
+ [GustavDest](Dev-API%3A-GustavDest)
+ [GustavDestHooks](Dev-API%3A-GustavDestHooks)
+ [GustavContent](Dev-API%3A-GustavContent)
+ [GustavContentHooks](Dev-API%3A-GustavContentHooks)
+ [GustavBlock](Dev-API%3A-GustavBlock)
+ [GustavBlockHooks](Dev-API%3A-GustavBlockHooks)
+ [GustavMatch](Dev-API%3A-GustavMatch)
+ [GustavMatchHooks](Dev-API%3A-GustavMatchHooks)
+ [GustavGenerator](Dev-API%3A-GustavGenerator)
+ [GustavGeneratorHooks](Dev-API%3A-GustavGeneratorHooks)
+ [GustavBase](Dev-API%3A-GustavBase)
+ [GustavBaseHooks](Dev-API%3A-GustavBaseHooks)
25 changes: 25 additions & 0 deletions doc/Dev-API:-GustavBaseHooks.md
@@ -0,0 +1,25 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>

###`preg_match_all()`

This function is defined explicitly just to make [passing variables by reference](http://php.net/manual/en/language.references.pass.php) working.
For more information on the corresponding function see [`GustavBase::preg_match_all()`](Private-API%3a-GustavBase#preg_match_all).

###`preg_match()`

This function is defined explicitly just to make [passing variables by reference](http://php.net/manual/en/language.references.pass.php) working.
For more information on the corresponding function see [`GustavBase::preg_match()`](Private-API%3a-GustavBase#preg_match).
20 changes: 20 additions & 0 deletions doc/Dev-API:-GustavBlockHooks.md
@@ -0,0 +1,20 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>

###`parseBlock()`

This function is defined explicitly just to make [passing variables by reference](http://php.net/manual/en/language.references.pass.php) working.
For more information on the corresponding function see [`GustavBlock::parseBlock()`](Private-API%3a-GustavBlock#stringtrue-parseblock-string-content-).
20 changes: 20 additions & 0 deletions doc/Dev-API:-GustavContentHooks.md
@@ -0,0 +1,20 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>

###`convContent()`

This function is defined explicitly just to make [passing variables by reference](http://php.net/manual/en/language.references.pass.php) working.
For more information on the corresponding function see [`GustavContent::convContent()`](Private-API%3a-GustavContent#string-convcontent-string-content-string-converter--mixed-next_converter--).
File renamed without changes.
15 changes: 15 additions & 0 deletions doc/Dev-API:-GustavGeneratorHooks.md
@@ -0,0 +1,15 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>
15 changes: 15 additions & 0 deletions doc/Dev-API:-GustavHooks.md
@@ -0,0 +1,15 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>
15 changes: 15 additions & 0 deletions doc/Dev-API:-GustavMatchHooks.md
@@ -0,0 +1,15 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>
15 changes: 15 additions & 0 deletions doc/Dev-API:-GustavSrcHooks.md
@@ -0,0 +1,15 @@
##Static functions

###`mixed __callStatic( string $function_name, array $arguments )`

A *magic* overloading function that gets called when a class's non-reachable function is called.
This function is used to make all `protected static` functions of the Gustav class this class inherits from publically available.
If a non-existing function is called, a [`BadMethodCallException`](http://php.net/manual/en/class.badmethodcallexception.php) is thrown.

<dl>
<dt><code>$function_name</code></dt>
<dd>The name of the called function.</dd>

<dt><code>$arguments</code></dt>
<dd>The arguments passed to the called function.</dd>
</dl>
16 changes: 8 additions & 8 deletions doc/Private-API:-GustavBase.md
Expand Up @@ -201,42 +201,42 @@ Returns the passed text or HTML code converted to an inline plain text.
This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_strtoupper()](http://php.net/manual/en/function.mb-strtoupper.php).
For more information see [`mb_strtoupper()`](http://php.net/manual/en/function.mb-strtoupper.php).

###`mb_strtolower()`

This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_strtolower()](http://php.net/manual/en/function.mb-strtolower.php).
For more information see [`mb_strtolower()`](http://php.net/manual/en/function.mb-strtolower.php).

###`mb_strlen()`

This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_strlen()](http://php.net/manual/en/function.mb-strlen.php).
For more information see [`mb_strlen()`](http://php.net/manual/en/function.mb-strlen.php).

###`mb_strpos()`

This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_strpos()](http://php.net/manual/en/function.mb-strpos.php).
For more information see [`mb_strpos()`](http://php.net/manual/en/function.mb-strpos.php).

###`mb_substr()`

This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_substr()](http://php.net/manual/en/function.mb-substr.php).
For more information see [`mb_substr()`](http://php.net/manual/en/function.mb-substr.php).

###`mb_substr_count()`

This function is just an alias for the corresponsing multibyte string function.
When calling this function without specifying a value for the last parmeter, the character encoding definition, that parameter is set to the character encoding used by Gustav ([`GustavBase::ENC`](#string-enc)).
This has the same effect as setting the MB character encoding globally using [`mb_internal_encoding()`](http://php.net/manual/en/function.mb-internal-encoding.php). The difference is that by doing it this way the user can still define his own global MB character encoding without interrupting Gustav.
For more information see [mb_substr_count()](http://php.net/manual/en/function.mb-substr-count.php).
For more information see [`mb_substr_count()`](http://php.net/manual/en/function.mb-substr-count.php).

###`preg_match_all()`

Expand All @@ -247,7 +247,7 @@ The differences between that function and this function are the following.
+ The native PCRE function doesn't support [capturing of offsets](http://php.net/manual/en/pcre.constants.php#constant.preg-offset-capture) in multibyte strings properly. It captures the number of bytes preceding the match, rather than the number of characters. This function fixes that problem.
+ The parameter accepting a variable to contain the matches is not required.

For more information see [preg_match_all()](http://php.net/manual/en/function.preg-match-all.php).
For more information see [`preg_match_all()`](http://php.net/manual/en/function.preg-match-all.php).

###`preg_match()`

Expand All @@ -256,7 +256,7 @@ The differences between that function and this function are the following.

+ The native PCRE function doesn't support [capturing of offsets](http://php.net/manual/en/pcre.constants.php#constant.preg-offset-capture) in multibyte strings properly. It captures the number of bytes preceding the match, rather than the number of characters. This function fixes that problem.

For more information see [preg_match()](http://php.net/manual/en/function.preg-match.php).
For more information see [`preg_match()`](http://php.net/manual/en/function.preg-match.php).

###`string[] arrayUnique( string[] $strings [, bool $lowercase_strings = false ] )`

Expand Down
9 changes: 8 additions & 1 deletion doc/_Sidebar.md
Expand Up @@ -44,14 +44,21 @@
+ [GustavBase](Private-API%3a-GustavBase)
+ [Dev API](Dev-API)
+ [Gustav](Dev-API%3A-Gustav)
+ [GustavHooks](Dev-API%3A-GustavHooks)
+ [GustavSrc](Dev-API%3A-GustavSrc)
+ [GustavSrcHooks](Dev-API%3A-GustavSrcHooks)
+ [GustavDest](Dev-API%3A-GustavDest)
+ [GustavDestHooks](Dev-API%3A-GustavDestHooks)
+ [GustavContent](Dev-API%3A-GustavContent)
+ [GustavContentHooks](Dev-API%3A-GustavContentHooks)
+ [GustavBlock](Dev-API%3A-GustavBlock)
+ [GustavBlockHooks](Dev-API%3A-GustavBlockHooks)
+ [GustavMatch](Dev-API%3A-GustavMatch)
+ [GustavMatchHooks](Dev-API%3A-GustavMatchHooks)
+ [GustavGenerator](Dev-API%3A-GustavGenerator)
+ [GustavGeneratorHooks](Dev-API%3A-GustavGeneratorHooks)
+ [GustavBase](Dev-API%3A-GustavBase)
+ [Hooks classes](Dev-API%3A-Hooks-classes)
+ [GustavBaseHooks](Dev-API%3A-GustavBaseHooks)
+ [Log files](Log-files)
+ [Miscellaneous](Miscellaneous)
+ [System requirements](System-requirements)
Expand Down

0 comments on commit 7d12916

Please sign in to comment.