How are you registering your config?
How are you registering your librarys?
Really a lot of this question depends on your bootstrapping method with phalcon.
My advice components. https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_User_Component.html#methods
Registeer your namespaces
$loader = new \Phalcon\Loader();
$loader->registerNamespaces(array(
'Name\Library' => $config->application->libraryDir
));
namespace Name\Library\YourClass;
use Phalcon\Mvc\User\Component;
class YourClass extends Component
{
$this->config
//or
$this->getDi()->getConfig();
// assuming you ahve registered your config file in DI() shown below.
}
$di->set('config', $config);
there are serveral missing parts to this that i assuem you arleady have in place given the nature of your question.