Prevent users of library from using internal classes

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

 



How can I prevent users of a PHP library from using classes defined in the
library which are not supposed to be used outside of it?

It would be nice if PHP had some concept of package or namespace
visibility, so I could create private classes, but it doesn't.

The only thing I can think of is to put all the internal classes in a
dedicated sub-namespace like \Vendor\Project\_Internal\Class, to make it
obvious.

Is there a better approach?

Thanks

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux