Development

Changeset 27595

You must first sign up to be able to contribute.

Changeset 27595

Show
Ignore:
Timestamp:
02/05/10 15:41:41 (3 years ago)
Author:
rande
Message:

[sfSolrPlugin] fix port number being ignored in service task

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfSolrPlugin/branches/sf1.2/lib/task/sfLuceneServiceTask.class.php

    r26532 r27595  
    137137      throw new sfException('Server is running, cannot start (pid file : '.$this->getPidFile($app, $env).')'); 
    138138    } 
    139  
     139     
     140    $instances = sfLucene::getAllInstances($this->configuration); 
     141     
     142    if(count($instances) == 0) 
     143    { 
     144       
     145      throw new sfException('There is no Solr instance for the current application'); 
     146    } 
     147     
     148    $host     = $instances[0]->getParameter('host'); 
     149    $port     = $instances[0]->getParameter('port'); 
     150    $base_url = $instances[0]->getParameter('base_url'); 
     151     
    140152    // start the jetty built in server 
    141     $command = sprintf('cd %s/plugins/sfSolrPlugin/lib/vendor/Solr/example; %s %s -Dsolr.solr.home=%s/config/solr/ -Dsolr.data.dir=%s/data/solr_index -jar start.jar > %s/solr_server_%s_%s.log 2>&1 & echo $!', 
     153    $command = sprintf('cd %s/plugins/sfSolrPlugin/lib/vendor/Solr/example; %s %s -Dsolr.solr.home=%s/config/solr/ -Dsolr.data.dir=%s/data/solr_index -Djetty.port=%s -jar start.jar > %s/solr_server_%s_%s.log 2>&1 & echo $!', 
    142154      sfConfig::get('sf_root_dir'), 
    143155      $this->nohup, 
     
    145157      sfConfig::get('sf_root_dir'), 
    146158      sfConfig::get('sf_root_dir'), 
     159      $port, 
    147160      sfConfig::get('sf_root_dir').'/log', 
    148161      $app, 
     
    161174 
    162175    $this->logSection("solr", "Server started with pid : ".$pid); 
     176    $this->logSection("solr", "server started  : http://".$host.":".$port.$base_url); 
    163177  } 
    164178