<commit_before><?php
/**
 * XML, XHTML and PDF export - Classes and Functions
 *
 * PHP Version 5.3
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Export
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @copyright 2005-2013 phpMyFAQ Team
 * @link      http://www.phpmyfaq.de
 * @since     2005-11-02
 */

if (!defined('IS_VALID_PHPMYFAQ')) {
    exit();
}

require_once PMF_CONFIG_DIR . '/constants.php';

/**
 * Export Class
 *
 * This class manages the export formats supported by phpMyFAQ:
 * - PDF
 * - XHTML
 * - XML
 *
 * @category  phpMyFAQ
 * @package   Export
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @copyright 2005-2013 phpMyFAQ Team
 * @link      http://www.phpmyfaq.de
 * @since     2005-11-02
 */
class PMF_Export
{
    /**
     * Faq object
     *
     * @var PMF_Faq
     */
    protected $faq = null;

    /**
     * Category object
     *
     * @var PMF_Category
     */
    protected $category = null;

    /**
     * Configuration
     *
     * @var PMF_Configuration
     */
    protected $_config = null;

    /**
     * Factory
     *
     * @param PMF_Faq           $faq      Faq object
     * @param PMF_Category      $category Category object
     * @param PMF_Configuration $config   Configuration object
     * @param string            $mode     Export
     *
     * @return mixed
     *
     * @throws PMF_Exception
     */
    public static function create(PMF_Faq $faq, PMF_Category $category, PMF_Configuration $config, $mode = 'pdf')
    {
        $this->_config = $config;

        switch ($mode) {
            case 'pdf':
                return new PMF_Export_Pdf($faq, $category);
                break;
            case 'xml':
                return new PMF_Export_Xml($faq, $category);
                break;
            case 'xhtml':
                return new PMF_Export_Xhtml($faq, $category);
                break;
            default:
                throw new PMF_Exception('Export not implemented!');
        }
    }

    /**
     * Returns the timestamp of the export
     *
     * @return string
     */
    public static function getExportTimeStamp()
    {
        return date("Y-m-d-H-i-s", $_SERVER['REQUEST_TIME']);
    }
}<commit_msg>Fixed fatal error after merge<commit_after><?php
/**
 * XML, XHTML and PDF export - Classes and Functions
 *
 * PHP Version 5.3
 *
 * This Source Code Form is subject to the terms of the Mozilla Public License,
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
 * obtain one at http://mozilla.org/MPL/2.0/.
 *
 * @category  phpMyFAQ
 * @package   Export
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @copyright 2005-2013 phpMyFAQ Team
 * @link      http://www.phpmyfaq.de
 * @since     2005-11-02
 */

if (!defined('IS_VALID_PHPMYFAQ')) {
    exit();
}

require_once PMF_CONFIG_DIR . '/constants.php';

/**
 * Export Class
 *
 * This class manages the export formats supported by phpMyFAQ:
 * - PDF
 * - XHTML
 * - XML
 *
 * @category  phpMyFAQ
 * @package   Export
 * @author    <NAME> <<EMAIL>>
 * @author    <NAME> <<EMAIL>>
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @copyright 2005-2013 phpMyFAQ Team
 * @link      http://www.phpmyfaq.de
 * @since     2005-11-02
 */
class PMF_Export
{
    /**
     * Faq object
     *
     * @var PMF_Faq
     */
    protected $faq = null;

    /**
     * Category object
     *
     * @var PMF_Category
     */
    protected $category = null;

    /**
     * Configuration
     *
     * @var PMF_Configuration
     */
    protected $_config = null;

    /**
     * Factory
     *
     * @param PMF_Faq           $faq      Faq object
     * @param PMF_Category      $category Category object
     * @param PMF_Configuration $config   Configuration object
     * @param string            $mode     Export
     *
     * @return mixed
     *
     * @throws PMF_Exception
     */
    public static function create(PMF_Faq $faq, PMF_Category $category, PMF_Configuration $config, $mode = 'pdf')
    {
        $this->_config = $config;

        switch ($mode) {
            case 'pdf':
                return new PMF_Export_Pdf($faq, $category, $config);
                break;
            case 'xml':
                return new PMF_Export_Xml($faq, $category, $config);
                break;
            case 'xhtml':
                return new PMF_Export_Xhtml($faq, $category, $config);
                break;
            default:
                throw new PMF_Exception('Export not implemented!');
        }
    }

    /**
     * Returns the timestamp of the export
     *
     * @return string
     */
    public static function getExportTimeStamp()
    {
        return date("Y-m-d-H-i-s", $_SERVER['REQUEST_TIME']);
    }
}
{'fraction_non_alphanumeric': 0.12186242575205979, 'fraction_numerical': 0.017627898064763364, 'mean_word_length': 1.9491525423728813, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4596985', 'n_tokens_mistral': 1756, 'n_tokens_neox': 1628, 'n_words': 445}