I got this error: Fatal error: Class 'GantryArrayHelper' not found in ../libraries/gantry/core/utilities/gantryregistry.class.php on line 363
Using J1.7.2
Gantry 3.2.11
Templates Taychon and Entropy
Everything has worked for several days. Only change made today is setting 'title span' to off. Now frontend is blank and so is the Taychon settings. I can se the Entropy settings, but it's also blank in frontend.
I have been having the same problem. I re-installed a couple of times only to have it re-occur every time I save a style to ZT-Forci- a zoo template which is supposed to work with the Gantry frame work.
I have read the forums and seen that this issue has not been satisfactorily resolved for several years.
The message is that the system cant find gantryarrayhelper.class
I googled gantryarrayhelper.class.php without results
My thought is that if one could find code for such a class,one could add it to the utilities directory- and see if gantryregistry.class knows it is there.
My only other thought is that perhaps I need to add a template style for GT-Forci to this code found at Template Manager: Edit File
Editing file "index.php" in template "rt_gantry_j16". Source Code
Interesting post. I and many others would be thankful for another classic Andrew E or James S cogent explanation of where RT, Zoo, Gavick, and Joomlart templates cross paths and what makes them incompatible with each other.
The RT team is superb, but their Achilles heel is documenting how the Gantry pieces fit with templates (both RT and other) and other plug-ins. After two years, it remains a mystery despite all our entreaties, and this lack of documentation has caused anguish among clients.
I copied it to the utilities directory but the message is still the same.Perhaps there need to be some instructions for accessing the file added to the code.
I also found this explanation of styles on the Gantry Tutorial and tried added all the styles from the ZT-Forci Template that might not be included. that didn't work either
require_once (realpath(dirname(__FILE__)) . '/core/gantryarrayhelper.class.php'); to gantry,php and got a fatal error that the file couldn't access C:/php/pear- Which I tried installing and ran into some issues, which I am still trying to resolve. I read the pear information and it sounded that it might be useful in this instance. My installation is on a wamp server.
Then I found that someone had resolved this problem by installing afresh version of JCK editor with a bug fix, I installed that but the issue is still there and I haven;t figured out how to make appropriate use of that editor.
Guess I will do a fresh install to get back to normal again- which is what I have to do every time I test out the ZT-Style save to see if it works. I'll install the JCK editor first. And give it a break for a while.
When I installed the wamp server and gantry on anXP computer, I foun dthat there was a different gantryregistryclass.php.
I replace that with the file of the same name on my Windows& machine. The error message went away and I can now edit ZT_Forci Styles without losing access to Gantry.
However Gantry administration appears all mixed up- which I will work on.
Fore reference this is the code in the gantryregistry.class.php that I used to replace the code with the reference to Gantry Array Helper. The gantryarrayhelper.class.php was also found in the utilities file on the XP installation.
This is the code that replaced the code that didn't work:
public function toString($format = 'JSON', $options = array())
{
// Return a namespace in a given format
$handler = GantryRegistryFormat::getInstance($format);
This is the entire gantryregistry.class.php file from teh XP installation:
<?php
/**
* @version 3.2.12 October 30, 2011
* @author RocketTheme
www.rockettheme.com
* @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
* @license
www.gnu.org/licenses/gpl-2.0.html
GNU/GPLv2 only
*
* derived from Joomla with original copyright and license
* @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('GANTRY_VERSION') or die;
/**
* Magic function to clone the registry object.
*/
public function __clone()
{
$this->data = unserialize(serialize($this->data));
}
/**
* Magic function to render this object as a string using default args of toString method.
*/
public function __toString()
{
return $this->toString();
}
/**
* Sets a default value if not alreay assigned.
*
* @param string The name of the parameter.
* @param string An optional value for the parameter.
* @param string An optional group for the parameter.
* @return string The value set, or the default if the value was not previously set (or null).
* @since 1.6
*/
public function def($key, $default = '')
{
$value = $this->get($key, (string) $default);
$this->set($key, $value);
return $value;
}
/**
* Check if a registry path exists.
*
* @param string Registry path (e.g. joomla.content.showauthor)
* @return boolean
* @since 1.6
*/
public function exists($path)
{
// Explode the registry path into an array
if ($nodes = explode('.', $path)) {
// Initialize the current node to be the registry root.
$node = $this->data;
// Traverse the registry to find the correct node for the result.
for ($i = 0,$n = count($nodes); $i < $n; $i++) {
if (isset($node->$nodes[$i])) {
$node = $node->$nodes[$i];
} else {
break;
}
if ($i+1 == $n) {
return true;
}
}
}
return false;
}
/**
* Get a registry value.
*
* @param string Registry path (e.g. joomla.content.showauthor)
* @param mixed Optional default value, returned if the internal value is null.
* @return mixed Value of entry or null
* @since 1.6
*/
public function get($path, $default = null)
{
// Initialise variables.
$result = $default;
if(!strpos($path, '.'))
{
return (isset($this->data->$path) && $this->data->$path !== null && $this->data->$path !== '') ? $this->data->$path : $default;
}
// Explode the registry path into an array
$nodes = explode('.', $path);
// Initialize the current node to be the registry root.
$node = $this->data;
$found = false;
// Traverse the registry to find the correct node for the result.
foreach ($nodes as $n) {
if (is_object($node) && isset($node->$n)) {
$node = $node->$n;
$found = true;
}
elseif (is_array($node) && array_key_exists($n, $node))
{
$node = $node[$n];
$found = true;
}
else {
$found = false;
break;
}
}
if ($found && $node !== null && $node !== '') {
$result = $node;
}
return $result;
}
/**
* Returns a reference to a global GantryRegistry object, only creating it
* if it doesn't already exist.
*
* This method must be invoked as:
* <pre>$registry = GantryRegistry::getInstance($id);</pre>
*
* @param string An ID for the registry instance
* @return object The GantryRegistry object.
* @since 1.5
*/
public static function getInstance($id)
{
static $instances;
if (!isset ($instances)) {
$instances = array ();
}
if (empty ($instances[$id])) {
$instances[$id] = new GantryRegistry();
}
return $instances[$id];
}
/**
* Load a associative array of values into the default namespace
*
* @param array Associative array of value to load
* @param string The name of the namespace
* @return boolean True on success
* @since 1.5
*/
public function loadArray($array)
{
$this->bindData($this->data, $array);
return true;
}
/**
* Load the public variables of the object into the default namespace.
*
* @param object The object holding the public vars to load
* @param string Namespace to load the INI string into [optional]
* @return boolean True on success
* @since 1.5
*/
public function loadObject($object)
{
$this->bindData($this->data, $object);
return true;
}
/**
* Load the contents of a file into the registry
*
* @param string Path to file to load
* @param string Format of the file [optional: defaults to JSON]
* @param mixed Options used by the formatter
* @return boolean True on success
* @since 1.5
*/
// public function loadFile($file, $format = 'JSON', $options = array())
// {
// // Get the contents of the file
// jimport('joomla.filesystem.file');
// $data = JFile::read($file);
//
// return $this->loadString($data, $format, $options);
// }
/**
* Load a string into the registry
*
* @param string string to load into the registry
* @param string format of the string
* @param mixed Options used by the formatter
* @return boolean True on success
* @since 1.5
*/
public function loadString($data, $format = 'JSON', $options = array())
{
// Load a string into the given namespace [or default namespace if not given]
$handler = JRegistryFormat::getInstance($format);
/**
* Set a registry value.
*
* @param string Registry Path (e.g. joomla.content.showauthor)
* @param mixed Value of entry
* @return mixed The value of the that has been set.
* @since 1.6
*/
public function set($path, $value)
{
$result = null;
// Explode the registry path into an array
if ($nodes = explode('.', $path)) {
// Initialize the current node to be the registry root.
$node = $this->data;
// Traverse the registry to find the correct node for the result.
for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) {
if (!isset($node->$nodes[$i]) && ($i != $n)) {
$node->$nodes[$i] = new stdClass();
}
$node = $node->$nodes[$i];
}
// Get the old value if exists so we can return it
$result = $node->$nodes[$i] = $value;
}
return $result;
}
/**
* Transforms a namespace to an array
*
* @param string Namespace to return [optional: null returns the default namespace]
* @return array An associative array holding the namespace data
* @since 1.5
*/
public function toArray()
{
return (array) $this->asArray($this->data);
}
/**
* Transforms a namespace to an object
*
* @param string Namespace to return [optional: null returns the default namespace]
* @return object An an object holding the namespace data
* @since 1.5
*/
public function toObject()
{
return $this->data;
}
/**
* Get a namespace in a given string format
*
* @param string Format to return the string in
* @param mixed Parameters used by the formatter, see formatters for more info
* @return string Namespace in string format
* @since 1.5
*/
public function toString($format = 'JSON', $options = array())
{
// Return a namespace in a given format
$handler = GantryRegistryFormat::getInstance($format);
/**
* Method to recursively bind data to a parent object.
*
* @param object $parent The parent object on which to attach the data values.
* @param mixed $data An array or object of data to bind to the parent object.
*
* @return void
* @since 1.6
*/
protected function bindData(& $parent, $data)
{
// Ensure the input data is an array.
if(is_object($data)) {
$data = get_object_vars($data);
} else {
$data = (array) $data;
}
foreach ($data as $k => $v) {
if ((is_array($v) && GantryArrayHelper::isAssociative($v)) || is_object($v)) {
$parent->$k = new stdClass();
$this->bindData($parent->$k, $v);
} else {
$parent->$k = $v;
}
}
}
/**
* Method to recursively convert an object of data to an array.
*
* @param object $data An object of data to return as an array.
*
* @return array Array representation of the input object.
* @since 1.6
*/
protected function asArray($data)
{
$array = array();
/**
* Load an XML string into the registry into the given namespace [or default if a namespace is not given]
*
* @param string XML formatted string to load into the registry
* @param string Namespace to load the XML string into [optional]
* @return boolean True on success
* @since 1.5
* @deprecated 1.6 - Oct 25, 2010
*/
public function loadXML($data, $namespace = null)
{
return $this->loadString($data, 'XML');
}
/**
* Load an INI string into the registry into the given namespace [or default if a namespace is not given]
*
* @param string INI formatted string to load into the registry
* @param string Namespace to load the INI string into [optional]
* @param mixed An array of options for the formatter, or boolean to process sections.
* @return boolean True on success
* @since 1.5
* @deprecated 1.6 - Oct 25, 2010
*/
public function loadINI($data, $namespace = null, $options = array())
{
return $this->loadString($data, 'INI', $options);
}
/**
* Load an JSON string into the registry into the given namespace [or default if a namespace is not given]
*
* @param string JSON formatted string to load into the registry
* @return boolean True on success
* @since 1.5
* @deprecated 1.6 - Oct 25, 2010
*/
public function loadJSON($data)
{
return $this->loadString($data, 'JSON');
}
/**
* Create a namespace
*
* @param string Name of the namespace to create
* @return boolean True on success
* @since 1.5
* @deprecated 1.6 - Jan 19, 2010
*/
public function makeNameSpace($namespace)
{
//$this->_registry[$namespace] = array('data' => new stdClass());
return true;
}
/**
* Get the list of namespaces
*
* @return array List of namespaces
* @deprecated 1.6 - Jan 19, 2010
*/
public function getNameSpaces()
{
//return array_keys($this->_registry);
return array();
}
/**
* Get a registry value
*
* @param string Registry path (e.g. joomla.content.showauthor)
* @param mixed Optional default value
* @return mixed Value of entry or null
* @deprecated 1.6 - Jan 19, 2010
*/
public function getValue($path, $default=null)
{
$parts = explode('.', $path);
if (count($parts) > 1) {
unset($parts[0]);
$path = implode('.', $parts);
}
return $this->get($path, $default);
}
/**
* Set a registry value
*
* @param string Registry Path (e.g. joomla.content.showauthor)
* @param mixed Value of entry
* @return mixed The value after setting.
* @deprecated 1.6 - Jan 19, 2010
*/
public function setValue($path, $value)
{
$parts = explode('.', $path);
if (count($parts) > 1) {
unset($parts[0]);
$path = implode('.', $parts);
}
return $this->set($path, $value);
}
/**
* This method is added as an interim solution for API references in Joomla! 1.6 to the JRegistry
* object where in 1.5 a JParameter object existed. Because many extensions may call this method
* we add it here as a means of "pain relief" until the 1.7 release.
*
* @return boolean True.
*
* @deprecated 1.6 - Jun 17, 2010
* @todo Remove this method for the 1.7 release.
*/
public function loadSetupFile()
{
return true;
}
}