Skip to content

Commit c1b0295

Browse files
Nicholas K. Dionysopouloswilsonge
authored andcommitted
Updated to FOF 2.5.5 (#11673)
1 parent 09cea21 commit c1b0295

File tree

205 files changed

+24134
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+24134
-601
lines changed

libraries/fof/LICENSE.txt

Lines changed: 345 additions & 0 deletions
Large diffs are not rendered by default.

libraries/fof/autoloader/component.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage autoloader
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/autoloader/fof.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage autoloader
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/config/domain/dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage config
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/config/domain/interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage config
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/config/domain/tables.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage config
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/config/domain/views.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage config
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/config/provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage config
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2, or later
77
*/
88

libraries/fof/controller/controller.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* @package FrameworkOnFramework
44
* @subpackage controller
5-
* @copyright Copyright (C) 2010 - 2015 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
66
* @license GNU General Public License version 2 or later; see LICENSE.txt
77
*/
88

@@ -480,6 +480,13 @@ public function __construct($config = array())
480480
{
481481
$mName = $rMethod->getName();
482482

483+
// If the developer screwed up and declared one of the helper method public do NOT make them available as
484+
// tasks.
485+
if ((substr($mName, 0, 8) == 'onBefore') || (substr($mName, 0, 7) == 'onAfter') || substr($mName, 0, 1) == '_')
486+
{
487+
continue;
488+
}
489+
483490
// Add default display method if not explicitly declared.
484491
if (!in_array($mName, $xMethods) || in_array($mName, $iMethods))
485492
{
@@ -1049,8 +1056,9 @@ public function display($cachable = false, $urlparams = false, $tpl = null)
10491056
$groups = $user->groups;
10501057
}
10511058

1052-
// Set up safe URL parameters
1059+
$importantParameters = array();
10531060

1061+
// Set up safe URL parameters
10541062
if (!is_array($urlparams))
10551063
{
10561064
$urlparams = array(
@@ -1090,6 +1098,9 @@ public function display($cachable = false, $urlparams = false, $tpl = null)
10901098
{
10911099
// Add your safe url parameters with variable type as value {@see JFilterInput::clean()}.
10921100
$registeredurlparams->$key = $value;
1101+
1102+
// Add the URL-important parameters into the array
1103+
$importantParameters[$key] = $this->input->get($key, null, $value);
10931104
}
10941105

10951106
if (version_compare(JVERSION, '3.0', 'ge'))
@@ -1103,7 +1114,7 @@ public function display($cachable = false, $urlparams = false, $tpl = null)
11031114
}
11041115

11051116
// Create the cache ID after setting the registered URL params, as they are used to generate the ID
1106-
$cacheId = md5(serialize(array(JCache::makeId(), $view->getName(), $this->doTask, $groups)));
1117+
$cacheId = md5(serialize(array(JCache::makeId(), $view->getName(), $this->doTask, $groups, $importantParameters)));
11071118

11081119
// Get the cached view or cache the current view
11091120
$cache->get($view, 'display', $cacheId);
@@ -1347,7 +1358,7 @@ public function apply()
13471358
$customURL = base64_decode($customURL);
13481359
}
13491360

1350-
$url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id . $this->getItemidURLSuffix();
1361+
$url = !empty($customURL) ? $customURL : 'index.php?option=' . $this->component . '&view=' . $this->view . '&task=edit&id=' . $id . $this->getItemidURLSuffix();
13511362
$this->setRedirect($url, JText::_($textkey));
13521363
}
13531364

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
<?php
2+
/**
3+
* @package FrameworkOnFramework
4+
* @subpackage database
5+
* @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
6+
* @license GNU General Public License version 2 or later; see LICENSE.txt
7+
*
8+
* This file is adapted from the Joomla! Platform. It is used to iterate a database cursor returning FOFTable objects
9+
* instead of plain stdClass objects
10+
*/
11+
12+
// Protect from unauthorized access
13+
defined('FOF_INCLUDED') or die;
14+
15+
/**
16+
* Database connector class.
17+
*
18+
* @since 11.1
19+
* @deprecated 13.3 (Platform) & 4.0 (CMS)
20+
*/
21+
abstract class FOFDatabase
22+
{
23+
/**
24+
* Execute the SQL statement.
25+
*
26+
* @return mixed A database cursor resource on success, boolean false on failure.
27+
*
28+
* @since 11.1
29+
* @throws RuntimeException
30+
* @deprecated 13.1 (Platform) & 4.0 (CMS)
31+
*/
32+
public function query()
33+
{
34+
if (class_exists('JLog'))
35+
{
36+
JLog::add('FOFDatabase::query() is deprecated, use FOFDatabaseDriver::execute() instead.', JLog::WARNING, 'deprecated');
37+
}
38+
39+
return $this->execute();
40+
}
41+
42+
/**
43+
* Get a list of available database connectors. The list will only be populated with connectors that both
44+
* the class exists and the static test method returns true. This gives us the ability to have a multitude
45+
* of connector classes that are self-aware as to whether or not they are able to be used on a given system.
46+
*
47+
* @return array An array of available database connectors.
48+
*
49+
* @since 11.1
50+
* @deprecated 13.1 (Platform) & 4.0 (CMS)
51+
*/
52+
public static function getConnectors()
53+
{
54+
if (class_exists('JLog'))
55+
{
56+
JLog::add('FOFDatabase::getConnectors() is deprecated, use FOFDatabaseDriver::getConnectors() instead.', JLog::WARNING, 'deprecated');
57+
}
58+
59+
return FOFDatabaseDriver::getConnectors();
60+
}
61+
62+
/**
63+
* Gets the error message from the database connection.
64+
*
65+
* @param boolean $escaped True to escape the message string for use in JavaScript.
66+
*
67+
* @return string The error message for the most recent query.
68+
*
69+
* @deprecated 13.3 (Platform) & 4.0 (CMS)
70+
* @since 11.1
71+
*/
72+
public function getErrorMsg($escaped = false)
73+
{
74+
if (class_exists('JLog'))
75+
{
76+
JLog::add('FOFDatabase::getErrorMsg() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
77+
}
78+
79+
if ($escaped)
80+
{
81+
return addslashes($this->errorMsg);
82+
}
83+
else
84+
{
85+
return $this->errorMsg;
86+
}
87+
}
88+
89+
/**
90+
* Gets the error number from the database connection.
91+
*
92+
* @return integer The error number for the most recent query.
93+
*
94+
* @since 11.1
95+
* @deprecated 13.3 (Platform) & 4.0 (CMS)
96+
*/
97+
public function getErrorNum()
98+
{
99+
if (class_exists('JLog'))
100+
{
101+
JLog::add('FOFDatabase::getErrorNum() is deprecated, use exception handling instead.', JLog::WARNING, 'deprecated');
102+
}
103+
104+
return $this->errorNum;
105+
}
106+
107+
/**
108+
* Method to return a FOFDatabaseDriver instance based on the given options. There are three global options and then
109+
* the rest are specific to the database driver. The 'driver' option defines which FOFDatabaseDriver class is
110+
* used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to
111+
* be used for the connection. The 'select' option determines whether the connector should automatically select
112+
* the chosen database.
113+
*
114+
* Instances are unique to the given options and new objects are only created when a unique options array is
115+
* passed into the method. This ensures that we don't end up with unnecessary database connection resources.
116+
*
117+
* @param array $options Parameters to be passed to the database driver.
118+
*
119+
* @return FOFDatabaseDriver A database object.
120+
*
121+
* @since 11.1
122+
* @deprecated 13.1 (Platform) & 4.0 (CMS)
123+
*/
124+
public static function getInstance($options = array())
125+
{
126+
if (class_exists('JLog'))
127+
{
128+
JLog::add('FOFDatabase::getInstance() is deprecated, use FOFDatabaseDriver::getInstance() instead.', JLog::WARNING, 'deprecated');
129+
}
130+
131+
return FOFDatabaseDriver::getInstance($options);
132+
}
133+
134+
/**
135+
* Splits a string of multiple queries into an array of individual queries.
136+
*
137+
* @param string $query Input SQL string with which to split into individual queries.
138+
*
139+
* @return array The queries from the input string separated into an array.
140+
*
141+
* @since 11.1
142+
* @deprecated 13.1 (Platform) & 4.0 (CMS)
143+
*/
144+
public static function splitSql($query)
145+
{
146+
if (class_exists('JLog'))
147+
{
148+
JLog::add('FOFDatabase::splitSql() is deprecated, use FOFDatabaseDriver::splitSql() instead.', JLog::WARNING, 'deprecated');
149+
}
150+
151+
return FOFDatabaseDriver::splitSql($query);
152+
}
153+
154+
/**
155+
* Return the most recent error message for the database connector.
156+
*
157+
* @param boolean $showSQL True to display the SQL statement sent to the database as well as the error.
158+
*
159+
* @return string The error message for the most recent query.
160+
*
161+
* @since 11.1
162+
* @deprecated 13.3 (Platform) & 4.0 (CMS)
163+
*/
164+
public function stderr($showSQL = false)
165+
{
166+
if (class_exists('JLog'))
167+
{
168+
JLog::add('FOFDatabase::stderr() is deprecated.', JLog::WARNING, 'deprecated');
169+
}
170+
171+
if ($this->errorNum != 0)
172+
{
173+
return JText::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $this->errorNum, $this->errorMsg)
174+
. ($showSQL ? "<br />SQL = <pre>$this->sql</pre>" : '');
175+
}
176+
else
177+
{
178+
return JText::_('JLIB_DATABASE_FUNCTION_NOERROR');
179+
}
180+
}
181+
182+
/**
183+
* Test to see if the connector is available.
184+
*
185+
* @return boolean True on success, false otherwise.
186+
*
187+
* @since 11.1
188+
* @deprecated 12.3 (Platform) & 4.0 (CMS) - Use FOFDatabaseDriver::isSupported() instead.
189+
*/
190+
public static function test()
191+
{
192+
if (class_exists('JLog'))
193+
{
194+
JLog::add('FOFDatabase::test() is deprecated. Use FOFDatabaseDriver::isSupported() instead.', JLog::WARNING, 'deprecated');
195+
}
196+
197+
return static::isSupported();
198+
}
199+
}

0 commit comments

Comments
 (0)