File/Rampage/scripts/rampage.php

Description

Script to automatically create a new Horde application based on a database table definition.

$Horde: framework/Rampage/scripts/rampage.php,v 1.3.2.5 2009/01/06 15:23:33 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

For license info, see COPYING, for more information and a user guide see README.

Includes
 require_once (HORDE_BASE.'/config/conf.php') (line 29)
 require_once ('Console/Getopt.php') (line 19)

Console_Getopt

 require_once (HORDE_BASE.'/lib/core.php') (line 28)
 require_once ('DB.php') (line 22)

DB

Constants
HORDE_BASE = dirname(__FILE__).'/../..' (line 25)
ZOMBIE_BASE = dirname(__FILE__).'/..' (line 24)
Functions
create_table_info (line 209)

Does the actual database querying to get the tableinfo.

Based on pear's $db->tableInfo

void create_table_info ()
dump_config_file (line 301)

Write the field and config information to the zombieconf.php config file. The field-info array $info is written in a tabular format to allow manual editing.

void dump_config_file ()
enhance_info (line 241)

Polish the $info global from create_table_info. adds some heuristic defaults.

void enhance_info ()
field_default (line 997)

Returns the default value for this field.

Unfortunately this info is not provided by pear's tableinfo function so this is currently either mantually set or useless

void field_default ( $field)
  • $field
field_get_primary_key (line 1089)

Returns the field that is primary key.

void field_get_primary_key ()
field_get_printf_tag (line 1163)

Returns the printf tag for the given field.

%s for strings, %d for decimal etc.

void field_get_printf_tag ( $field)
  • $field
field_get_quoted (line 1222)

Gets a quote represention of the field's value for use in a sql statement. Does format and charset conversions.

opposite of field_sql2php

void field_get_quoted ( $field)
  • $field
field_get_title_field (line 1064)

returns the field that can be considered the "name" of the entry.

This name field is used as the headline for the view and edit pages. These display a single entry.

void field_get_title_field ()
field_sql2php (line 1106)

creates rhs of an assignment, does sql->php conversion for fields.

Converts Charsets for string, and sql date/time to unix epoch For most fields just \$row[fieldname]. Opposite of field_get_quoted

void field_sql2php ( $field)
  • $field
is_blob (line 1010)

returns true for blob fields

void is_blob ( $field)
  • $field
is_boolean (line 1048)

returns true if $field is a boolean field

void is_boolean ( $field)
  • $field
is_datetime (line 1029)

Returns true if $field is a date or time field.

void is_datetime ( $field)
  • $field
main (line 112)

Main functions. Just decides what mode we are in and calls the appropriate methods.

void main ()
mkdir_p (line 1290)

mkdir -p replacement.

php<5 does not hav a mkdir -p function (create dirs recursively) so use this implementation from saint at corenova.com found at www.php.net/mkdir

void mkdir_p ( $target)
  • $target
parse_options (line 163)

Parse the command line options for mode 1: creation of config file and sets the appropriate defaults. Result is a working $config global.

void parse_options ( $args)
  • $args
print_cfgfield (line 371)

Helper function to pad a given value from the info

array so its length equals the width of the column defined by the longest value

void print_cfgfield ( $value,  $name, [ $is_header = false])
  • $value
  • $name
  • $is_header
print_usage_info (line 80)

Prints usage info and exits.

void print_usage_info ()
read_config_file (line 403)

Read (by including) the config file.

void read_config_file ( $fname)
  • $fname
render_edit (line 914)

Creates an html input widget for the given field.

void render_edit ( $field)
  • $field
render_field (line 845)

render a field for output

void render_field ( $field)
  • $field
transform (line 426)

Performs the actual copying/modifying of the files.

void transform ( $outdir)
  • $outdir
t_ (line 822)

template for additional handlers:

void t_ ( $c)
  • $c
t_config_conf (line 797)
void t_config_conf ( $c)
  • $c
t_config_prefs (line 781)
void t_config_prefs ( $c)
  • $c
t_edit (line 678)
void t_edit ( $c)
  • $c
t_lib_Driver_sql (line 491)

Transformer-Handlers for individual files go here Handlers are called before name replacment takes place.

void t_lib_Driver_sql ( $c)
  • $c
t_lib_Zombie (line 589)
void t_lib_Zombie ( $c)
  • $c
t_list (line 733)
void t_list ( $c)
  • $c
t_templates_edit_edit (line 712)
void t_templates_edit_edit ( $c)
  • $c
t_templates_list_entry_summaries (line 551)
void t_templates_list_entry_summaries ( $c)
  • $c
t_templates_list_list_headers (line 571)
void t_templates_list_list_headers ( $c)
  • $c
t_templates_search_search (line 764)
void t_templates_search_search ( $c)
  • $c
t_templates_view_view (line 651)
void t_templates_view_view ( $c)
  • $c

Documentation generated on Sun, 30 Jan 2011 05:20:44 +0000 by phpDocumentor 1.4.3