Changeset 12793
- Timestamp:
- Sep 2, 2009, 6:57:01 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/branches/fukamachi/db-convert-from-2.x/lib/task/openpneUpgradeFrom2Task.class.php
r12792 r12793 24 24 private $validatorFile = null; 25 25 26 private $memoryBuf = 0; 27 26 28 protected function configure() 27 29 { … … 39 41 protected function execute($arguments = array(), $options = array()) 40 42 { 41 ini_set('memory_limit', ' 1024M');43 ini_set('memory_limit', '512M'); 42 44 43 45 // install needed plugins … … 128 130 print "converting DiaryAndImage : ".memory_get_usage()."\n"; 129 131 $this->convertDiaryAndImage(); 130 print "converting DiaryComment : ".memory_get_usage()."\n";131 $this->convertDiaryComment ();132 print "converting DiaryCommentAndImage : ".memory_get_usage()."\n"; 133 $this->convertDiaryCommentAndImage(); 132 134 133 135 // delete models' cache … … 1103 1105 } 1104 1106 1105 protected function convertDiaryComment ()1107 protected function convertDiaryCommentAndImage() 1106 1108 { 1107 1109 $this->connectTo2(); … … 1120 1122 $diaryComment->setCreatedAt($cDiaryComment->getRDatetime()); 1121 1123 $diaryComment->setUpdatedAt($cDiaryComment->getRDatetime()); 1124 1125 for ($i = 1; $i <= 3; ++$i) 1126 { 1127 if ($diaryCommentImage = $this->getImage('DiaryCommentImage', $cDiaryComment->{getImageFilename_.$i}(), false)) 1128 { 1129 $diaryCommentImage->setDiaryCommentId($cDiaryComment->getCDiaryCommentId()); 1130 $diaryCommentImage->save(); 1131 $diaryCommentImage->free(); 1132 } 1133 } 1122 1134 1123 1135 $diaryComment->save(); … … 1302 1314 return $image; 1303 1315 } 1316 1317 protected function printMemoryUsage($msg = 'point: ') 1318 { 1319 $memory = memory_get_usage(); 1320 $diff = $memory - $this->memoryBuf; 1321 printf( 1322 "%s: %d (%s)\n", 1323 $msg, $memory, $diff > 0 ? '+'.$diff : $diff 1324 ); 1325 $this->memoryBuf = $memory; 1326 } 1304 1327 }
Note: See TracChangeset
for help on using the changeset viewer.