How nfephp-org/nfephp works
NFePHP is a legacy PHP API for Brazilian electronic invoices (NFe), not a stand-alone invoice issuer. An integrating application builds or supplies invoice XML, then uses the API to sign and exchange requests with SEFAZ; the API also handles responses, related operations, email, and document output. The graph emphasizes those runtime responsibilities and shared support. Several subsystem relationships are documented only by the source index or README; unsampled integrations are omitted rather than inferred.
Main entry points: ToolsNFe.php SEFAZ operations · BaseTools.php Tools foundation · MakeNFe.php NFe builder · IdentifyNFe.php NFe identification
Components 19
Invoice data
- NFe builder
libs/NFe/MakeNFe.php - NFe converter
libs/NFe/ConvertNFe.php - NFe identification
libs/NFe/IdentifyNFe.php
SEFAZ services
- SEFAZ operations
libs/NFe/ToolsNFe.php - Response handling
libs/NFe/ReturnNFe.php
Shared foundation
- Tools foundation
libs/Common/Base/BaseTools.php - XML foundation
libs/Common/Base/BaseMake.php - Configuration
libs/Common/Configure/Configure.php - Certificate handling
libs/Common/Certificate/Pkcs12.php - SOAP transport
libs/Common/Soap/CurlSoap.php - XML utilities
libs/Common/Dom/Dom.php - File utilities
libs/Common/Files/FilesFolders.php - Date and time
libs/Common/DateTime/DateTime.php - XML validation
libs/Common/Dom/ValidXsd.php
Documents and delivery
- NFe email
libs/NFe/MailNFe.php - DANFE renderer
libs/Extras/Danfe.php - DANFC-e renderer
libs/Extras/Danfce.php
Other components
- Issuer application
- SEFAZ
Connections 21
- Issuer application → NFe builder: builds XML
- Issuer application → SEFAZ operations: calls API
- NFe builder → XML foundation: uses foundation
libs/NFe/MakeNFe.php - NFe builder → Date and time: uses dates
libs/NFe/MakeNFe.php - NFe converter → NFe builder: uses builder
libs/NFe/ConvertNFe.php - SEFAZ operations → Tools foundation: extends foundation
libs/NFe/ToolsNFe.php - SEFAZ operations → Response handling: handles replies
libs/NFe/ToolsNFe.php - SEFAZ operations → NFe email: sends email
libs/NFe/ToolsNFe.php - SEFAZ operations → NFe identification: identifies invoices
libs/NFe/ToolsNFe.php - SEFAZ operations → XML validation: validates XML
libs/NFe/ToolsNFe.php - SEFAZ operations → DANFE renderer: creates PDF
libs/NFe/ToolsNFe.php - Tools foundation → Certificate handling: loads certificate
libs/Common/Base/BaseTools.php - Tools foundation → Date and time: sets timezone
libs/Common/Base/BaseTools.php - Tools foundation → XML utilities: parses XML
libs/Common/Base/BaseTools.php - Tools foundation → File utilities: reads files
libs/Common/Base/BaseTools.php - Tools foundation → SOAP transport: uses transport
libs/Common/Base/BaseTools.php - Response handling → XML utilities: uses XML
libs/NFe/ReturnNFe.php - NFe identification → File utilities: uses file tools
- NFe identification → XML utilities: uses XML
- SEFAZ → SEFAZ operations: exchanges messages
- Issuer application → DANFC-e renderer: requests print