Integration of 3rd party tools using multiple classes

Permalink
What is the best way to integrate a 3rd party tool/library of classes with concrete5?

Concrete obviously uses its own __autoload function and has a specific method for making classes available. If I want to "install" a 3rd party tool (dompdf) that attempts to use an __autoload for its own classes (50+), how would I go about doing so?

Any help/guidance would be greatly appreciated!

Adam

 
Tony replied on at Permalink Reply
Tony
make a package, add a directory called "libraries", stick it in there, and include it from somewhere else (like a block controller or a model in a package_name/model directory)
avannoord replied on at Permalink Reply
Thanks for the response tony. I created the package and added the files to the "libraries" directory within the package. However, when I attempt to instantiate the main class i get the following error message:


Strict Standards: Non-static method Loader::helper() should not be called statically in /home4/nitkeauc/public_html/concrete/startup/autoload.php on line 4

Strict Standards: Non-static method Object::camelcase() should not be called statically in /home4/nitkeauc/public_html/concrete/libraries/loader.php on line 219

Any ideas?
Remo replied on at Permalink Reply
Remo
some code?

I guess you're not using the loader properly.

Show us some code and we'll help you..
avannoord replied on at Permalink Reply 2 Attachments
Here's the function I am attempting to call/pass arguments to. I've also attached two images depicting the organization of my directories/files within the "packages" directory. Thank you very much for your quick responses.

<?php
   function getHtmlAndRenderPdf($html,$nameoffile) {
   require_once("/home4/nitkeauc/public_html/packages/dompdf_web/libraries/dompdf_web.php");
   $dompdf = new DOMPDF();
   $dompdf->load_html($html);
   $dompdf->render();
   $dompdf->stream($nameoffile);
   }
?>
Remo replied on at Permalink Reply
Remo
you have to use Loader::library and not a simple php include.

There are lots of examples in the code or check the syntax hightlighter addon which also loads an external library
Tony replied on at Permalink Reply
Tony
What i think is going on here is that whatever library you're including is putting your site into Strict Standards mode, which is then getting angry cause concrete doesn't have the word "static" before some of those function declarations in the loader class. The "static" isn't necessary to make the code work, and up until php5 it wasn't even available, but maybe they should be there since i don't really see why those would ever not need to be accessed statically... it is kinda good to enforce stuff like that.

Anyway, you can probably just switch it out of strict standards mode after you do the include.