| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* A PHP cron script to format all the addresses in the database. Currently
* @return array
* @throws Exception
*/
- function processContacts(&$config, $processGeocode, $parseStreetAddress) {
+ public function processContacts(&$config, $processGeocode, $parseStreetAddress) {
// build where clause.
$clause = array('( c.id = a.contact_id )');
$params = array();
$dao = CRM_Core_DAO::executeQuery($query, $params);
if ($processGeocode) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $config->geocodeMethod) . '.php';
}
-
$unparseableContactAddress = array();
while ($dao->fetch()) {
$totalAddresses++;
}
$className = $config->geocodeMethod;
- $className::format( $params, true );
+ $className::format($params, TRUE);
// see if we got a geocode error, in this case we'll trigger a fatal
// CRM-13760
}
$this->returnMessages[] = ts("Addresses Evaluated: %1", array(
- 1 => $totalAddresses)) . "\n";
+ 1 => $totalAddresses,
+ )) . "\n";
if ($processGeocode) {
$this->returnMessages[] = ts("Addresses Geocoded: %1", array(
- 1 => $totalGeocoded)) . "\n";
+ 1 => $totalGeocoded,
+ )) . "\n";
}
if ($parseStreetAddress) {
$this->returnMessages[] = ts("Street Addresses Parsed: %1", array(
- 1 => $totalAddressParsed)) . "\n";
+ 1 => $totalAddressParsed,
+ )) . "\n";
if ($unparseableContactAddress) {
$this->returnMessages[] = "<br />\n" . ts("Following is the list of contacts whose address is not parsed:") . "<br />\n";
foreach ($unparseableContactAddress as $contactLink) {
/**
* @return array
*/
- function returnResult() {
- $result = array();
+ public function returnResult() {
+ $result = array();
$result['is_error'] = $this->returnError;
$result['messages'] = implode("", $this->returnMessages);
return $result;
}
-}
+}