Changeset 1369
- Timestamp:
- Sep 12, 2010, 3:40:20 PM (10 years ago)
- 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 4 4 { 5 5 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 } 6 10 return sfConfig::get('sf_log_dir').'/solr/commands.log'; 7 11 } … … 48 52 $this->file = null; 49 53 } 54 if (!file_exists($this->getFileCommands())) 55 touch($this->getFileCommands()); 50 56 rename($this->getFileCommands(), $lockfile); 51 57 sem_release($this->semaphore); -
cpc/trunk/project/lib/model/solr/SolrListener.php
r1332 r1369 61 61 { 62 62 $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)) 65 66 return ; 66 67 … … 70 71 $json['object_name'] = get_class($obj); 71 72 72 if ( $t = $this->_options['description']) {73 if (isset($this->_options['description']) && $t = $this->_options['description']) { 73 74 $content = $this->getObjFieldsValue($obj, $t); 74 75 $wordcount = str_word_count($content); … … 99 100 100 101 // par default la date est la created_at 101 if ( !($t = $this->_options['date'])) {102 if (!isset($this->_options['date']) || !($t = $this->_options['date'])) { 102 103 $t = 'created_at'; 103 104 } … … 114 115 }catch (Exception $e) {} 115 116 116 if ( $t = $this->_options['moretags']) {117 if (isset($this->_options['moretags']) && $t = $this->_options['moretags']) { 117 118 if (!is_array($t)) { 118 119 $s = $this->get_and_strip($obj, $t);
Note: See TracChangeset
for help on using the changeset viewer.