AdminPageFrameworkLoader_AdminPage_Tool_Generator_Generator::_replyToModifyFileContents PHP Метод

_replyToModifyFileContents() публичный Метод

Modifies the file contents of the archive.
С версии: 3.5.4
public _replyToModifyFileContents ( $sFileContents, $sPathInArchive ) : string
Результат string The modified file contents.
    public function _replyToModifyFileContents($sFileContents, $sPathInArchive)
    {
        // Check the file extension.
        $_aAllowedExtensions = apply_filters(AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_allowed_file_extensions', array('php', 'css', 'js'));
        if (!in_array(pathinfo($sPathInArchive, PATHINFO_EXTENSION), $_aAllowedExtensions)) {
            return $sFileContents;
        }
        // Modify the file contents.
        $sFileContents = apply_filters(AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_generator_file_contents', $sFileContents, $sPathInArchive, $this->oFactory->oUtil->getElement($_POST, array($this->oFactory->oProp->sOptionKey), array()), $this->oFactory);
        // At this point, it is a php file.
        return $this->_modifyClassNameByPath($sFileContents, $sPathInArchive);
    }