Code Monkey home page Code Monkey logo

cundd_composer's Introduction

Cundd Composer

Composer support for TYPO3 CMS.

Installation

Install from TER or clone the source with git clone https://github.com/cundd/cundd_composer.git cundd_composer and install Cundd Composer as usual through the Extension Manager.

Usage

Make sure the extensions that provide a composer.json for Cundd Composer are already installed before running Cundd Composer's install or update commands. Only properly installed TYPO3 extensions are checked for a composer.json file.

via backend module

Cundd Composer icon Icon of the Cundd Composer module

Let's assume we want to install the Composer dependencies for an TYPO3 extension called MyExt. In the root directory of the extension a valid composer.json file exists which contains the extra section for cundd/composer:

{
    "extra": {
        "cundd/composer": {
            "install": true
        }
    }
}
  1. Install MyExt through the Extension Manager
  2. Go to the Composer module in the Tools section
  3. Check the preview of the merged composer.json
  4. Click on Install or Update to tell Composer to install requirements

via command line

TYPO3 based CLI commands are available to manage dependencies.

composer:install

Installs the project dependencies from the composer.lock file (in EXT:cundd_composer/Resources/Private/Temp/) if present, or falls back on the composer.json.

typo3 cundd-composer:install

composer:update

Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file (in EXT:cundd_composer/Resources/Private/Temp/).

typo3 cundd-composer:update

composer:installassets

Install available assets.

typo3 cundd-composer:install-assets

composer:list

List information about the required packages.

typo3 cundd-composer:list

composer:exec

Execute an arbitrary composer command.

typo3 cundd-composer:exec -- info

cundd-composer:write-composer-json

Write the merged composer.json.

typo3 cundd-composer:write-composer-json

For extension developers

Place a valid composer.json (The composer.json Schema) file in the root directory of your extension and add the required extra section. If you want to use the Composer packages in a fronted extension you can simply use the package classes. In case of a backend module you have to register the Cundd Composer autoloader through \Cundd\CunddComposer\Autoloader::register().

Assets

The Asset Installer loops through all the installed composer packages and checks if they contain one of the directories defined in the extension manager (configuration name: assetPaths, defaults: Resources/Public/, build, lib, js , font, less and sass). If one of the directories exist, a symlink to the directory will be created inside of Cundd Composer's Resources/Public/Assets/ folder.

Before the Asset Installer can be used, it has to be enabled in the extension manager. Therefore allowInstallAssets has to be checked. If automaticallyInstallAssets (and allowInstallAssets) is enabled the Assets will be installed automatically after Cundd Composer's install or update function is invoked.

Example

If the package foo/bar contains the directory Resources/Public/ Cundd Composer will create a symlink at EXT:cundd_composer/Resources/Public/Assets/foo_bar/ which will point to EXT:cundd_composer/vendor/foo/bar/Resources/Public/.

Aim

The aim of the Asset Installer is to provide a schema to reference asset files and to publish those files in a public folder, which allows the vendor directory to be inaccessible for browsers.

Maintenance

The Composer binary is located in ./typo3conf/ext/cundd_composer/Resources/Private/PHP/composer.phar. The generated composer.json, cache and configuration files are saved in ./typo3conf/ext/cundd_composer/Resources/Private/Temp/.

Update the Composer binary to the latest version

./typo3conf/ext/cundd_composer/Resources/Private/PHP/composer.phar selfupdate

Retrieve Composer configuration

COMPOSER=./typo3conf/ext/cundd_composer/Resources/Private/Temp/composer.json \
./typo3conf/ext/cundd_composer/Resources/Private/PHP/composer.phar config -l

Set OAuth tokens for API rate limit

COMPOSER_HOME=./typo3conf/ext/cundd_composer/Resources/Private/Temp/ \
./typo3conf/ext/cundd_composer/Resources/Private/PHP/composer.phar config -g \
github-oauth.github.com theOauthToken

Clear the internal package cache

COMPOSER_HOME=./typo3conf/ext/cundd_composer/Resources/Private/Temp \
./typo3conf/ext/cundd_composer/Resources/Private/PHP/composer.phar clearcache

Breaking changes

Breaking changes in Cundd Composer 3.0

The class name without namespaces has been removed Tx_CunddComposer_Autoloader.

Upgrade to TYPO3 6.2

TYPO3 6.2 will parse the extensions composer.json files and retrieve different information from it. TYPO3's new Package Manager also allows the definition of dependencies. Unfortunately these dependencies are limited to real TYPO3 extension. If you want to install an extension, which requires a non-TYPO3 package in composer.json, the Package Manager tries to resolve this dependency in vain and the installation fails.

To work around this issue cundd_composer will look for the file cundd_composer.json instead of composer.json. For legacy reasons cundd_composer will still use composer.json TYPO3 versions below 6.2.

Please check the installed extensions before upgrading to TYPO3 6.2.

Sponsored by

cundd_composer's People

Contributors

cundd avatar jacobsenj avatar nsaleh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cundd_composer's Issues

Exception if require-dev is empty

A compass exception is thrown when the button "Merge and install development mode" is pressed and the require-dev configuration is empty:

...
"require-dev":[]
...

The reason is that an empty require-dev configuration will be transformed to a JSON array instead of a JSON object.

Extension key "CunddComposer" is NOT loaded

Trying to install CunddComposer on a fresh instance of TYPO3 6.1.7 introductory package.

After the extension is placed in the typo3conf/ext folder I do:

  1. chmod -R 777
  2. chown -R www-data:www-data

After installing through the Extension Manager, I get the screenshot and then the admin is not usable anymore - it always displays the error... since I am a newbie with TYPO3, what I do is remove all the files, clear the database and re-install the introductory package.

Any ideas how to debug this?

Apache2 error log is empty.
screen shot 2013-12-16 at 14 05 40

Might not be working on 4.5.22 with extbase 1.3.4

Hey there,

thank you for the extension I think it s very usefull. I am experiencing problems trying to switch from shipping dependencies with my extension to installing them by yours.

On 4.7 the BE-Module is loading but on 4.5.22(extbase 1.3.4) I get the following error.

Fatal error: Call to a member function build() on a non-object in typo3conf/ext/cundd_composer/Classes/Domain/Repository/PackageRepository.php on line 87

Have you tested on 4.5 allready or might it be a missconfiguration/missing dep on my installation?

kind regards,

Nabil

View paths are wrong

In ext_typoscript_setup.txt the paths to the views are wrong:

module.tx_cunddcomposer {
    view {
        templateRootPath = EXT:cundd_composer/Resources/Private/Backend/Templates/
        partialRootPath = EXT:cundd_composer/Resources/Private/Backend/Partials/
        layoutRootPath = EXT:cundd_composer/Resources/Private/Backend/Layouts/
    }
}

should be

module.tx_cunddcomposer {
    view {
        templateRootPath = EXT:cundd_composer/Resources/Private/Templates/
        partialRootPath = EXT:cundd_composer/Resources/Private/Partials/
        layoutRootPath = EXT:cundd_composer/Resources/Private/Layouts/
     }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.