I am trying to incorporate an external application as a library within Joomla which I have done before on a couple of occasions, however in this case there is a single .php file with about 20 classes and I am starting to think it is not possible to handle this in Joomla.
When I try to use a Class it comes back as not found.
My previous efforts haves always been a single file containing a single class of the same name as the file it resides in.
In the non Joomla environment this application uses a simple Include statement but in my attempts I am using Jloader to register the Namespace, like I have done before, but everything I have read all seems to expect a one to one relationship between the filename and the class name.
Am I trying to do the impossible?
I could split the single file into individual files/classes but I would prefer not too if I don't have to.
Just curious, but what's the issue with breaking it up? Seems to me it's much better programming practice and better for tracking down issues to not have to dig past 17 other classes to find that one that's causing a problem, so I'm curious what the reasons might be for not doing that.
Aside from that, I think the syntax you're after is:
JLoader::register("MyExtraSpecialClass", JPATH_SITE . '/components/com_mine/library/fred.php'
Repeating the same file for every class in it (and remembering to add whatever namespacing there might be for the class name). Didn't that work for you?