# HG changeset patch # User cavaliet # Date 1330077301 -3600 # Node ID 021131fbe2c571695ce3bac8f1ff26ccae33cc72 # Parent bb7808e180c36f859a9d986d6639d87504c9e71e# Parent ca2a145e67f350ba8d00c9ff62e9ad001f2c1c8e merge diff -r ca2a145e67f3 -r 021131fbe2c5 Controller/WikiTagController.php --- a/Controller/WikiTagController.php Thu Feb 23 23:02:07 2012 +0100 +++ b/Controller/WikiTagController.php Fri Feb 24 10:55:01 2012 +0100 @@ -107,6 +107,7 @@ } $ordered_tags = $this->getDoctrine()->getRepository('WikiTagBundle:DocumentTag')->findOrderedTagsForDoc($id_doc); + //$ordered_tags = null; return $this->render('WikiTagBundle:WikiTag:documentTags.html.twig', array('ordered_tags' => $ordered_tags, 'doc_id' => $id_doc, 'columns' => $columns_array)); } diff -r ca2a145e67f3 -r 021131fbe2c5 DependencyInjection/Configuration.php --- a/DependencyInjection/Configuration.php Thu Feb 23 23:02:07 2012 +0100 +++ b/DependencyInjection/Configuration.php Fri Feb 24 10:55:01 2012 +0100 @@ -73,6 +73,12 @@ ->prototype('variable') ->end() ->end() + ->arrayNode('curl_options') + ->treatNullLike(array()) + ->useAttributeAsKey('name') + ->prototype('variable') + ->end() + ->end() ->end(); return $treeBuilder; diff -r ca2a145e67f3 -r 021131fbe2c5 DependencyInjection/WikiTagExtension.php --- a/DependencyInjection/WikiTagExtension.php Thu Feb 23 23:02:07 2012 +0100 +++ b/DependencyInjection/WikiTagExtension.php Fri Feb 24 10:55:01 2012 +0100 @@ -61,5 +61,6 @@ $container->setParameter("wiki_tag.route_for_documents_by_tag", $config['route_for_documents_by_tag']); $container->setParameter("wiki_tag.reactive_selectors", $config['reactive_selectors']); $container->setParameter("wiki_tag.document_list_profile", $config['document_list_profile']); + $container->setParameter("wiki_tag.curl_options", $config['curl_options']); } } diff -r ca2a145e67f3 -r 021131fbe2c5 Resources/public/css/wikiTag.css --- a/Resources/public/css/wikiTag.css Thu Feb 23 23:02:07 2012 +0100 +++ b/Resources/public/css/wikiTag.css Fri Feb 24 10:55:01 2012 +0100 @@ -19,6 +19,7 @@ float: left; overflow: auto; width: 100%; + min-height: 300px; } #wikitag_table { width: 100%; diff -r ca2a145e67f3 -r 021131fbe2c5 Utils/WikiTagUtils.php --- a/Utils/WikiTagUtils.php Thu Feb 23 23:02:07 2012 +0100 +++ b/Utils/WikiTagUtils.php Fri Feb 24 10:55:01 2012 +0100 @@ -208,9 +208,25 @@ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - //TODO: change - curl_setopt($ch, CURLOPT_USERAGENT, 'http://www.iri.centrepompidou.fr'); + // default values + curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.1) Gecko/20100101 Firefox/10.0.1'); curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000); + // Set options if they are set in the config.yml file, typically for proxy configuration. + // Thanks to the configuration file, it will execute commands like "curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);" or "curl_setopt($ch, CURLOPT_PROXY, "xxx.yyy.zzz:PORT");" + $curl_options = $GLOBALS["kernel"]->getContainer()->getParameter("wiki_tag.curl_options"); + foreach ($curl_options as $key => $value) { + if(strtoupper($value)=='TRUE'){ + $value = TRUE; + } + else if (strtoupper($value)=='FALSE'){ + $value = FALSE; + } + else if (defined($value)){ + $value = constant($value); + } + curl_setopt($ch, constant($key), $value); + } + // end of treatment $res = curl_exec($ch); $curl_errno = curl_errno($ch); $curl_error = curl_error($ch);