Skip to content

Commit

Permalink
Extend CMS controller base from framework class
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Nov 7, 2014
1 parent 51ed8a5 commit c7b8856
Show file tree
Hide file tree
Showing 10 changed files with 729 additions and 28 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"joomla/registry": "~1.2",
"joomla/string": "~1.2",
"joomla/uri": "~1.1",
"joomla/controller": "~1.1",
"ircmaxell/password-compat": "1.*",
"leafo/lessphp": "0.3.9",
"phpmailer/phpmailer": "5.2.8",
Expand Down
58 changes: 52 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 47 additions & 10 deletions libraries/joomla/controller/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,43 @@

defined('JPATH_PLATFORM') or die;

use Joomla\Controller\AbstractController;
use Joomla\Application\AbstractApplication;

/**
* Joomla Platform Base Controller Class
*
* @since 12.1
*/
abstract class JControllerBase implements JController
abstract class JControllerBase extends AbstractController implements JController
{
/**
* The application object.
*
* @var JApplicationBase
* @since 12.1
* @var AbstractApplication
* @since 12.1
* @deprecated 3.4 This class variable will be private from 4.0
*/
protected $app;

/**
* The input object.
*
* @var JInput
* @since 12.1
* @var JInput
* @since 12.1
* @deprecated 3.4 This class variable will be private from 4.0
*/
protected $input;

/**
* Instantiate the controller.
*
* @param JInput $input The input object.
* @param JApplicationBase $app The application object.
* @param JInput $input The input object.
* @param AbstractApplication $app The application object.
*
* @since 12.1
*/
public function __construct(JInput $input = null, JApplicationBase $app = null)
public function __construct(JInput $input = null, AbstractApplication $app = null)
{
// Setup dependencies.
$this->app = isset($app) ? $app : $this->loadApplication();
Expand All @@ -50,7 +55,7 @@ public function __construct(JInput $input = null, JApplicationBase $app = null)
/**
* Get the application object.
*
* @return JApplicationBase The application object.
* @return AbstractApplication The application object.
*
* @since 12.1
*/
Expand Down Expand Up @@ -112,7 +117,7 @@ public function unserialize($input)
/**
* Load the application object.
*
* @return JApplicationBase The application object.
* @return JApplicationCms The application object.
*
* @since 12.1
*/
Expand All @@ -132,4 +137,36 @@ protected function loadInput()
{
return $this->app->input;
}

/**
* Set the application object.
*
* @param AbstractApplication $app The application object.
*
* @return JControllerBase Returns itself to support chaining.
*
* @since 3.4
*/
public function setApplication(AbstractApplication $app)
{
$this->app = $app;

return $this;
}

/**
* Set the input object.
*
* @param Input\Input $input The input object.
*
* @return JControllerBase Returns itself to support chaining.
*
* @since 3.4
*/
public function setInput(Joomla\Input\Input $input)
{
$this->input = $input;

return $this;
}
}
2 changes: 1 addition & 1 deletion libraries/vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit17a170335afa68902bc725e1c9c6be64::getLoader();
return ComposerAutoloaderInitf141ce820358adc2cb71c82d7616af51::getLoader();
2 changes: 2 additions & 0 deletions libraries/vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
'Joomla\\Event\\' => array($vendorDir . '/joomla/event/src'),
'Joomla\\DI\\Tests\\' => array($vendorDir . '/joomla/di/Tests'),
'Joomla\\DI\\' => array($vendorDir . '/joomla/di/src'),
'Joomla\\Controller\\Tests\\' => array($vendorDir . '/joomla/controller/Tests'),
'Joomla\\Controller\\' => array($vendorDir . '/joomla/controller/src'),
'Joomla\\Application\\Tests\\' => array($vendorDir . '/joomla/application/Tests'),
'Joomla\\Application\\' => array($vendorDir . '/joomla/application/src'),
);
10 changes: 5 additions & 5 deletions libraries/vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit17a170335afa68902bc725e1c9c6be64
class ComposerAutoloaderInitf141ce820358adc2cb71c82d7616af51
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit17a170335afa68902bc725e1c9c6be64', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitf141ce820358adc2cb71c82d7616af51', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit17a170335afa68902bc725e1c9c6be64', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitf141ce820358adc2cb71c82d7616af51', 'loadClassLoader'));

$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -42,14 +42,14 @@ public static function getLoader()

$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequire17a170335afa68902bc725e1c9c6be64($file);
composerRequiref141ce820358adc2cb71c82d7616af51($file);
}

return $loader;
}
}

function composerRequire17a170335afa68902bc725e1c9c6be64($file)
function composerRequiref141ce820358adc2cb71c82d7616af51($file)
{
require $file;
}
60 changes: 54 additions & 6 deletions libraries/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,24 +690,24 @@
},
{
"name": "symfony/yaml",
"version": "v2.5.5",
"version_normalized": "2.5.5.0",
"version": "v2.5.6",
"version_normalized": "2.5.6.0",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
"reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96"
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/b1dbc53593b98c2d694ebf383660ac9134d30b96",
"reference": "b1dbc53593b98c2d694ebf383660ac9134d30b96",
"url": "https://api.github.com/repos/symfony/Yaml/zipball/2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
"reference": "2d9f527449cabfa8543dd7fa3a466d6ae83d6726",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2014-09-22 09:14:18",
"time": "2014-10-01 05:50:18",
"type": "library",
"extra": {
"branch-alias": {
Expand Down Expand Up @@ -736,5 +736,53 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com"
},
{
"name": "joomla/controller",
"version": "1.1.1",
"version_normalized": "1.1.1.0",
"source": {
"type": "git",
"url": "https://github.com/joomla-framework/controller.git",
"reference": "5177cf40e146c74d71f0c04ef0568d549afd564c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/joomla-framework/controller/zipball/5177cf40e146c74d71f0c04ef0568d549afd564c",
"reference": "5177cf40e146c74d71f0c04ef0568d549afd564c",
"shasum": ""
},
"require": {
"php": ">=5.3.10"
},
"require-dev": {
"joomla/application": "~1.0",
"joomla/input": "~1.0",
"joomla/test": "~1.0"
},
"suggest": {
"joomla/application": "~1.0",
"joomla/input": "~1.0"
},
"time": "2014-02-09 01:25:57",
"type": "joomla-package",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Joomla\\Controller\\": "src/",
"Joomla\\Controller\\Tests\\": "Tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0+"
],
"description": "Joomla Controller Package",
"homepage": "https://github.com/joomla-framework/controller",
"keywords": [
"controller",
"framework",
"joomla"
]
}
]

0 comments on commit c7b8856

Please sign in to comment.