Home « Server software «
Documentation: scripts/scripts.php
class Scripts - Handling scripts
This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
adjust() - Adjust the size of one string
function &adjust($text, $size=45)
- $text - string the string to adjust
- $size=45 - int its target size - default is 45
- returns either a sub-string or a padded string
compare() - Compare two sets of lines by finding the longest common sequence
function &compare($old_stream, $new_stream)
- $old_stream - string or array the left set
- $new_stream - string or array the right set
- returns an array of ('=', $left, $right) or ('-', $left, '-') or ('+', '-', $right)
diff() - Get the diff as a table of lines
function diff($original, $updated)
- $original - string a file name of the original content
- $updated - string a file for the updated content
- returns an ASCII string
gdiff() - Get the gdiff as a single text string
function gdiff($original, $updated)
- $original - string a file name of the original content
- $updated - string a file for the updated content
- returns an ASCII string
get_url() - Get the url to view a script
function get_url($id, $action='view')
- $id - string the target script
- $action='view' - string the expected action ('view', 'print', 'edit', 'delete', ...)
- returns an anchor to the viewing script
scripts/view.php?script=search.php
'),
which may be not processed correctly by search engines.
If the parameter 'with_friendly_urls
' has been set to 'Y
' in the configuration panel,
this function will return an URL parsable by search engines (e.g. 'scripts/view.php/search.php
').Voir aussi:
hash() - Hash the content of one file
function hash($file)
- $file - string the path of the target file
- returns an array of ($lines, $hash), or NULL if not part of the reference set
list_files_at() - List all files below a certain path
function list_files_at($path)
- $path - string the path to scan - should start with 'scripts/reference'
- returns an array of file names
Also print '.' and '!' while scanning the path to animate the resulting screen.
Voir aussi:
list_scripts_at() - List running scripts below a certain path
function list_scripts_at($path)
- $path - string the path to scan
- returns an array of file names
Also echo '.' (one per file) and '!' (one per directory) during the scan.
Voir aussi:
merge() - Merge two files
function merge($original, $updated)
- $original - string a file name of the original content
- $updated - string a file for the updated content
- returns an ASCII string
purge_run_once() - Flag all scripts in scripts/run_once
function purge_run_once()