Giter VIP home page Giter VIP logo

Comments (5)

schmitzal avatar schmitzal commented on July 28, 2024

Hi,

full support for legacy installations has been dropped a couple of versions ago.

You need to take care of loading the Tinify library yourself. Download the source, add it to your site package or any local extension and load the classes.

Best,
Alex

from tinyimg.

schmitzal avatar schmitzal commented on July 28, 2024

Closed due missing response.

from tinyimg.

nemstaa avatar nemstaa commented on July 28, 2024

Hi Alex

I wanted to implement the Tinify-Class with their functions without a composer with no success.
I placed the files in "Resources/Private/Libraries/tinify" and tried it with the Services.yaml and ext_emconf.php (autoload + classmap):

'autoload' => [ 'psr-4' => [ 'Vendor\\Namespace\\'=> 'Classes', ], 'classmap' => ['Resources/Private/Libraries/tinify/lib/Tinify.php'] ],

Could you provide a solution or give me a hint for loading the Tinify-Lib in a seperate extension?

I would appreciate it.

Thank you in advance
Robert

from tinyimg.

schmitzal avatar schmitzal commented on July 28, 2024

Hi Robert,

it's difficult to provide any help with so little information.
Which TYPO3 version are you running?
I'm not sure how TYPO3 handles class mapping if those have namespaces.
I think the easiest way would be to add a new extension under the tinify namespace to you system.
But after all, why don't you switch to a composer based setup? Makes life so much easier 😄

Aside from that, I think help requests like yours should be in the slack channel, as it's not an issue with the code:
https://typo3.slack.com/archives/C56P6PZ2S

Best
Alex

from tinyimg.

nemstaa avatar nemstaa commented on July 28, 2024

Hi Alex

Thank you for your answer.

I resolved the issue for me like this in the ext_localconf.php:

`<?php
defined('TYPO3_MODE') or die();

$boot = function () {
if (TYPO3_MODE == 'BE') {

    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify/Client.php';
    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify/Exception.php';
    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify/ResultMeta.php';
    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify/Result.php';
    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify/Source.php';
    $composerAutoloadFiles[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('ext_key') . 'Resources/Private/PHP/tinify/lib/Tinify.php';
    foreach($composerAutoloadFiles as $file) {
        require_once($file);
    }

}

};
$boot();
unset($boot);`

Like you've said. The main thing was the namespace handle. TYPO3 created extra namespaces, while a function is executed in Tinify.php.

I hope this helps those, who have the same case.

Thank you again.

Kind regards
Robert

from tinyimg.

Related Issues (20)

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.