Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

Commit 22e7a28

Browse files
author
Steven Rombauts
committed
Merge branch 'release/v1.0.3'
2 parents 5f8864d + cbcbb24 commit 22e7a28

File tree

4 files changed

+61
-6
lines changed

4 files changed

+61
-6
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ CHANGELOG
44
To get the diff for a specific change, go to https://github.com/nooku/nooku-installer/commit/xxx where xxx is the change hash.
55
To view the diff between two versions, go to https://github.com/nooku/nooku-installer/compare/v0.1.0...v0.1.1
66

7+
## 1.0.3 (2015-03-04)
8+
9+
* Fixed - Fix call to undefined function Composer\Autoload\includeFile() error in Joomla 3.4
10+
711
## 1.0.2 (2014-11-17)
812

913
* Fixed - Load Nooku Component name from koowa-component.xml manifest instead of parsing it out of the package name.
@@ -26,4 +30,4 @@ To view the diff between two versions, go to https://github.com/nooku/nooku-inst
2630

2731
## 0.1.0 (2014-08-28)
2832

29-
* Added - Created first version of the Composer plugin, allowing you to install `nooku/nooku-framework` into Joomla applications.
33+
* Added - Created first version of the Composer plugin, allowing you to install `nooku/nooku-framework` into Joomla applications.

README.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ Note: the `nooku/nooku-framework` framework requirement will also install this i
2828

2929
To have Composer succesfully install your extension into Joomla, you need to make sure your repository layout resembles an installable Joomla package. This means that if you were to create an archive of your repository contents, that archive can be installed using the Joomla Extension Manager.
3030

31-
This means that you need to add a [valid XML manifest](http://docs.joomla.org/Manifest_files) to the root directory and make sure it points to the correct paths. For a working example, you can always refer to our [tada](https://github.com/nooku/nooku-pkg_tada/) example component!
31+
This means that you need to add a [valid XML manifest](http://docs.joomla.org/Manifest_files) to the root directory and make sure it points to the correct paths. For a working example, you can always refer to our [todo](https://github.com/nooku/joomla-todo) example component!
3232

3333
#### Publishing
3434

3535
You can now publish your component on [Packagist](http://packagist.org) or [add your own repository](https://getcomposer.org/doc/05-repositories.md#vcs) to your Joomla's composer.json file. Your component can then be installed using the `composer install` command.
3636

3737
### Nooku Component
3838

39-
Use the `nooku-component` type to install your reusable Nooku components into your Joomla setup. The Composer installer will take your code and place it inside the `/libraries/vendor` directory. For Joomla versions prior to 3.4, it will install them into the `/vendor` folder.
39+
Use the `nooku-component` type to install your reusable Nooku components into your Joomla setup or [Nooku Platform](http://www.nooku.org/platform) application. The Composer installer will take your code and place it inside the `/vendor` directory. For Joomla versions 3.4 and up, it will install into the `/libraries/vendor` folder.
4040

4141
Your package's `composer.json` file should contain at least the following directives:
4242

@@ -90,12 +90,26 @@ Now execute `composer install` to install the framework.
9090

9191
## Contributing
9292

93-
Fork the project, create a feature branch, and send us a pull request.
93+
We appreciate any contribution, whether it is related to bugs, grammar, or simply a suggestion or
94+
improvement. We ask that any contribution follows a few simple guidelines in order to be properly received.
95+
96+
We follow the [GitFlow][gitflow-model] branching model, from development to release. If you are not familiar with it,
97+
there are several guides and tutorials online to learn about it.
98+
99+
There are a few things you must know before submitting a pull request:
100+
101+
- All changes need to be made against the `develop` branch. However, it is very well appreciated and highly suggested to
102+
start a new feature branch from `develop` and make your changes in this new branch. This way we can just checkout your
103+
feature branch for testing before merging it into `develop`.
104+
- We will not consider pull requests made directly to the `master` branch.
94105

95106
## Authors
96107

97108
See the list of [contributors](https://github.com/nooku/nooku-installer/contributors).
98109

99110
## License
100111

101-
The `nooku/installer` plugin is licensed under the GPL v3 license - see the [LICENSE](https://github.com/nooku/nooku-installer/blob/master/LICENSE) file for details.
112+
The `nooku-installer` plugin t is free and open-source software licensed under the [GPLv3 license](gplv3-license).
113+
114+
[gitflow-model]: http://nvie.com/posts/a-successful-git-branching-model/
115+
[gplv3-license]: https://github.com/nooku/nooku-framework/blob/master/LICENSE.txt

src/Nooku/Composer/Installer/JoomlaExtension.php

+12
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,16 @@ public function __destruct()
282282
$session->close();
283283
}
284284
}
285+
}
286+
287+
/**
288+
* Workaround for Joomla 3.4+
289+
*
290+
* Fix Fatal error: Call to undefined function Composer\Autoload\includeFile() in /libraries/ClassLoader.php on line 43
291+
*/
292+
namespace Composer\Autoload;
293+
294+
function includeFile($file)
295+
{
296+
include $file;
285297
}

src/Nooku/Composer/Installer/NookuComponent.php

+26-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ protected function _installAutoloader(PackageInterface $package)
6868

6969
if(!file_exists($path))
7070
{
71+
$classname = $this->_getObjectManagerClassName();
7172
list($vendor, ) = explode('/', $package->getPrettyName());
7273
$component = (string) $manifest->name;
7374

@@ -78,7 +79,7 @@ protected function _installAutoloader(PackageInterface $package)
7879
* You can override this autoloader by supplying an autoload.php file in the root of the relevant component.
7980
**/
8081
81-
KObjectManager::getInstance()
82+
$classname::getInstance()
8283
->getObject('lib:object.bootstrapper')
8384
->registerComponent(
8485
'$component',
@@ -145,4 +146,28 @@ protected function _getAutoloaderPath(PackageInterface $package)
145146

146147
return rtrim($path, '/').'/autoload.php';
147148
}
149+
150+
/**
151+
* Determine the correct object manager class name to be used in the
152+
* autoloader. When installing into Nooku Platform, use Nooku\Library\ObjectManager,
153+
* otherwise assume we are installing alongside Framework and use KObjectManager.
154+
*
155+
* @return string
156+
*/
157+
protected function _getObjectManagerClassName()
158+
{
159+
$files = array('./library/nooku.php', './component');
160+
$platform = true;
161+
162+
foreach ($files as $file)
163+
{
164+
if (!file_exists($file))
165+
{
166+
$platform = false;
167+
break;
168+
}
169+
}
170+
171+
return $platform ? 'Nooku\Library\ObjectManager' : 'KObjectManager';
172+
}
148173
}

0 commit comments

Comments
 (0)