Changeset 181
- Timestamp:
- 06/18/08 20:00:00 (3 months ago)
- Location:
- ez_publish/myutils/trunk
- Files:
-
- 2 added
- 1 removed
- 2 modified
-
autoloads/ezp_extension.php (added)
-
classes/myutilsfunction.php (modified) (4 diffs)
-
cronjobs/_planet.php (deleted)
-
cronjobs/planet.php (modified) (12 diffs)
-
settings/curl.ini.append.php (added)
Legend:
- Unmodified
- Added
- Removed
-
ez_publish/myutils/trunk/classes/myutilsfunction.php
r180 r181 35 35 * Permet de nettoyer une string avec tidy 36 36 * 37 * @param unknown_type$str37 * @param string $str 38 38 */ 39 39 static function cleanTidy( &$str ) { … … 42 42 { 43 43 $tidy = new tidy; 44 /* Mettre dans un ini */44 /* Mettre dans un ini pour faire plus propre */ 45 45 $config = array( 'show-body-only' => true, 46 46 'output-xhtml' => true, … … 57 57 58 58 /** 59 * Enter description here...59 * Recopie de la fonction eZHTTPTool::getDataByURL mais avec des options cURL en plus... 60 60 * 61 61 * @param unknown_type $url … … 71 71 72 72 /* Ajout d'un timeout sur cURL*/ 73 /* Mettre dans un ini */ 74 curl_setopt( $ch, CURLOPT_TIMEOUT, 15 ); 73 $iniCurl = eZINI::instance( "curl.ini" ); 74 curl_setopt( $ch, CURLOPT_LOW_SPEED_TIME, $iniCurl->variable( 'cURLOption', 'CURLOPT_LOW_SPEED_TIME' ) ); 75 curl_setopt( $ch, CURLOPT_TIMEOUT, $iniCurl->variable( 'cURLOption', 'CURLOPT_TIMEOUT' ) ); 76 77 75 78 if ( $justCheckURL ) 76 79 { -
ez_publish/myutils/trunk/cronjobs/planet.php
r178 r181 37 37 //include_once( "lib/ezdb/classes/ezdb.php" ); 38 38 //include_once( "lib/ezutils/classes/ezhttptool.php" ); 39 40 //For ezUser, we would make this the ezUser class id but otherwise just pick and choose. 39 //include_once( "extension/myutils/classes/myutilsfunction.php" ); 40 41 41 42 42 43 $iniPlanet = eZINI::instance( "planet.ini" ); … … 45 46 $rssImportArray = $rssImportArray->children (); 46 47 47 /*$rssImportArray->subTree( array( 'Depth' => 1,48 'SortBy => array( 'priority', true() )49 );*/50 51 48 52 49 // Loop through all configured and active rss imports. If something goes wrong while processing them, continue to next import … … 57 54 $rssImportDataMap = $rssImport->dataMap(); 58 55 $rssSource = $rssImportDataMap['location_rss']->content(); 56 59 57 if( empty($rssSource)) 60 58 { … … 70 68 } 71 69 72 $xmlData = eZHTTPTool::getDataByURL( $rssSource );70 $xmlData = myUtilsFunctions::getDataByURL( $rssSource ); 73 71 if ( $xmlData === false ) 74 72 { … … 140 138 eZStaticCache::executeActions(); 141 139 142 /*! 143 Parse RSS 1.0 feed 144 145 \param DOM root node 146 \param RSS Import item 147 \param cli 148 */ 140 141 142 /** 143 * Parse RSS 1.0 feed 144 * @param DOM root node 145 * @param RSS Import item 146 * @param cli 147 */ 149 148 function rssImport1( $root, $rssImport, $cli ) 150 149 { … … 167 166 $cli->output( 'RSSImport '.$rssImport->attribute( 'name' ).': End. '.$addCount.' objects added' ); 168 167 } 169 170 } 171 172 /*! 173 Parse RSS 2.0 feed 174 175 \param DOM root node176 \param RSS Import item177 \param cli178 */168 } 169 170 171 172 /** 173 * Parse RSS 2.0 feed 174 * @param DOM root node 175 * @param RSS Import item 176 * @param cli 177 */ 179 178 function rssImport2( $root, $rssImport, $cli ) 180 179 { … … 196 195 $cli->output( 'RSSImport '.$rssImport->attribute( 'name' ).': End. '.$addCount.' objects added' ); 197 196 } 198 199 } 200 201 /*! 202 Import specifiec rss item into content tree 203 204 \param RSS item xml element 205 \param $rssImport Object 206 \param cli 207 \param channel 208 209 \return 1 if object added, 0 if not 210 */ 197 } 198 199 200 201 /** 202 * Import specifiec rss item into content tree 203 * @param RSS item xml element 204 * @param $rssImport Object 205 * @param cli 206 * @param channel 207 * @return 1 if object added, 0 if not 208 */ 211 209 function importRSSItem( $item, $rssImport, $cli, $channel ) 212 210 { … … 424 422 } 425 423 424 425 /** 426 * 427 * 428 * @param array $importDescriptionArray 429 * @param DOM $xmlDomNode 430 * @return unknown 431 */ 426 432 function recursiveFindRSSElementValue( $importDescriptionArray, $xmlDomNode ) 427 433 { … … 459 465 } 460 466 467 468 469 /** 470 * Enter description here... 471 * 472 * @param unknown_type $objectAttribute 473 * @param unknown_type $value 474 */ 461 475 function setObjectAttributeValue( $objectAttribute, $value ) 462 476 { … … 501 515 } 502 516 517 518 519 /** 520 * Enter description here... 521 * 522 * @param unknown_type $attribute 523 * @param unknown_type $attributeValue 524 * @param unknown_type $link 525 */ 503 526 function setEZXMLAttribute( $attribute, $attributeValue, $link = false ) 504 527 { … … 525 548 526 549 550 551 /** 552 * Enter description here... 553 * 554 * @param unknown_type $attribute 555 * @param unknown_type $attributeValue 556 * @param unknown_type $link 557 */ 527 558 function setEZTXTAttribute( $attribute, $attributeValue, $link = false ) 528 559 { 529 /* Nettoyage tidy */ 530 if ( class_exists( 'tidy' ) ) 531 { 532 $tidy = new tidy; 533 $config = array( 'show-body-only' => true, 534 'output-xhtml' => true, 535 'wrap' => 0, 536 'alt-text' => "" 537 ); 538 $tidy->parseString( $attributeValue, $config, 'utf8' ); 539 $tidy->cleanRepair(); 540 $attributeValue = $tidy; 541 } 560 myUtilsFunctions::cleanTidy( $attributeValue ); 542 561 543 562 /* Liens relatifs dans un flux RSS ! */ … … 549 568 } 550 569 551 552 570 ?>
