dolibarr  7.0.0-beta
Functions
geturl.lib.php File Reference

This file contains functions dedicated to get URL. More...

Go to the source code of this file.

Functions

 getURLContent ($url, $postorget='GET', $param='', $followlocation=1, $addheaders=array())
 Function get content from an URL (use proxy if proxy defined) More...
 
 getDomainFromURL ($url)
 Function get second level domain name. More...
 
 getRootURLFromURL ($url)
 Function root url from a long url For example: https://www.abc.mydomain.com/dir/page.html return 'https://www.abc.mydomain.com' For example: http://www.abc.mydomain.com/ return 'https://www.abc.mydomain.com'. More...
 
 removeHtmlComment ($content)
 Function to remove comments into HTML content. More...
 

Detailed Description

This file contains functions dedicated to get URL.

Definition in file geturl.lib.php.

Function Documentation

getDomainFromURL (   $url)

Function get second level domain name.

For example: https://www.abc.mydomain.com/dir/page.html return 'mydomain'

Parameters
string$urlFull URL.
Returns
string Returns domaine name

Definition at line 171 of file geturl.lib.php.

getRootURLFromURL (   $url)

Function root url from a long url For example: https://www.abc.mydomain.com/dir/page.html return 'https://www.abc.mydomain.com' For example: http://www.abc.mydomain.com/ return 'https://www.abc.mydomain.com'.

Parameters
string$urlFull URL.
Returns
string Returns root url

Definition at line 189 of file geturl.lib.php.

Referenced by getAllImages().

getURLContent (   $url,
  $postorget = 'GET',
  $param = '',
  $followlocation = 1,
  $addheaders = array() 
)

Function get content from an URL (use proxy if proxy defined)

Parameters
string$urlURL to call.
string$postorget'POST', 'GET', 'HEAD', 'PUT', 'PUTALREADYFORMATED', 'DELETE'
string$paramParameters of URL (x=value1&y=value2) or may be a formated content with PUTALREADYFORMATED
integer$followlocation1=Follow location, 0=Do not follow
string[]$addheaders Array of string to add into header. Example: ('Accept: application/xrds+xml', ....)
Returns
array Returns an associative array containing the response from the server array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)

Definition at line 34 of file geturl.lib.php.

References dol_syslog().

Referenced by getAllImages(), Setup\getCheckIntegrity(), SimpleOpenID\GetOpenIDServer(), and PriceGlobalVariableUpdater\process().

removeHtmlComment (   $content)

Function to remove comments into HTML content.

Parameters
string$contentText content
Returns
string Returns text without HTML comments

Definition at line 206 of file geturl.lib.php.