Dotclear


Ignore:
Timestamp:
10/23/13 15:49:16 (12 years ago)
Author:
Dsls
Branch:
2.6
Message:
  • Clear logs when importing full flat file
  • Unlink unzipped file before deleting it
  • Be more precise when raising an exception (errored line is now displayed)

Fixes #1808

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/importExport/inc/flat/class.flat.import.php

    r1743 r2485  
    1717     private $con; 
    1818     private $prefix; 
    19       
     19 
    2020     private $dc_version; 
    2121     private $dc_major; 
    2222     private $mode; 
    23       
     23 
    2424     private $blog_url; 
    2525     private $blog_name; 
    2626     private $blog_desc; 
    27       
     27 
    2828     private $users = array(); 
    29       
     29 
    3030     public $old_ids = array( 
    3131          'category' => array(), 
     
    3333          'media' => array() 
    3434     ); 
    35       
     35 
    3636     public $stack = array( 
    3737          'categories'=>null, 
     
    4141          'media_id'=>1, 
    4242          'comment_id'=>1, 
    43           'link_id'=>1 
     43          'link_id'=>1, 
     44          'log_id' => 1 
    4445     ); 
    45       
     46 
    4647     public $has_categories = false; 
    47       
     48 
    4849     public function __construct($core,$file) 
    4950     { 
    5051          parent::__construct($file); 
    51            
     52 
    5253          $first_line = fgets($this->fp); 
    5354          if (strpos($first_line,'///DOTCLEAR|') !== 0) { 
    5455               throw new Exception(__('File is not a DotClear backup.')); 
    5556          } 
    56            
     57 
    5758          @set_time_limit(300); 
    58            
     59 
    5960          $l = explode('|',$first_line); 
    60            
     61 
    6162          if (isset($l[1])) { 
    6263               $this->dc_version = $l[1]; 
    6364          } 
    64            
     65 
    6566          $this->mode = isset($l[2]) ? strtolower(trim($l[2])) : 'single'; 
    6667          if ($this->mode != 'full' && $this->mode != 'single') { 
    6768               $this->mode = 'single'; 
    6869          } 
    69            
     70 
    7071          if (version_compare('1.2',$this->dc_version,'<=') && 
    7172          version_compare('1.3',$this->dc_version,'>')) { 
     
    7475               $this->dc_major_version = '2.0'; 
    7576          } 
    76            
     77 
    7778          $this->core =& $core; 
    7879          $this->con =& $core->con; 
    7980          $this->prefix = $core->prefix; 
    80            
     81 
    8182          $this->cur_blog        = $this->con->openCursor($this->prefix.'blog'); 
    8283          $this->cur_category    = $this->con->openCursor($this->prefix.'category'); 
     
    9596          $this->cur_spamrule    = $this->con->openCursor($this->prefix.'spamrule'); 
    9697          $this->cur_version     = $this->con->openCursor($this->prefix.'version'); 
    97            
     98 
    9899          # --BEHAVIOR-- importInit 
    99100          $this->core->callBehavior('importInit',$this,$this->core); 
    100101     } 
    101       
     102 
    102103     public function importSingle() 
    103104     { 
     
    105106               throw new Exception(__('File is not a single blog export.')); 
    106107          } 
    107            
     108 
    108109          if (!$this->core->auth->check('admin',$this->core->blog->id)) { 
    109110               throw new Exception(__('Permission denied.')); 
    110111          } 
    111            
     112 
    112113          $this->blog_id = $this->core->blog->id; 
    113            
     114 
    114115          $this->stack['categories'] = $this->con->select( 
    115116               'SELECT cat_id, cat_title, cat_url '. 
     
    117118               "WHERE blog_id = '".$this->con->escape($this->blog_id)."' " 
    118119          ); 
    119            
     120 
    120121          $rs = $this->con->select('SELECT MAX(cat_id) FROM '.$this->prefix.'category'); 
    121122          $this->stack['cat_id'] = ((integer) $rs->f(0))+1; 
    122            
     123 
    123124          $rs = $this->con->select('SELECT MAX(link_id) FROM '.$this->prefix.'link'); 
    124125          $this->stack['link_id'] = ((integer) $rs->f(0))+1; 
    125            
     126 
    126127          $rs = $this->con->select('SELECT MAX(post_id) FROM '.$this->prefix.'post'); 
    127128          $this->stack['post_id'] = ((integer) $rs->f(0))+1; 
    128            
     129 
    129130          $rs = $this->con->select('SELECT MAX(media_id) FROM '.$this->prefix.'media'); 
    130131          $this->stack['media_id'] = ((integer) $rs->f(0))+1; 
    131            
     132 
    132133          $rs = $this->con->select('SELECT MAX(comment_id) FROM '.$this->prefix.'comment'); 
    133134          $this->stack['comment_id'] = ((integer) $rs->f(0))+1; 
    134            
     135 
     136          $rs = $this->con->select('SELECT MAX(log_id) FROM '.$this->prefix.'log'); 
     137          $this->stack['log_id'] = ((integer) $rs->f(0))+1; 
     138 
    135139          $rs = $this->con->select( 
    136140               'SELECT MAX(cat_rgt) AS cat_rgt FROM '.$this->prefix.'category '. 
    137141               "WHERE blog_id = '".$this->con->escape($this->core->blog->id)."'" 
    138142          ); 
    139            
     143 
    140144          if ((integer) $rs->cat_rgt > 0) { 
    141145               $this->has_categories = true; 
    142146               $this->stack['cat_lft'][$this->core->blog->id] = (integer) $rs->cat_rgt + 1; 
    143147          } 
    144            
     148 
    145149          $this->con->begin(); 
    146            
     150 
    147151          try 
    148152          { 
    149153               $last_line_name = ''; 
    150154               $constrained = array('post', 'meta', 'post_media', 'ping', 'comment'); 
    151                 
     155 
    152156               while (($line = $this->getLine()) !== false) 
    153157               { 
     
    156160                         $this->prepareDC12line($line); 
    157161                    } 
    158                      
     162 
    159163                    if ($last_line_name != $line->__name) { 
    160164                         if (in_array($last_line_name,$constrained)) { 
     
    163167                              if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED'); 
    164168                         } 
    165                           
     169 
    166170                         if (in_array($line->__name,$constrained)) { 
    167171                              # DEFER 
     
    169173                              if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL IMMEDIATE'); 
    170174                         } 
    171                           
     175 
    172176                         $last_line_name = $line->__name; 
    173177                    } 
    174                      
     178 
    175179                    switch ($line->__name) 
    176180                    { 
     
    200204                              break; 
    201205                    } 
    202                      
     206 
    203207                    # --BEHAVIOR-- importSingle 
    204208                    $this->core->callBehavior('importSingle',$line,$this,$this->core); 
    205209               } 
    206                 
     210 
    207211               if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') $this->con->execute('SET foreign_key_checks = 1'); 
    208212               if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED'); 
     
    210214          catch (Exception $e) 
    211215          { 
     216               @fclose($this->fp); 
    212217               $this->con->rollback(); 
    213                throw $e; 
    214           } 
    215            
     218               throw new Exception($e->getMessage().' - '.sprintf(__('Error raised at line %s'),$line->__line)); 
     219          } 
     220          @fclose($this->fp); 
    216221          $this->con->commit(); 
    217222     } 
    218       
     223 
    219224     public function importFull() 
    220225     { 
     
    222227               throw new Exception(__('File is not a full export.')); 
    223228          } 
    224            
     229 
    225230          if (!$this->core->auth->isSuperAdmin()) { 
    226231               throw new Exception(__('Permission denied.')); 
    227232          } 
    228            
     233 
    229234          $this->con->begin(); 
    230235          $this->con->execute('DELETE FROM '.$this->prefix.'blog'); 
     
    232237          $this->con->execute('DELETE FROM '.$this->prefix.'spamrule'); 
    233238          $this->con->execute('DELETE FROM '.$this->prefix.'setting'); 
    234            
     239          $this->con->execute('DELETE FROM '.$this->prefix.'log'); 
     240 
    235241          try 
    236242          { 
     
    291297          catch (Exception $e) 
    292298          { 
     299               @fclose($this->fp); 
    293300               $this->con->rollback(); 
    294                throw $e; 
    295           } 
    296            
     301               throw new Exception($e->getMessage().' - '.sprintf(__('Error raised at line %s'),$line->__line)); 
     302          } 
     303          @fclose($this->fp); 
    297304          $this->con->commit(); 
    298305     } 
    299       
     306 
    300307     private function insertBlog($blog) 
    301308     { 
    302309          $this->cur_blog->clean(); 
    303            
     310 
    304311          $this->cur_blog->blog_id     = (string) $blog->blog_id; 
    305312          $this->cur_blog->blog_uid    = (string) $blog->blog_uid; 
     
    309316          $this->cur_blog->blog_name   = (string) $blog->blog_name; 
    310317          $this->cur_blog->blog_desc   = (string) $blog->blog_desc; 
    311            
     318 
    312319          $this->cur_blog->blog_status = $blog->exists('blog_status') ? (integer) $blog->blog_status : 1; 
    313            
     320 
    314321          $this->cur_blog->insert(); 
    315322     } 
    316       
     323 
    317324     private function insertCategory($category) 
    318325     { 
    319326          $this->cur_category->clean(); 
    320            
     327 
    321328          $this->cur_category->cat_id       = (string) $category->cat_id; 
    322329          $this->cur_category->blog_id      = (string) $category->blog_id; 
     
    324331          $this->cur_category->cat_url      = (string) $category->cat_url; 
    325332          $this->cur_category->cat_desc     = (string) $category->cat_desc; 
    326            
     333 
    327334          if (!$this->has_categories && $category->exists('cat_lft') && $category->exists('cat_rgt')) { 
    328335               $this->cur_category->cat_lft = (integer) $category->cat_lft; 
     
    335342               $this->cur_category->cat_rgt = $this->stack['cat_lft'][$category->blog_id]++; 
    336343          } 
    337            
     344 
    338345          $this->cur_category->insert(); 
    339346     } 
    340       
     347 
    341348     private function insertLink($link) 
    342349     { 
    343350          $this->cur_link->clean(); 
    344            
     351 
    345352          $this->cur_link->link_id       = (integer) $link->link_id; 
    346353          $this->cur_link->blog_id       = (string) $link->blog_id; 
     
    351358          $this->cur_link->link_xfn      = (string) $link->link_xfn; 
    352359          $this->cur_link->link_position = (integer) $link->link_position; 
    353            
     360 
    354361          $this->cur_link->insert(); 
    355362     } 
    356       
     363 
    357364     private function insertSetting($setting) 
    358365     { 
    359366          $this->cur_setting->clean(); 
    360            
     367 
    361368          $this->cur_setting->setting_id    = (string) $setting->setting_id; 
    362369          $this->cur_setting->blog_id       = !$setting->blog_id ? null : (string) $setting->blog_id; 
     
    365372          $this->cur_setting->setting_type  = (string) $setting->setting_type; 
    366373          $this->cur_setting->setting_label = (string) $setting->setting_label; 
    367            
     374 
    368375          $this->cur_setting->insert(); 
    369376     } 
    370       
     377 
    371378     private function insertPref($pref) 
    372379     { 
     
    374381               return; 
    375382          } 
    376            
     383 
    377384          $this->cur_pref->clean(); 
    378            
     385 
    379386          $this->cur_pref->pref_id    = (string) $pref->pref_id; 
    380387          $this->cur_pref->user_id    = !$pref->user_id ? null : (string) $pref->user_id; 
     
    383390          $this->cur_pref->pref_type  = (string) $pref->pref_type; 
    384391          $this->cur_pref->pref_label = (string) $pref->pref_label; 
    385            
     392 
    386393          $this->cur_pref->insert(); 
    387394     } 
    388       
     395 
    389396     private function insertUser($user) 
    390397     { 
     
    392399               return; 
    393400          } 
    394            
     401 
    395402          $this->cur_user->clean(); 
    396            
     403 
    397404          $this->cur_user->user_id           = (string) $user->user_id; 
    398405          $this->cur_user->user_super        = (integer) $user->user_super; 
     
    410417          $this->cur_user->user_creadt       = (string) $user->user_creadt; 
    411418          $this->cur_user->user_upddt        = (string) $user->user_upddt; 
    412            
     419 
    413420          $this->cur_user->user_desc = $user->exists('user_desc') ? (string) $user->user_desc : null; 
    414421          $this->cur_user->user_options = $user->exists('user_options') ? (string) $user->user_options : null; 
    415422          $this->cur_user->user_status = $user->exists('user_status') ? (integer) $user->user_status : 1; 
    416            
     423 
    417424          $this->cur_user->insert(); 
    418            
     425 
    419426          $this->stack['users'][$user->user_id] = true; 
    420427     } 
    421       
     428 
    422429     private function insertPermissions($permissions) 
    423430     { 
    424431          $this->cur_permissions->clean(); 
    425            
     432 
    426433          $this->cur_permissions->user_id     = (string) $permissions->user_id; 
    427434          $this->cur_permissions->blog_id     = (string) $permissions->blog_id; 
    428435          $this->cur_permissions->permissions = (string) $permissions->permissions; 
    429            
     436 
    430437          $this->cur_permissions->insert(); 
    431438     } 
    432       
     439 
    433440     private function insertPost($post) 
    434441     { 
    435442          $this->cur_post->clean(); 
    436            
     443 
    437444          $cat_id = (integer) $post->cat_id; 
    438445          if (!$cat_id) { 
    439446               $cat_id = null; 
    440447          } 
    441            
     448 
    442449          $post_password = $post->post_password ? (string) $post->post_password : null; 
    443            
     450 
    444451          $this->cur_post->post_id            = (integer) $post->post_id; 
    445452          $this->cur_post->blog_id            = (string) $post->blog_id; 
     
    468475          $this->cur_post->nb_comment         = (integer) $post->nb_comment; 
    469476          $this->cur_post->nb_trackback       = (integer) $post->nb_trackback; 
    470            
     477 
    471478          $this->cur_post->post_tz = $post->exists('post_tz') ? (string) $post->post_tz : 'UTC'; 
    472            
     479 
    473480          $this->cur_post->insert(); 
    474481     } 
    475       
     482 
    476483     private function insertMeta($meta) 
    477484     { 
    478485          $this->cur_meta->clean(); 
    479            
     486 
    480487          $this->cur_meta->meta_id   = (string) $meta->meta_id; 
    481488          $this->cur_meta->meta_type = (string) $meta->meta_type; 
    482489          $this->cur_meta->post_id   = (integer) $meta->post_id; 
    483            
     490 
    484491          $this->cur_meta->insert(); 
    485492     } 
    486       
     493 
    487494     private function insertMedia($media) 
    488495     { 
    489496          $this->cur_media->clean(); 
    490            
     497 
    491498          $this->cur_media->media_id      = (integer) $media->media_id; 
    492499          $this->cur_media->user_id       = (string) $media->user_id; 
     
    499506          $this->cur_media->media_upddt   = (string) $media->media_upddt; 
    500507          $this->cur_media->media_private = (integer) $media->media_private; 
    501            
     508 
    502509          $this->cur_media->media_dir = $media->exists('media_dir') ? (string) $media->media_dir : dirname($media->media_file); 
    503            
     510 
    504511          if (!$this->mediaExists()) { 
    505512               $this->cur_media->insert(); 
    506513          } 
    507514     } 
    508       
     515 
    509516     private function insertPostMedia($post_media) 
    510517     { 
    511518          $this->cur_post_media->clean(); 
    512            
     519 
    513520          $this->cur_post_media->media_id = (integer) $post_media->media_id; 
    514521          $this->cur_post_media->post_id  = (integer) $post_media->post_id; 
    515            
     522 
    516523          $this->cur_post_media->insert(); 
    517524     } 
    518       
     525 
    519526     private function insertLog($log) 
    520527     { 
    521528          $this->cur_log->clean(); 
    522            
     529 
    523530          $this->cur_log->log_id    = (integer) $log->log_id; 
    524531          $this->cur_log->user_id   = (string) $log->user_id; 
     
    527534          $this->cur_log->log_ip    = (string) $log->log_ip; 
    528535          $this->cur_log->log_msg   = (string) $log->log_msg; 
    529            
     536 
    530537          $this->cur_log->insert(); 
    531538     } 
    532       
     539 
    533540     private function insertPing($ping) 
    534541     { 
    535542          $this->cur_ping->clean(); 
    536            
     543 
    537544          $this->cur_ping->post_id  = (integer) $ping->post_id; 
    538545          $this->cur_ping->ping_url = (string) $ping->ping_url; 
    539546          $this->cur_ping->ping_dt  = (string) $ping->ping_dt; 
    540            
     547 
    541548          $this->cur_ping->insert(); 
    542549     } 
    543       
     550 
    544551     private function insertComment($comment) 
    545552     { 
    546553          $this->cur_comment->clean(); 
    547            
     554 
    548555          $this->cur_comment->comment_id          = (integer) $comment->comment_id; 
    549556          $this->cur_comment->post_id             = (integer) $comment->post_id; 
     
    559566          $this->cur_comment->comment_spam_status = (integer) $comment->comment_spam_status; 
    560567          $this->cur_comment->comment_trackback   = (integer) $comment->comment_trackback; 
    561            
     568 
    562569          $this->cur_comment->comment_tz = $comment->exists('comment_tz') ? (string) $comment->comment_tz : 'UTC'; 
    563570          $this->cur_comment->comment_spam_filter = $comment->exists('comment_spam_filter') ? (integer) $comment->comment_spam_filter : null; 
    564            
     571 
    565572          $this->cur_comment->insert(); 
    566573     } 
    567       
     574 
    568575     private function insertSpamRule($spamrule) 
    569576     { 
    570577          $this->cur_spamrule->clean(); 
    571            
     578 
    572579          $this->cur_spamrule->rule_id      = (integer) $spamrule->rule_id; 
    573580          $this->cur_spamrule->blog_id      = !$spamrule->blog_id ? null : (string) $spamrule->blog_id; 
    574581          $this->cur_spamrule->rule_type    = (string) $spamrule->rule_type; 
    575582          $this->cur_spamrule->rule_content = (string) $spamrule->rule_content; 
    576            
     583 
    577584          $this->cur_spamrule->insert(); 
    578585     } 
    579       
     586 
    580587     private function insertCategorySingle($category) 
    581588     { 
    582589          $this->cur_category->clean(); 
    583            
     590 
    584591          $m = $this->searchCategory($this->stack['categories'],$category->cat_url); 
    585            
     592 
    586593          $old_id = $category->cat_id; 
    587594          if ($m !== false) 
     
    594601               $category->cat_id = $cat_id; 
    595602               $category->blog_id = $this->blog_id; 
    596                 
     603 
    597604               $this->insertCategory($category); 
    598605               $this->stack['cat_id']++; 
    599606          } 
    600            
     607 
    601608          $this->old_ids['category'][(integer) $old_id] = $cat_id; 
    602609     } 
    603       
     610 
    604611     private function insertLinkSingle($link) 
    605612     { 
    606613          $link->blog_id = $this->blog_id; 
    607614          $link->link_id = $this->stack['link_id']; 
    608            
     615 
    609616          $this->insertLink($link); 
    610617          $this->stack['link_id']++; 
    611618     } 
    612       
     619 
    613620     private function insertPostSingle($post) 
    614621     { 
     
    616623               $post_id = $this->stack['post_id']; 
    617624               $this->old_ids['post'][(integer) $post->post_id] = $post_id; 
    618                 
     625 
    619626               $cat_id = $post->cat_id ? $this->old_ids['category'][(integer) $post->cat_id] : null; 
    620                 
     627 
    621628               $post->post_id = $post_id; 
    622629               $post->cat_id = $cat_id; 
    623630               $post->blog_id = $this->blog_id; 
    624                 
     631 
    625632               $post->post_url = $this->core->blog->getPostURL( 
    626633                    $post->post_url,$post->post_dt,$post->post_title,$post->post_id 
    627634               ); 
    628                 
     635 
    629636               $this->insertPost($post); 
    630637               $this->stack['post_id']++; 
     
    633640          } 
    634641     } 
    635       
     642 
    636643     private function insertMetaSingle($meta) 
    637644     { 
     
    643650          } 
    644651     } 
    645       
     652 
    646653     private function insertMediaSingle($media) 
    647654     { 
    648655          $media_id = $this->stack['media_id']; 
    649656          $old_id = $media->media_id; 
    650            
     657 
    651658          $media->media_id = $media_id; 
    652659          $media->media_path = $this->core->blog->settings->system->public_path; 
    653660          $media->user_id = $this->getUserId($media->user_id); 
    654            
     661 
    655662          $this->insertMedia($media); 
    656663          $this->stack['media_id']++; 
    657664          $this->old_ids['media'][(integer) $old_id] = $media_id; 
    658665     } 
    659       
     666 
    660667     private function insertPostMediaSingle($post_media) 
    661668     { 
     
    664671               $post_media->media_id = $this->old_ids['media'][(integer) $post_media->media_id]; 
    665672               $post_media->post_id = $this->old_ids['post'][(integer) $post_media->post_id]; 
    666                 
     673 
    667674               $this->insertPostMedia($post_media); 
    668675          } elseif (!isset($this->old_ids['media'][(integer) $post_media->media_id])) { 
     
    672679          } 
    673680     } 
    674       
     681 
    675682     private function insertPingSingle($ping) 
    676683     { 
    677684          if (isset($this->old_ids['post'][(integer) $ping->post_id])) { 
    678685               $ping->post_id = $this->old_ids['post'][(integer) $ping->post_id]; 
    679                 
     686 
    680687               $this->insertPing($ping); 
    681688          } else { 
     
    683690          } 
    684691     } 
    685       
     692 
    686693     private function insertCommentSingle($comment) 
    687694     { 
    688695          if (isset($this->old_ids['post'][(integer) $comment->post_id])) { 
    689696               $comment_id = $this->stack['comment_id']; 
    690                 
     697 
    691698               $comment->comment_id = $comment_id; 
    692699               $comment->post_id = $this->old_ids['post'][(integer) $comment->post_id]; 
    693                 
     700 
    694701               $this->insertComment($comment); 
    695702               $this->stack['comment_id']++; 
     
    698705          } 
    699706     } 
    700       
     707 
    701708     private static function throwIdError($name,$line,$related) 
    702709     { 
     
    708715          )); 
    709716     } 
    710       
     717 
    711718     public function searchCategory($rs,$url) 
    712719     { 
     
    717724               } 
    718725          } 
    719            
     726 
    720727          return false; 
    721728     } 
    722       
     729 
    723730     public function getUserId($user_id) 
    724731     { 
     
    730737                    $user_id = preg_replace('/[^A-Za-z0-9]$/','',$user_id); 
    731738                    $user_id .= strlen($user_id) < 2 ? '-a' : ''; 
    732                      
     739 
    733740                    # We change user_id, we need to check again 
    734741                    if (!$this->userExists($user_id)) 
     
    737744                         $this->cur_user->user_id = (string) $user_id; 
    738745                         $this->cur_user->user_pwd = md5(uniqid()); 
    739                           
     746 
    740747                         $this->core->addUser($this->cur_user); 
    741                           
     748 
    742749                         $this->stack['users'][$user_id] = true; 
    743750                    } 
     
    749756               } 
    750757          } 
    751            
     758 
    752759          return $user_id; 
    753760     } 
    754       
     761 
    755762     private function userExists($user_id) 
    756763     { 
     
    758765               return $this->stack['users'][$user_id]; 
    759766          } 
    760            
     767 
    761768          $strReq = 'SELECT user_id '. 
    762769                    'FROM '.$this->prefix.'user '. 
    763770                    "WHERE user_id = '".$this->con->escape($user_id)."' "; 
    764            
     771 
    765772          $rs = $this->con->select($strReq); 
    766            
     773 
    767774          $this->stack['users'][$user_id] = !$rs->isEmpty(); 
    768775          return $this->stack['users'][$user_id]; 
    769776     } 
    770       
     777 
    771778     private function prefExists($pref_ws,$pref_id,$user_id) 
    772779     { 
     
    780787               $strReq .= "AND user_id = '".$this->con->escape($user_id)."' "; 
    781788          } 
    782            
     789 
    783790          $rs = $this->con->select($strReq); 
    784            
     791 
    785792          return !$rs->isEmpty(); 
    786793     } 
    787       
     794 
    788795     private function mediaExists() 
    789796     { 
     
    792799                    "WHERE media_path = '".$this->con->escape($this->cur_media->media_path)."' ". 
    793800                    "AND media_file = '".$this->con->escape($this->cur_media->media_file)."' "; 
    794            
     801 
    795802          $rs = $this->con->select($strReq); 
    796            
     803 
    797804          return !$rs->isEmpty(); 
    798805     } 
    799       
     806 
    800807     private function prepareDC12line(&$line) 
    801808     { 
     
    804811          'dc_wiki_comments','dc_use_smilies','dc_date_format','dc_time_format', 
    805812          'dc_url_scan'); 
    806            
     813 
    807814          switch ($line->__name) 
    808815          { 
     
    830837                    $line->post_content_xhtml = $line->post_content; 
    831838                    $line->post_excerpt_xhtml = $line->post_chapo; 
    832                      
     839 
    833840                    if ($line->post_format == 'wiki') { 
    834841                         $line->post_content = $line->post_content_wiki; 
     
    838845                         $line->post_excerpt = $line->post_chapo; 
    839846                    } 
    840                      
     847 
    841848                    $line->post_status = (integer) $line->post_pub; 
    842849                    $line->post_type = 'post'; 
    843850                    $line->blog_id = 'default'; 
    844                      
     851 
    845852                    $line->drop('post_titre_url','post_content_wiki','post_chapo','post_chapo_wiki','post_pub'); 
    846                      
     853 
    847854                    break; 
    848855               case 'post_meta': 
     
    862869                    break; 
    863870          } 
    864            
     871 
    865872          # --BEHAVIOR-- importPrepareDC12 
    866873          $this->core->callBehavior('importPrepareDC12',$line,$this,$this->core); 
    867874     } 
    868875} 
    869 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map