Changeset 1369


Ignore:
Timestamp:
Sep 12, 2010, 3:40:20 PM (10 years ago)
Author:
teymour
Message:

Correction bug index_if
+ clarification des droits sur le log solr

Location:
cpc/trunk/project/lib/model/solr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/lib/model/solr/SolrCommands.class.php

    r1366 r1369  
    44{
    55  public static function getFileCommands() {
     6    umask(0002);
     7    if (!file_exists(sfConfig::get('sf_log_dir').'/solr/')) {
     8      mkdir (sfConfig::get('sf_log_dir').'/solr/');
     9    }
    610    return sfConfig::get('sf_log_dir').'/solr/commands.log';
    711  }
     
    4852      $this->file = null;
    4953    }
     54    if (!file_exists($this->getFileCommands()))
     55      touch($this->getFileCommands());
    5056    rename($this->getFileCommands(), $lockfile);
    5157    sem_release($this->semaphore);
  • cpc/trunk/project/lib/model/solr/SolrListener.php

    r1332 r1369  
    6161  {
    6262    $obj = $event->getInvoker();
    63    
    64     if ($t = $this->_options['index_if'] && $t && $obj->get($t))
     63
     64    $t = null;
     65    if (isset( $this->_options['index_if']) && $t = $this->_options['index_if'] && $t && !$obj->get($t))
    6566      return ;
    6667   
     
    7071    $json['object_name'] = get_class($obj);
    7172   
    72     if ($t = $this->_options['description']) {
     73    if (isset($this->_options['description']) && $t = $this->_options['description']) {
    7374      $content = $this->getObjFieldsValue($obj, $t);
    7475      $wordcount = str_word_count($content);
     
    99100     
    100101    // par default la date est la created_at
    101     if ( !($t = $this->_options['date'])) {
     102    if (!isset($this->_options['date']) || !($t = $this->_options['date'])) {
    102103      $t = 'created_at';
    103104    }
     
    114115    }catch (Exception $e) {}
    115116   
    116     if ($t = $this->_options['moretags']) {
     117    if (isset($this->_options['moretags']) && $t = $this->_options['moretags']) {
    117118      if (!is_array($t)) {
    118119        $s = $this->get_and_strip($obj, $t);
Note: See TracChangeset for help on using the changeset viewer.