AAAAPK `?\ç\×½€ € node.phpnu W+A„¶ setParent($this);
}
}
/**
* Set the parent of a this node
*
* If the node already has a parent, the link is unset
*
* @param mixed &$parent The JNode for parent to be set or null
*
* @return void
*
* @since 11.1
*/
public function setParent(&$parent)
{
JLog::add('JNode::setParent() is deprecated.', JLog::WARNING, 'deprecated');
if ($parent instanceof JNode || is_null($parent))
{
$hash = spl_object_hash($this);
if (!is_null($this->_parent))
{
unset($this->_parent->children[$hash]);
}
if (!is_null($parent))
{
$parent->_children[$hash] = & $this;
}
$this->_parent = & $parent;
}
}
/**
* Get the children of this node
*
* @return array The children
*
* @since 11.1
*/
public function &getChildren()
{
JLog::add('JNode::getChildren() is deprecated.', JLog::WARNING, 'deprecated');
return $this->_children;
}
/**
* Get the parent of this node
*
* @return mixed JNode object with the parent or null for no parent
*
* @since 11.1
*/
public function &getParent()
{
JLog::add('JNode::getParent() is deprecated.', JLog::WARNING, 'deprecated');
return $this->_parent;
}
/**
* Test if this node has children
*
* @return boolean True if there are children
*
* @since 11.1
*/
public function hasChildren()
{
JLog::add('JNode::hasChildren() is deprecated.', JLog::WARNING, 'deprecated');
return (bool) count($this->_children);
}
/**
* Test if this node has a parent
*
* @return boolean True if there is a parent
*
* @since 11.1
*/
public function hasParent()
{
JLog::add('JNode::hasParent() is deprecated.', JLog::WARNING, 'deprecated');
return $this->getParent() != null;
}
}
PK `?\¦V‰
index.htmlnu W+A„¶
PK `?\*˜°8F F adapterinstance.phpnu W+A„¶ setProperties($options);
// Set the parent and db in case $options for some reason overrides it.
$this->parent = &$parent;
// Pull in the global dbo in case something happened to it.
$this->db = $db ? $db : JFactory::getDBO();
}
/**
* Retrieves the parent object
*
* @return object parent
*
* @since 11.1
*/
public function getParent()
{
return $this->parent;
}
}
PK `?\Öcá$1 1
object.phpnu W+A„¶ setProperties($properties);
}
}
/**
* Magic method to convert the object to a string gracefully.
*
* @return string The classname.
*
* @since 11.1
* @deprecated 12.3 Classes should provide their own __toString() implementation.
*/
public function __toString()
{
return get_class($this);
}
/**
* Sets a default value if not alreay assigned
*
* @param string $property The name of the property.
* @param mixed $default The default value.
*
* @return mixed
*
* @since 11.1
*/
public function def($property, $default = null)
{
$value = $this->get($property, $default);
return $this->set($property, $value);
}
/**
* Returns a property of the object or the default value if the property is not set.
*
* @param string $property The name of the property.
* @param mixed $default The default value.
*
* @return mixed The value of the property.
*
* @since 11.1
*
* @see getProperties()
*/
public function get($property, $default = null)
{
if (isset($this->$property))
{
return $this->$property;
}
return $default;
}
/**
* Returns an associative array of object properties.
*
* @param boolean $public If true, returns only the public properties.
*
* @return array
*
* @since 11.1
*
* @see get()
*/
public function getProperties($public = true)
{
$vars = get_object_vars($this);
if ($public)
{
foreach ($vars as $key => $value)
{
if ('_' == substr($key, 0, 1))
{
unset($vars[$key]);
}
}
}
return $vars;
}
/**
* Get the most recent error message.
*
* @param integer $i Option error index.
* @param boolean $toString Indicates if JError objects should return their error message.
*
* @return string Error message
*
* @since 11.1
* @see JError
* @deprecated 12.3 JError has been deprecated
*/
public function getError($i = null, $toString = true)
{
// Find the error
if ($i === null)
{
// Default, return the last message
$error = end($this->_errors);
}
elseif (!array_key_exists($i, $this->_errors))
{
// If $i has been specified but does not exist, return false
return false;
}
else
{
$error = $this->_errors[$i];
}
// Check if only the string is requested
if ($error instanceof Exception && $toString)
{
return (string) $error;
}
return $error;
}
/**
* Return all errors, if any.
*
* @return array Array of error messages or JErrors.
*
* @since 11.1
* @see JError
* @deprecated 12.3 JError has been deprecated
*/
public function getErrors()
{
return $this->_errors;
}
/**
* Modifies a property of the object, creating it if it does not already exist.
*
* @param string $property The name of the property.
* @param mixed $value The value of the property to set.
*
* @return mixed Previous value of the property.
*
* @since 11.1
*/
public function set($property, $value = null)
{
$previous = isset($this->$property) ? $this->$property : null;
$this->$property = $value;
return $previous;
}
/**
* Set the object properties based on a named array/hash.
*
* @param mixed $properties Either an associative array or another object.
*
* @return boolean
*
* @since 11.1
*
* @see set()
*/
public function setProperties($properties)
{
if (is_array($properties) || is_object($properties))
{
foreach ((array) $properties as $k => $v)
{
// Use the set function which might be overridden.
$this->set($k, $v);
}
return true;
}
return false;
}
/**
* Add an error message.
*
* @param string $error Error message.
*
* @return void
*
* @since 11.1
* @see JError
* @deprecated 12.3 JError has been deprecated
*/
public function setError($error)
{
array_push($this->_errors, $error);
}
/**
* Converts the object to a string (the class name).
*
* @return string
*
* @since 11.1
* @deprecated 12.1 Use magic method __toString()
* @see __toString()
*/
public function toString()
{
// @codeCoverageIgnoreStart
// Deprecation warning.
JLog::add('JObject::toString() is deprecated.', JLog::WARNING, 'deprecated');
return $this->__toString();
// @codeCoverageIgnoreEnd
}
}
PK `?\ÅËf( adapter.phpnu W+A„¶ _basepath = $basepath;
$this->_classprefix = $classprefix ? $classprefix : 'J';
$this->_adapterfolder = $adapterfolder ? $adapterfolder : 'adapters';
$this->_db = JFactory::getDBO();
}
/**
* Get the database connector object
*
* @return JDatabase Database connector object
*
* @since 11.1
*/
public function getDBO()
{
return $this->_db;
}
/**
* Set an adapter by name
*
* @param string $name Adapter name
* @param object &$adapter Adapter object
* @param array $options Adapter options
*
* @return boolean True if successful
*
* @since 11.1
*/
public function setAdapter($name, &$adapter = null, $options = array())
{
if (!is_object($adapter))
{
$fullpath = $this->_basepath . '/' . $this->_adapterfolder . '/' . strtolower($name) . '.php';
if (!file_exists($fullpath))
{
return false;
}
// Try to load the adapter object
require_once $fullpath;
$class = $this->_classprefix . ucfirst($name);
if (!class_exists($class))
{
return false;
}
$adapter = new $class($this, $this->_db, $options);
}
$this->_adapters[$name] = &$adapter;
return true;
}
/**
* Return an adapter.
*
* @param string $name Name of adapter to return
* @param array $options Adapter options
*
* @return object Adapter of type 'name' or false
*
* @since 11.1
*/
public function getAdapter($name, $options = array())
{
if (!array_key_exists($name, $this->_adapters))
{
if (!$this->setAdapter($name, $options))
{
$false = false;
return $false;
}
}
return $this->_adapters[$name];
}
/**
* Loads all adapters.
*
* @param array $options Adapter options
*
* @return void
*
* @since 11.1
*/
public function loadAllAdapters($options = array())
{
$list = JFolder::files($this->_basepath . '/' . $this->_adapterfolder);
foreach ($list as $filename)
{
if (JFile::getExt($filename) == 'php')
{
// Try to load the adapter object
require_once $this->_basepath . '/' . $this->_adapterfolder . '/' . $filename;
$name = JFile::stripExt($filename);
$class = $this->_classprefix . ucfirst($name);
if (!class_exists($class))
{
// Skip to next one
continue;
}
$adapter = new $class($this, $this->_db, $options);
$this->_adapters[$name] = clone $adapter;
}
}
}
}
PK `?\Ùü2UÂ Â observer.phpnu W+A„¶ attach($this);
// Set the subject to observe
$this->_subject = &$subject;
}
/**
* Method to update the state of observable objects
*
* @param array &$args An array of arguments to pass to the listener.
*
* @return mixed
*
* @since 11.1
* @deprecated 12.3
*/
public abstract function update(&$args);
}
PK `?\˜
‘0' ' tree.phpnu W+A„¶ _root = new JNode('ROOT');
$this->_current = & $this->_root;
}
/**
* Method to add a child
*
* @param array &$node The node to process
* @param boolean $setCurrent True to set as current working node
*
* @return mixed
*
* @since 11.1
*/
public function addChild(&$node, $setCurrent = false)
{
JLog::add('JTree::addChild() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current->addChild($node);
if ($setCurrent)
{
$this->_current = &$node;
}
}
/**
* Method to get the parent
*
* @return void
*
* @since 11.1
*/
public function getParent()
{
JLog::add('JTree::getParent() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_current->getParent();
}
/**
* Method to get the parent
*
* @return void
*
* @since 11.1
*/
public function reset()
{
JLog::add('JTree::reset() is deprecated.', JLog::WARNING, 'deprecated');
$this->_current = &$this->_root;
}
}
PK `?\r ú¢ ¢ observable.phpnu W+A„¶ _observers = array();
}
/**
* Get the state of the JObservable object
*
* @return mixed The state of the object.
*
* @since 11.1
* @deprecated 12.3
*/
public function getState()
{
return $this->_state;
}
/**
* Update each attached observer object and return an array of their return values
*
* @return array Array of return values from the observers
*
* @since 11.1
* @deprecated 12.3
*/
public function notify()
{
// Iterate through the _observers array
foreach ($this->_observers as $observer)
{
$return[] = $observer->update();
}
return $return;
}
/**
* Attach an observer object
*
* @param object $observer An observer object to attach
*
* @return void
*
* @since 11.1
* @deprecated 12.3
*/
public function attach($observer)
{
if (is_array($observer))
{
if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler']))
{
return;
}
// Make sure we haven't already attached this array as an observer
foreach ($this->_observers as $check)
{
if (is_array($check) && $check['event'] == $observer['event'] && $check['handler'] == $observer['handler'])
{
return;
}
}
$this->_observers[] = $observer;
end($this->_observers);
$methods = array($observer['event']);
}
else
{
if (!($observer instanceof JObserver))
{
return;
}
// Make sure we haven't already attached this object as an observer
$class = get_class($observer);
foreach ($this->_observers as $check)
{
if ($check instanceof $class)
{
return;
}
}
$this->_observers[] = $observer;
$methods = array_diff(get_class_methods($observer), get_class_methods('JPlugin'));
}
$key = key($this->_observers);
foreach ($methods as $method)
{
$method = strtolower($method);
if (!isset($this->_methods[$method]))
{
$this->_methods[$method] = array();
}
$this->_methods[$method][] = $key;
}
}
/**
* Detach an observer object
*
* @param object $observer An observer object to detach.
*
* @return boolean True if the observer object was detached.
*
* @since 11.1
* @deprecated 12.3
*/
public function detach($observer)
{
// Initialise variables.
$retval = false;
$key = array_search($observer, $this->_observers);
if ($key !== false)
{
unset($this->_observers[$key]);
$retval = true;
foreach ($this->_methods as &$method)
{
$k = array_search($key, $method);
if ($k !== false)
{
unset($method[$k]);
}
}
}
return $retval;
}
}
PK `?\®)ÕÐ .htaccessnu W+A„¶
Order allow,deny
Deny from all
PK `?\ç\×½€ € node.phpnu W+A„¶ PK `?\¦V‰
¸ index.htmlnu W+A„¶ PK `?\*˜°8F F adapterinstance.phpnu W+A„¶ PK `?\Öcá$1 1
š object.phpnu W+A„¶ PK `?\ÅËf( ' adapter.phpnu W+A„¶ PK `?\Ùü2UÂ Â _6 observer.phpnu W+A„¶ PK `?\˜
‘0' ' ]; tree.phpnu W+A„¶ PK `?\r ú¢ ¢ ¼B observable.phpnu W+A„¶ PK `?\®)ÕÐ œQ .htaccessnu W+A„¶ PK ¥ TR