Git Product home page Git Product logo

ext-coreapi's Introduction

Stories in Ready Build Status Scrutinizer Code Quality Code Coverage

TYPO3 Extension 'coreapi'

The EXT:coreapi should provide a simple to use API for common core features. Goal is to be able to do the most common tasks by CLI instead of doing it in the backend/browser.

Beside of CLI commands, EXT:coreapi provides service classes, which can be used in your own implementation/extension.

Checkout the project website at forge.typo3.org: http://forge.typo3.org/projects/show/extension-coreapi

Tasks

  • DatabaseApi
    • databaseCompare
  • CacheApi
    • clearAllCaches
    • clearPageCache
    • clearConfigurationCache
  • ExtensionApi
    • info
    • listInstalled
    • updateList from TER
    • fetch an extension from TER
    • import an extension
    • install / uninstall extension
    • create upload folders
    • configure extension
  • SiteApi
    • info
    • createSysNews

planned/comming soon

  • Backend
    • manage users (list, create, update, delete)
    • lock/unlock the TYPO3 backend
  • PageTree
    • print/get
  • DataApi
    • generic list/create/update/delete records (and not doing the plain SQL, but using the DataHandler (aka tcemain)!)
    • getRecordsByPid
    • create a database dump (exclude "temporary" tables like caches, sys_log, ...)
  • ReportsApi
    • run/check the reports from the reports module
  • ConfigurationApi
    • list, get and set TYPO3 configurations

CLI call:

Make sure you have a backend user called _cli_lowlevel

If you want to use the cache clearing commands, you need to add the following snippet to the TSconfig field of this backend user:

options.clearCache.all=1
options.clearCache.pages=1

TYPO3 6.2 and below

Support for TYPO3 CMS below 6.2 was removed with version 0.2.0 of this extension. In case you need to use ext:coreapi in combination with lower version of TYPO3 CMS use version 0.1.0-beta.

TYPO3 6.2+

If you are using TYPO3 6.2+, you can use the awesome CommandController of Extbase.

This will show you all available calls ./typo3/cli_dispatch.phpsh extbase help

Usage in Composer

{
    "name": "typo3cms/test-website",
    "description": "TYPO3 CMS: test.com",
    "keywords": ["typo3", "cms"],
    "require": {
        "php": ">=5.3.3",
        "typo3core/cms": "*",
        "etobi/coreapi": "dev-master",
    },
    "extra": {
        "installer-paths": {
            "typo3conf/ext/{$name}": [
                "type:typo3-cms-extension"
            ]
        }
    },
    "minimum-stability": "dev",
    "require-dev": {},
    "scripts": {}
}

Running the unit tests

The Unit Tests rely on vfsStream. For some reasons ext:coreapi don't add this dependencies by itself but uses the one which is alread defined for Core Unit Tests. To install vfsStream copy the composer.json from the TYPO3 CMS package into you webroot folder and execute the command composer install. This will install all dependencies into Packages/Libraries/.

Then run the Unit Tests.

cp typo3_src/composer.json .
composer install
./bin/phpunit --colors -c typo3/sysext/core/Build/UnitTests.xml typo3conf/ext/coreapi/Tests/Unit/

ext-coreapi's People

Contributors

7elix avatar bmoex avatar christophlehmann avatar danielsiepmann avatar etobi avatar georgringer avatar greinerdavid avatar jdreesen avatar jmverges avatar konafets avatar madsbrunn avatar oliverklee avatar smichaelsen avatar thomashohn avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ext-coreapi's Issues

[Feature] Update language from Repository

Because we use corapi for deployment over TYPO3.Surf, a update for the languagefiles from repository would be a nice feature!
At this time we had to do the update manually.

Thx!

deprecate Dispatcher.php in favour of CommandControllers

currently some code is duplicated in the Dispatcher.php and the extbase-driven CommandControllers.
I really like to get rid of the Dispatcher.php thing as soon as 4.5 is not supported anymore and encourage people to use the CommandControllers (available from 4.7+)

So if using the Dispatcher in >=4.7 should output a warning and log in the deprecation log.

Missing classes in autoload file

The ext_autoload.php file seems to be missing some classes:

  • 'tx_coreapi_cli_dispatcher' => $extensionClassesPath . 'Cli/Dispatcher.php',
  • 'tx_coreapi_command_extensionapicommandcontroller' => $extensionClassesPath . 'Command/ExtensionApiCommandController.php',
  • 'tx_coreapi_service_siteapiservice' => $extensionClassesPath . 'Service/SiteApiService.php',

Release to TER

Make this extension available for everyone via TER :)

,,,,,
q°_°p
`| |´

FileApi fixPermissions

FileApi fixPermissions

cli_dispatch.php extbase coreapi FileApi:fixPermissions www-data www-data
cli_dispatch.php extbase coreapi FileApi:fixPermissions www-data www-data {fileadmin:'ug+rw',typo3_src:'g+rx'
Frage: welche rechte werden wo benötigt, welche api ist angenehm

Composer.json creates error

In 6.2 the composer.json crashes the backend tool on dependency check.
#1382276561: The package "coreapi" depends on "lw/typo3cms-installers" which is not present in the system.

This is caused due to the unknown lw/typo3cms-installers. Why don't you use composer core installers?

You can than manually locate it where you want.

"require": {
"composer/installers": "~1.0"
},

with
"type": "typo3-cms-extension",

See https://github.com/composer/installers

If this is used, the 6.2 environment will be correctly handle the package.

Print TypoScript setup for a certain page

Something like the TypoScript ObjectBrowser

Parameters:

  • setup/constants
  • (optional) specific page id
  • (optional) TypoScript path (to filter sub object trees) "plugin.tx_foobar"

cache:clearconfigurationcache does not work with TYPO3 <= 4.7

t3lib_tcemain->clear_cacheCmd('temp_cached') will not work with TYPO3 <= 4.7, because you need to be admin to do that:

case 'temp_CACHED': if ($this->admin && $TYPO3_CONF_VARS['EXT']['extCache']) { $this->removeCacheFiles(); }

It seems this restriction was removed in 6.0

Documentation for database:databaseCompare

The arguments for database:databaseCompare only documented in the code :)

const ACTION_UPDATE_CLEAR_TABLE = 1;
const ACTION_UPDATE_ADD = 2;
const ACTION_UPDATE_CHANGE = 3;
const ACTION_UPDATE_CREATE_TABLE = 4;
const ACTION_REMOVE_CHANGE = 5;
const ACTION_REMOVE_DROP = 6;
const ACTION_REMOVE_CHANGE_TABLE = 7;
const ACTION_REMOVE_DROP_TABLE = 8;

Would be fine, if the arguments documented in the inline-help or/and in documentation.

Thanks for your great work!

unify command signature for dispatcher/command controller

Suggested by madsbrunn in #18

While we are at it I suggest normalizing the signature for the coreapi < 4.7 dispatcher and the extbase command controllers.

Right now we have:

./cli_dispatch_phpsh coreapi site:info
and
./cli_dispatch_phpsh extbase siteapi:info

??
Why not use

./cli_dispatch_phpsh coreapi site:info
./cli_dispatch_phpsh extbase site:info

or

./cli_dispatch_phpsh coreapi siteapi:info
./cli_dispatch_phpsh extbase siteapi:info

ReportsApi

run/check the reports from the reports module

vfsstream

Hi @Konafets, composer dependency to vfs breaks install via EM. Seems to be WIP. Cheers

extension:import doesn't work

PHP Fatal error: Call to a member function decodeExchangeData() on a non-object in .../typo345/htdocs/typo3conf/ext/coreapi/Classes/Service/ExtensionApiService.php on line 509

$fetchData = $this->terConnection->decodeExchangeData($fileContent);

The initialization is missing...

Print available commands?

Is there any way of print all available commands from the command line? Or do you need to have TYPO3 4.7+ for that?

code cleanup

  • Class/Method documentation
  • Update the copyrights to 2013 and check GPL header
  • CGL

refactor dispatcher

Separate the dispatcher class from the instantiation and start() call so the class can be unit-tested

return valid exit codes

coreapi should return proper exit codes if some gone wrong (e.g. user has no rights to clear the caches)

suggested by Martin Ficzel during the T3DD13.

TYPO3 4.5 - Class 'Tx_Coreapi_Cli_Dispatcher' not found

./typo3/cli_dispatch.phpsh coreapi
PHP Fatal error: Class 'Tx_Coreapi_Cli_Dispatcher' not found in /Sites/typo345/htdocs/typo3_src-4.5.27/t3lib/class.t3lib_div.php on line 5376

The ext_autoload.php should be regenerated or the dispatcher class should be added manually like this:

'tx_coreapi_cli_dispatcher' => $extensionClassesPath . 'Cli/Dispatcher.php',

Why should this file be automatically generated? Can we change this behaviour to care for it manually?

Print page tree on CLI

Print the page tree and partial trees (on CLI). What would the syntax look like for this command?

Get Extension API working with TYPO3 CMS >= 6.2

Following functions do not work with TYPO3 CMS >= 6.2

  • #63 Make extensionapi:updatelist working with TYPO3 CMS >= 6.2
  • #64 Make extensionapi:install working with TYPO3 CMS >= 6.2
  • #65 Make extensionapi:uninstall working with TYPO3 CMS >= 6.2
  • #66 Make extensionapi:configure working with TYPO3 CMS >= 6.2
  • #67 Make extensionapi:fetch working with TYPO3 CMS >= 6.2

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.