Plugin Directory

Changeset 372130


Ignore:
Timestamp:
04/12/2011 08:27:59 PM (15 years ago)
Author:
tkriplean
Message:

fixing migration problem

Location:
reflect/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • reflect/trunk/php/models.php

    r372069 r372130  
    22
    33function reflect_bullets_current() {
     4  global $wpdb;
    45  $table_name = $wpdb->prefix . "reflect_bullet_current";
    56
     
    2122
    2223function reflect_bullets_revision() {
     24  global $wpdb; 
    2325   $table_name = $wpdb->prefix . "reflect_bullet_revision";
    2426
     
    4648
    4749function reflect_highlights() {
     50  global $wpdb; 
    4851   $table_name = $wpdb->prefix . "reflect_highlight";
    4952
     
    6467
    6568function reflect_response_current() {
     69  global $wpdb; 
    6670   $table_name = $wpdb->prefix . "reflect_response_current";
    6771
     
    8488
    8589function reflect_response_revision() {
     90  global $wpdb; 
    8691   $table_name = $wpdb->prefix . "reflect_response_revision";
    8792
  • reflect/trunk/reflect.php

    r372098 r372130  
    6565$reflect_db_version = "1.3";
    6666//include 'php/filters/reflect_comment_text.php';
    67 include 'php/filters/reflect_comment_author.php';
    68 include 'php/models.php';
    69 include 'php/options.php';
     67require 'php/filters/reflect_comment_author.php';
     68require 'php/models.php';
     69require 'php/options.php';
    7070
    7171function update_or_activate() {
     
    7373  $installed_ver = get_option( "reflect_db_version" );
    7474 
    75   $tables = array( 0 => "reflect_bullets_current()",
    76                        1 => "reflect_bullets_revision()",
    77                        2 => "reflect_highlights()",
    78                        3 => "reflect_response_current()",
    79                        4 => "reflect_response_revision()" );
     75  $tables = array( 0 => "reflect_bullets_current",
     76                       1 => "reflect_bullets_revision",
     77                       2 => "reflect_highlights",
     78                       3 => "reflect_response_current",
     79                       4 => "reflect_response_revision" );
    8080                       
    81   foreach ($tables as $table_def) {
    82     $table_def = eval($table_def);
     81  foreach ($tables as $table_name) {
     82    $table_def = eval("return $table_name();");
    8383    _create_table($table_def["table_name"], $table_def["sql"], $installed_ver, $reflect_db_version);
    8484  }
     
    117117function _create_table($table_name, $sql, $installed_ver, $latest_ver) {
    118118  global $wpdb;
    119            
     119 
     120  error_log($table_name);
     121  error_log($sql);
     122 
    120123  if ( $wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
    121124        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
Note: See TracChangeset for help on using the changeset viewer.