Protection is used to restrict the making of changes to a page (edit or move), the creation of a page, or the upload of a file.
MediaWiki handles existing and not-existing pages differently, because not-existing pages don't have a page ID. That's why protection information is stored in two different tables, and listing of such pages are separate.
A page can be protected with the protect API.
- Manual:Hooks/ArticleProtect - occurs whenever the software receives a request to protect an article
- Manual:Hooks/ArticleProtectComplete - occurs after the protect article request has been processed