Changeset 57336

Show
Ignore:
Timestamp:
03/07/08 15:51:56 (2 months ago)
Author:
ischommer
Message:

upped max_allowed_packet sizes for mysql when importing/displaying shape data

Location:
modules/marketdemandmap/trunk/code/controller
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • modules/marketdemandmap/trunk/code/controller/DemandMap.php

    r57000 r57336  
    7171                parent::init(); 
    7272                 
     73                // set max_allowed_packet to 32MB to allow for large binary imports 
     74                DB::query('SET GLOBAL max_allowed_packet=32*1024*1024;'); 
     75                 
    7376                if(empty(DemandMap::$google_api_key)) user_error('Please provide a Google Maps API Key', E_USER_ERROR); 
    7477                 
  • modules/marketdemandmap/trunk/code/controller/SupplyImporter.php

    r57035 r57336  
    8787         */ 
    8888        function doUpload($data, $form) { 
    89                 set_time_limit(360); 
     89                // 10 minutes and 700MB or PHP memory should be enough... 
     90                set_time_limit(60*10); 
    9091                ini_set('memory_limit', '700M'); 
    91                  
     92 
     93                // set max_allowed_packet to 32MB to allow for large binary imports 
     94                DB::query('SET GLOBAL max_allowed_packet=32*1024*1024;'); 
     95 
    9296                $fileSHP = new File(); 
    9397                $fileSHP->loadUploaded($_FILES['_ShapeFileSHP'], $this->tmpFolder); 
     
    133137                $updateCount = 0; 
    134138                $ignoredCount = 0; 
    135                  
     139 
    136140                for($RECID=0; $RECID < $shp->dbf->dbf_num_rec; $RECID++) { 
    137141                        // HACK 2008-06-18 by Ingo Schommer: always use first array element