Giter VIP home page Giter VIP logo

Comments (12)

cundd avatar cundd commented on June 23, 2024

I'm sorry. I have overlooked that according to the ext_emconf file 4.5 should be supported. I really didn't test that. At the moment I doesn't have an 4.5 testing instance running, but the typo3-4.5-support branch should fix that error.
If you want to try, checkout the new branch

cd typo3conf/ext/
git clone git://github.com/cundd/CunddComposer.git cundd_composer
cd cundd_composer
git checkout typo3-4.5-support

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

thank you, for the quick response. I checked out the 4.5 branch and now I get a different error:

Class Tx_Extbase_Property_PropertyMapper does not exist

Here's the stack:

Uncaught TYPO3 Exception
Class Tx_Extbase_Property_PropertyMapper does not exist 

ReflectionException thrown in file
typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php in line 100.

14 ReflectionParameter::getClass()

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php:
00098:      $reflectionParameter = $reflectionMethod->getParameters();
00099:      if (isset($reflectionParameter[0])) {
00100:       if (!$reflectionParameter[0]->getClass()) {
00101:        throw new Exception('Method "' . $reflectionMethod->getName(). '" of class "' . $reflectedClass->getName() . '" is marked as setter for Dependency Injection, but does not have a type annotation');
00102:       }

13 Tx_Extbase_Object_Container_ClassInfoFactory::getInjectMethods(ReflectionClass)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php:
00046:   }
00047:   $constructorArguments = $this->getConstructorArguments($reflectedClass);
00048:   $injectMethods = $this->getInjectMethods($reflectedClass);
00049:   return new Tx_Extbase_Object_Container_ClassInfo($className, $constructorArguments, $injectMethods);
00050:  }

12 Tx_Extbase_Object_Container_ClassInfoFactory::buildClassInfoFromClassName("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00288:    // in case something went wrong with unserialization etc..
00289:   if (!$this->cache->has($className) || !is_object($this->cache->get($className))) {
00290:    $this->cache->set($className, $this->classInfoFactory->buildClassInfoFromClassName($className));
00291:   }
00292:   return $this->cache->get($className);

11 Tx_Extbase_Object_Container_Container::getClassInfo("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00125:   }
00126: 
00127:   $classInfo = $this->getClassInfo($className);
00128: 
00129:   $instance = $this->instanciateObject($className, $classInfo, $givenConstructorArguments);

10 Tx_Extbase_Object_Container_Container::getInstanceInternal("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00180:   foreach ($classInfo->getInjectMethods() as $injectMethodName => $classNameToInject) {
00181: 
00182:    $instanceToInject = $this->getInstanceInternal($classNameToInject);
00183:    if ($this->isSingleton($instance) && !($instanceToInject instanceof t3lib_Singleton)) {
00184:     $this->log('The singleton "' . $classInfo->getClassName() . '" needs a prototype in "' . $injectMethodName . '". This is often a bad code smell; often you rather want to inject a singleton.', 1);

9 Tx_Extbase_Object_Container_Container::injectDependencies(Tx_CunddComposer_Controller_PackageController, Tx_Extbase_Object_Container_ClassInfo)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00128: 
00129:   $instance = $this->instanciateObject($className, $classInfo, $givenConstructorArguments);
00130:   $this->injectDependencies($instance, $classInfo);
00131: 
00132:   if (method_exists($instance, 'initializeObject') && is_callable(array($instance, 'initializeObject'))) {

8 Tx_Extbase_Object_Container_Container::getInstanceInternal("Tx_CunddComposer_Controller_PackageController", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00093:  public function getInstance($className, $givenConstructorArguments = array()) {
00094:   $this->prototypeObjectsWhichAreCurrentlyInstanciated = array();
00095:   return $this->getInstanceInternal($className, $givenConstructorArguments);
00096:  }
00097: 

7 Tx_Extbase_Object_Container_Container::getInstance("Tx_CunddComposer_Controller_PackageController", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/ObjectManager.php:
00062:   $arguments = func_get_args();
00063:   array_shift($arguments);
00064:   return $this->objectContainer->getInstance($objectName, $arguments);
00065:  }
00066: 

6 Tx_Extbase_Object_ObjectManager::get("Tx_CunddComposer_Controller_PackageController")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Dispatcher.php:
00097:  protected function resolveController(Tx_Extbase_MVC_RequestInterface $request) {
00098:   $controllerObjectName = $request->getControllerObjectName();
00099:   $controller = $this->objectManager->get($controllerObjectName);
00100:   if (!$controller instanceof Tx_Extbase_MVC_Controller_ControllerInterface) {
00101:    throw new Tx_Extbase_MVC_Exception_InvalidController('Invalid controller "' . $request->getControllerObjectName() . '". The controller must implement the Tx_Extbase_MVC_Controller_ControllerInterface.', 1202921619);

5 Tx_Extbase_MVC_Dispatcher::resolveController(Tx_Extbase_MVC_Web_Request)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Dispatcher.php:
00078:   while (!$request->isDispatched()) {
00079:    if ($dispatchLoopCount++ > 99) throw new Tx_Extbase_MVC_Exception_InfiniteLoop('Could not ultimately dispatch the request after '  . $dispatchLoopCount . ' iterations. Most probably, a @dontvalidate annotation is missing on re-displaying a form with validation errors.', 1217839467);
00080:    $controller = $this->resolveController($request);
00081:    try {
00082:     $controller->processRequest($request, $response);

4 Tx_Extbase_MVC_Dispatcher::dispatch(Tx_Extbase_MVC_Web_Request, Tx_Extbase_MVC_Web_Response)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Web/BackendRequestHandler.php:
00046:   $response = $this->objectManager->create('Tx_Extbase_MVC_Web_Response');
00047: 
00048:   $this->dispatcher->dispatch($request, $response);
00049: 
00050:   return $response;

3 Tx_Extbase_MVC_Web_BackendRequestHandler::handleRequest()

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Core/Bootstrap.php:
00245:   $requestHandler = $requestHandlerResolver->resolveRequestHandler();
00246: 
00247:   $response = $requestHandler->handleRequest();
00248: 
00249:   // If response is NULL after handling the request we need to stop

2 Tx_Extbase_Core_Bootstrap::run("", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Core/Bootstrap.php:
00308:    'pluginName' => $moduleSignature
00309:   );
00310:   $content = $this->run('', $configuration);
00311: 
00312:   print $content;

1 Tx_Extbase_Core_Bootstrap::callModule("tools_CunddComposerComposer")

typo3_src/typo3_src-4.5.22/typo3/mod.php:
00055:   foreach ($TBE_MODULES['_dispatcher'] as $dispatcherClassName) {
00056:    $dispatcher = t3lib_div::makeInstance($dispatcherClassName);
00057:    if ($dispatcher->callModule($temp_M) === TRUE) {
00058:     $isDispatched = TRUE;
00059:     break;

from cundd_composer.

cundd avatar cundd commented on June 23, 2024

Ok, this may be because the rewritten property mapper doesn't exist.
If you are still willing to try and test, you could pull the latest changes from the typo3-4.5-support branch. There I implemented a fallback to a very simple property mapper

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

okay, next missing class! oh how much I love extbase, NOT :)

Uncaught TYPO3 Exception
Class Tx_Extbase_Property_PropertyMappingConfigurationBuilder does not exist 

ReflectionException thrown in file
typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php in line 100.

14 ReflectionParameter::getClass()

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php:
00098:      $reflectionParameter = $reflectionMethod->getParameters();
00099:      if (isset($reflectionParameter[0])) {
00100:       if (!$reflectionParameter[0]->getClass()) {
00101:        throw new Exception('Method "' . $reflectionMethod->getName(). '" of class "' . $reflectedClass->getName() . '" is marked as setter for Dependency Injection, but does not have a type annotation');
00102:       }

13 Tx_Extbase_Object_Container_ClassInfoFactory::getInjectMethods(ReflectionClass)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php:
00046:   }
00047:   $constructorArguments = $this->getConstructorArguments($reflectedClass);
00048:   $injectMethods = $this->getInjectMethods($reflectedClass);
00049:   return new Tx_Extbase_Object_Container_ClassInfo($className, $constructorArguments, $injectMethods);
00050:  }

12 Tx_Extbase_Object_Container_ClassInfoFactory::buildClassInfoFromClassName("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00288:    // in case something went wrong with unserialization etc..
00289:   if (!$this->cache->has($className) || !is_object($this->cache->get($className))) {
00290:    $this->cache->set($className, $this->classInfoFactory->buildClassInfoFromClassName($className));
00291:   }
00292:   return $this->cache->get($className);

11 Tx_Extbase_Object_Container_Container::getClassInfo("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00125:   }
00126: 
00127:   $classInfo = $this->getClassInfo($className);
00128: 
00129:   $instance = $this->instanciateObject($className, $classInfo, $givenConstructorArguments);

10 Tx_Extbase_Object_Container_Container::getInstanceInternal("Tx_CunddComposer_Domain_Repository_PackageRepository")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00180:   foreach ($classInfo->getInjectMethods() as $injectMethodName => $classNameToInject) {
00181: 
00182:    $instanceToInject = $this->getInstanceInternal($classNameToInject);
00183:    if ($this->isSingleton($instance) && !($instanceToInject instanceof t3lib_Singleton)) {
00184:     $this->log('The singleton "' . $classInfo->getClassName() . '" needs a prototype in "' . $injectMethodName . '". This is often a bad code smell; often you rather want to inject a singleton.', 1);

9 Tx_Extbase_Object_Container_Container::injectDependencies(Tx_CunddComposer_Controller_PackageController, Tx_Extbase_Object_Container_ClassInfo)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00128: 
00129:   $instance = $this->instanciateObject($className, $classInfo, $givenConstructorArguments);
00130:   $this->injectDependencies($instance, $classInfo);
00131: 
00132:   if (method_exists($instance, 'initializeObject') && is_callable(array($instance, 'initializeObject'))) {

8 Tx_Extbase_Object_Container_Container::getInstanceInternal("Tx_CunddComposer_Controller_PackageController", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/Container/Container.php:
00093:  public function getInstance($className, $givenConstructorArguments = array()) {
00094:   $this->prototypeObjectsWhichAreCurrentlyInstanciated = array();
00095:   return $this->getInstanceInternal($className, $givenConstructorArguments);
00096:  }
00097: 

7 Tx_Extbase_Object_Container_Container::getInstance("Tx_CunddComposer_Controller_PackageController", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Object/ObjectManager.php:
00062:   $arguments = func_get_args();
00063:   array_shift($arguments);
00064:   return $this->objectContainer->getInstance($objectName, $arguments);
00065:  }
00066: 

6 Tx_Extbase_Object_ObjectManager::get("Tx_CunddComposer_Controller_PackageController")

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Dispatcher.php:
00097:  protected function resolveController(Tx_Extbase_MVC_RequestInterface $request) {
00098:   $controllerObjectName = $request->getControllerObjectName();
00099:   $controller = $this->objectManager->get($controllerObjectName);
00100:   if (!$controller instanceof Tx_Extbase_MVC_Controller_ControllerInterface) {
00101:    throw new Tx_Extbase_MVC_Exception_InvalidController('Invalid controller "' . $request->getControllerObjectName() . '". The controller must implement the Tx_Extbase_MVC_Controller_ControllerInterface.', 1202921619);

5 Tx_Extbase_MVC_Dispatcher::resolveController(Tx_Extbase_MVC_Web_Request)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Dispatcher.php:
00078:   while (!$request->isDispatched()) {
00079:    if ($dispatchLoopCount++ > 99) throw new Tx_Extbase_MVC_Exception_InfiniteLoop('Could not ultimately dispatch the request after '  . $dispatchLoopCount . ' iterations. Most probably, a @dontvalidate annotation is missing on re-displaying a form with validation errors.', 1217839467);
00080:    $controller = $this->resolveController($request);
00081:    try {
00082:     $controller->processRequest($request, $response);

4 Tx_Extbase_MVC_Dispatcher::dispatch(Tx_Extbase_MVC_Web_Request, Tx_Extbase_MVC_Web_Response)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/MVC/Web/BackendRequestHandler.php:
00046:   $response = $this->objectManager->create('Tx_Extbase_MVC_Web_Response');
00047: 
00048:   $this->dispatcher->dispatch($request, $response);
00049: 
00050:   return $response;

3 Tx_Extbase_MVC_Web_BackendRequestHandler::handleRequest()

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Core/Bootstrap.php:
00245:   $requestHandler = $requestHandlerResolver->resolveRequestHandler();
00246: 
00247:   $response = $requestHandler->handleRequest();
00248: 
00249:   // If response is NULL after handling the request we need to stop

2 Tx_Extbase_Core_Bootstrap::run("", array)

typo3_src/typo3_src-4.5.22/typo3/sysext/extbase/Classes/Core/Bootstrap.php:
00308:    'pluginName' => $moduleSignature
00309:   );
00310:   $content = $this->run('', $configuration);
00311: 
00312:   print $content;

1 Tx_Extbase_Core_Bootstrap::callModule("tools_CunddComposerComposer")

typo3_src/typo3_src-4.5.22/typo3/mod.php:
00055:   foreach ($TBE_MODULES['_dispatcher'] as $dispatcherClassName) {
00056:    $dispatcher = t3lib_div::makeInstance($dispatcherClassName);
00057:    if ($dispatcher->callModule($temp_M) === TRUE) {
00058:     $isDispatched = TRUE;
00059:     break;

from cundd_composer.

cundd avatar cundd commented on June 23, 2024

Next try: I installed the 4.5.22 Introduction package. Now the latest commit should work

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

Hey nice, seems like it's working now, thanks. Problem now: Our php installation issn't in one of the default places and thus not found. Quickchecking the source, I found out this phpExecutable should be configurable in TS. Question is: Where? As the module does't work in a page-context way I'm unsure where to overwrite/set the TS-value.

from cundd_composer.

cundd avatar cundd commented on June 23, 2024

I have to give in, that I don't fully understand how the TypoScript is merged in the backend, but

module.tx_cunddcomposer {
    settings {
        phpExecutable = /full/path/to/the/executable/php
    }
}

into the root page's TypoScript should work.

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

unfortunately it doesn't work. I suggest as the module is pagetree-dependent, settings are not injected by extbase. i dumped

$this->settings

in

Classes/Controller/PackageController.php: getPHPExecutable

and it was null, not even default values were set! Are default settings loaded in your testinstallation?

from cundd_composer.

cundd avatar cundd commented on June 23, 2024

It's strange. In the Introduction package (and my other installations) it works well. I am using it to set the PHP executable to use the one shipped with MAMP.
The default value isn't set by the TypoScript setup. It is searched for in the PATH environment variable (see https://github.com/cundd/CunddComposer/blob/typo3-4.5-support/Classes/Controller/PackageController.php#L287)

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

Well yes, but none of the settings loaded from:

https://github.com/cundd/CunddComposer/blob/typo3-4.5-support/Configuration/TypoScript/setup.txt

So I believe there might be a general problem with this.

Before searching pathfolders maby you could check PHP_BINDIR first like:

if(file_exists(PHP_BINDIR.'/php')){
     return PHP_BINDIR.'/php'; 
}

This might also be usefull in an enviroment with multiple php installations, where the first found installation might not be the correct one.

from cundd_composer.

cundd avatar cundd commented on June 23, 2024

Thanks for the tip! I added PHP_BINDIR to the latest commit.
Furthermore I removed the static TypoScript files (which wouldn't work in your case too?) und added the configuration for the PHP path in the Extension Manager, which is a better place, than in the TS (do you agree?).

from cundd_composer.

nsaleh avatar nsaleh commented on June 23, 2024

thanks I totally agree! As the initial problem is solved too I ll close this issue. I found another problem concerning the autoloading property but i'll open another issue tomorrow after investigating and testing a little more. Thanks again for replying and fixing so fast.

from cundd_composer.

Related Issues (7)

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.