[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] How to add third party package



Hi:

1) You should definitely be using composer for this. The auto generated file is probably one of many / several cached/ auto-created files. That besides, hardcoding the entry is completely the wrong way to do this. You should add the composer require reference to your composer.json file, testing it locally as needed to get it to work. Commit the newly generated composer.lock file and run composer install on your server.

See this talk on how to use composer properly: https://www.youtube.com/watch?v=nGD7G8-ccqs

2) If you're getting a 500 error that means your error log should be populated with a far more useful and exact error. Check out your error log to see what exactly the php compilation issue is. A useful thing to do is to run:

tail -f '/path/to/log'

This opens the log as a stream in your console and lets you see the errors occur in real time. You'll be able to see what is thrown when you try to execute the TCPDF code. 

3) If necessary, change servers. You're using composer, you're needing to see error logs, you need a server where you can do these things easily. If your provider isn't given you ssh access or letting you run composer.phar commands, you need to move. You're using tools that require that level of server access and the only way you'll ever be efficient is the way they were designed to work. 

Good luck!

Chad



Regards,
Chad Windnagle

On Wed, May 11, 2016 at 6:39 AM, Elena Cenacchi <elena.cenacchi AT gmail.com> wrote:
Hi,

I would like to add the tcpdf package to my Joomla! Framework web app, but I'm getting stuck in the class load process.

I have unzipped the package and loaded the tcpdf folder inside vendor (the folder contains the tcpdf.php file that defines the TCPDF class and several other files and directories).
I have added to vendor/composer/autoload_namespaces.php, inside the return array(....). the line:
'tcpdf' => array($vendorDir . '/tcpdf'), 

In my Model I have added:
use tcpdf\tcpdf;

The scope is loading the TCPDF class defined in vendor/tcpdf/tcpdf.php.

Now when in my function I call a simple tcpdf function as:

TCPDF::setAuthor('Nicola Asuni);

or if I try $test=new TCPDF();

I obtain a 500 Error Page.

I don't want to run composer because the web app is already working and online and it's hosted on a server where I can't call composer (so I should run it locally and then overwrite files and directories on the server), so I'd like to manually get the class loaded.

What am I missing?

Thanks for any possible hint/suggestion.

Elena

--
Framework source code: https://github.com/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-framework.

--
Framework source code: https://github.com/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
---
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-framework.