for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Richdynamix\PersonalisedProducts\Helper;
/**
* Class Urls
*
* @category Richdynamix
* @package PersonalisedProducts
* @author Steven Richardson ([email protected]) @mage_gizmo
*/
class Urls
{
* Construct the URL from the correct values stored in the config
* @param $url
* @param $port
* @return string
public function buildUrl($url, $port)
return trim($this->_checkUrlScheme($url), '/') . ":" . $port;
}
* Check the admin user has added a URL scheme (default to http://)
private function _checkUrlScheme($url)
$parsed = parse_url($url);
if (empty($parsed['scheme'])) {
$url = 'http://' . $url;
return $url;