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

Commit

Permalink
Merge branch 'release/v1.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Rombauts committed Mar 4, 2015
2 parents 5f8864d + cbcbb24 commit 22e7a28
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ CHANGELOG
To get the diff for a specific change, go to https://github.com/nooku/nooku-installer/commit/xxx where xxx is the change hash.
To view the diff between two versions, go to https://github.com/nooku/nooku-installer/compare/v0.1.0...v0.1.1

## 1.0.3 (2015-03-04)

* Fixed - Fix call to undefined function Composer\Autoload\includeFile() error in Joomla 3.4

## 1.0.2 (2014-11-17)

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

## 0.1.0 (2014-08-28)

* Added - Created first version of the Composer plugin, allowing you to install `nooku/nooku-framework` into Joomla applications.
* Added - Created first version of the Composer plugin, allowing you to install `nooku/nooku-framework` into Joomla applications.
22 changes: 18 additions & 4 deletions README.md
Expand Up @@ -28,15 +28,15 @@ Note: the `nooku/nooku-framework` framework requirement will also install this i

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.

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!
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!

#### Publishing

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.

### Nooku Component

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.
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.

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

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

## Contributing

Fork the project, create a feature branch, and send us a pull request.
We appreciate any contribution, whether it is related to bugs, grammar, or simply a suggestion or
improvement. We ask that any contribution follows a few simple guidelines in order to be properly received.

We follow the [GitFlow][gitflow-model] branching model, from development to release. If you are not familiar with it,
there are several guides and tutorials online to learn about it.

There are a few things you must know before submitting a pull request:

- All changes need to be made against the `develop` branch. However, it is very well appreciated and highly suggested to
start a new feature branch from `develop` and make your changes in this new branch. This way we can just checkout your
feature branch for testing before merging it into `develop`.
- We will not consider pull requests made directly to the `master` branch.

## Authors

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

## License

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.
The `nooku-installer` plugin t is free and open-source software licensed under the [GPLv3 license](gplv3-license).

[gitflow-model]: http://nvie.com/posts/a-successful-git-branching-model/
[gplv3-license]: https://github.com/nooku/nooku-framework/blob/master/LICENSE.txt
12 changes: 12 additions & 0 deletions src/Nooku/Composer/Installer/JoomlaExtension.php
Expand Up @@ -282,4 +282,16 @@ public function __destruct()
$session->close();
}
}
}

/**
* Workaround for Joomla 3.4+
*
* Fix Fatal error: Call to undefined function Composer\Autoload\includeFile() in /libraries/ClassLoader.php on line 43
*/
namespace Composer\Autoload;

function includeFile($file)
{
include $file;
}
27 changes: 26 additions & 1 deletion src/Nooku/Composer/Installer/NookuComponent.php
Expand Up @@ -68,6 +68,7 @@ protected function _installAutoloader(PackageInterface $package)

if(!file_exists($path))
{
$classname = $this->_getObjectManagerClassName();
list($vendor, ) = explode('/', $package->getPrettyName());
$component = (string) $manifest->name;

Expand All @@ -78,7 +79,7 @@ protected function _installAutoloader(PackageInterface $package)
* You can override this autoloader by supplying an autoload.php file in the root of the relevant component.
**/
KObjectManager::getInstance()
$classname::getInstance()
->getObject('lib:object.bootstrapper')
->registerComponent(
'$component',
Expand Down Expand Up @@ -145,4 +146,28 @@ protected function _getAutoloaderPath(PackageInterface $package)

return rtrim($path, '/').'/autoload.php';
}

/**
* Determine the correct object manager class name to be used in the
* autoloader. When installing into Nooku Platform, use Nooku\Library\ObjectManager,
* otherwise assume we are installing alongside Framework and use KObjectManager.
*
* @return string
*/
protected function _getObjectManagerClassName()
{
$files = array('./library/nooku.php', './component');
$platform = true;

foreach ($files as $file)
{
if (!file_exists($file))
{
$platform = false;
break;
}
}

return $platform ? 'Nooku\Library\ObjectManager' : 'KObjectManager';
}
}

0 comments on commit 22e7a28

Please sign in to comment.