/inc/migration_tools.php

Description

Tools to migrate data,

Functions
checkbox_from_array (line 237)

Build an HTML checkbox form from a given array

string checkbox_from_array (array $array_data, string $code_in_string, string $form_name_string, unknown_type $data_collector, boolean $is_submit, boolean $is_correct, [boolean $in_table = 0], [integer $max_item_by_line = 0])
  • array $array_data
  • string $code_in_string
  • string $form_name_string
  • unknown_type $data_collector
  • boolean $is_submit
  • boolean $is_correct
  • boolean $in_table
  • integer $max_item_by_line
clean_table (line 128)

erase data in source db

void clean_table (string $db, string $table)
  • string $db
  • string $table
convert_hms (line 487)

Give time in day, hour, min ,sec from a given number in seconds

string convert_hms (integer $total_sec, [string $format = 'short'])
  • integer $total_sec
  • string $format
db_connection (line 369)

Switch connector between source and target database

array db_connection (string $what_host)
  • string $what_host
format_from_checkbox (line 299)
void format_from_checkbox (mixed $string_from_db, mixed $init_value_array)
fr_format_number (line 472)

Format a number in fr, 1000 => 1 000

string fr_format_number (integer $value)
  • integer $value: or float $value
get_version (line 436)

Get Agora or Spip version from meta table

unknown get_version (unknown_type $what_host, unknown_type $what_db)
  • unknown_type $what_host
  • unknown_type $what_db
go_to (line 143)

shortcut function to redirect

void go_to (string $page)
  • string $page
migrate_data (line 23)

Get source and target params to migrate data.

Main part

void migrate_data (string $from_table, string $to_table, array $from_to_field)
  • string $from_table: source table name
  • string $to_table: target table name
  • array $from_to_field: field definition for above tables
nb_record (line 341)

Get number of records in a given table

integer nb_record (string $any_table)
  • string $any_table
patch_auteurs_statut (line 194)

Correct partial status definition from Agora.

admin is 'minorezo' insetad of '0minirezo' other are not defined by default Conversion params are in field_definition file

void patch_auteurs_statut ()
radio_from_array (line 312)
void radio_from_array (mixed $array, mixed $name, mixed $value, [mixed $ending_line = ''], [mixed $array_label = ""])
remove_primary_key (line 157)

Remove primary key definition from given table.

Necessary for table with no autoincrement id field to avoid duplicate entry

void remove_primary_key (string $table)
  • string $table

Documentation generated on Mon, 31 Mar 2008 21:17:32 +0200 by phpDocumentor 1.3.0RC3