Forgot something to make it work

This commit is contained in:
Patrick Winnertz
2024-08-23 09:58:44 +02:00
parent 8463eda5ba
commit 01457019bf
2 changed files with 31 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ class cron extends CI_Controller {
echo "CRON: " . $cron->id . " -> RUNNING...\n";
$url = local_url() . $cron->function;
echo "CRON: " . $cron->id . " -> URL: " . $url . "\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);

View File

@@ -322,6 +322,36 @@ class CI_Config {
return $base_url.$this->_uri_string($uri);
}
/**
* Local URL
*
* Returns local_url [. uri_string]
*
* @uses CI_Config::_uri_string()
*
* @param string|string[] $uri URI string or an array of segments
* @param string $protocol
* @return string
*/
public function local_url($uri = '', $protocol = NULL)
{
$local_url = $this->slash_item('local_url');
if (isset($protocol))
{
// For protocol-relative links
if ($protocol === '')
{
$local_url = substr($local_url, strpos($local_url, '//'));
}
else
{
$local_url = $protocol.substr($local_url, strpos($local_url, '://'));
}
}
return $local_url.$this->_uri_string($uri);
}
// -------------------------------------------------------------
/**