for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* this is a very basic class with as its sole purpose providing
* the country of the customer.
* By default we are using the GEOIP class
* but you can switch it to your own system by changing
* the classname in the ecommerce.yml config file.
*/
class EcommerceCountry_VisitorCountryProvider extends Object implements EcommerceGEOipProvider
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
* @return string (Country Code - e.g. NZ, AU, or AF)
public function getCountry()
if (class_exists('Geoip')) {
return Geoip::visitor_country();
} else {
return Config::inst()->get('EcommerceCountry', 'default_country_code');
}
* returns string of IP address.
public function getIP()
return Controller::curr()->getRequest()->getIP();
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.