<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*/
-
class CRM_Utils_XML {
/**
*
* @param $file
*
- * @return array (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE)
+ * @return array
+ * (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE)
*/
public static function parseFile($file) {
$xml = FALSE; // SimpleXMLElement
$error = FALSE; // string
- if (! file_exists($file)) {
+ if (!file_exists($file)) {
$error = 'File ' . $file . ' does not exist.';
- } else {
+ }
+ else {
$oldLibXMLErrors = libxml_use_internal_errors();
libxml_use_internal_errors(TRUE);
*
* @param $string
*
- * @return array (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE)
+ * @return array
+ * (0 => SimpleXMLElement|FALSE, 1 => errorMessage|FALSE)
*/
public static function parseString($string) {
$xml = FALSE; // SimpleXMLElement
$parts = array();
if ($error->file) {
- $parts[] = "File=$error->file";
+ $parts[] = "File=$error->file";
}
$parts[] = "Line=$error->line";
$parts[] = "Column=$error->column";
}
/**
- * Convert an XML element to an array
+ * Convert an XML element to an array.
*
- * @param $obj SimpleXMLElement
+ * @param $obj
+ * SimpleXMLElement.
*
* @return array
*/
}
return $arr;
}
+
}