server/src/app/Libraries/CocoonUtils.php
changeset 314 f5690d918358
parent 308 e032d686d88e
child 502 74fba571487e
equal deleted inserted replaced
313:706f10bcdc3c 314:f5690d918358
    74             (strpos(strtolower($res->getUri()), "collection", strlen(config('corpusparole.cocoon_doc_id_base_uri'))) !== FALSE) ||
    74             (strpos(strtolower($res->getUri()), "collection", strlen(config('corpusparole.cocoon_doc_id_base_uri'))) !== FALSE) ||
    75             (strpos(strtolower($res->getUri()), "collection", strlen(config('corpusparole.corpus_doc_id_base_uri'))) !== FALSE)
    75             (strpos(strtolower($res->getUri()), "collection", strlen(config('corpusparole.corpus_doc_id_base_uri'))) !== FALSE)
    76         );
    76         );
    77     }
    77     }
    78 
    78 
       
    79     public static function getGeonamesidFromUrl($url) {
       
    80         $matches = [];
       
    81         if(preg_match(config('corpusparole.geonames_url_regexp'), $url, $matches) === 1) {
       
    82             return $matches[1];
       
    83         }
       
    84         else {
       
    85             return null;
       
    86         }
       
    87     }
       
    88 
    79 }
    89 }