When trying to use an external library with “use” keyword in SC such as http://opensource.box.com/spout/getting-started/#basic-usage, after using sc_include_library macro, this is what I have to do to get it to work:
-
replace the require_once and use statements with sc_include_library
-
use the full namespace when the classes are instantiated. So for the link above,
$reader = ReaderFactory::create(Type::XLSX);
changes to something like
$reader = Spout\Reader\ReaderFactory::create(Spout\Common\Type::XLSX);
Anything else I try gives an error.
This means I lose the convenience “use” offers.
Is there anyway to have the “use” keyword or some other short-hand route with SC?