示例#1
0
<?php

/**
 * This scripts iterates recursively through the whole phpMyFAQ project and
 * creates SHA-1 keys for all files
 *
 * PHP Version 5.2.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   Scripts
 * @author    Thorsten Rinne <*****@*****.**>
 * @copyright 2012 phpMyFAQ Team
 * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
 * @link      http://www.phpmyfaq.de
 * @since     2012-04-11
 */
require dirname(__FILE__) . '/../inc/System.php';
$system = new PMF_System();
print $system->createHashes();
示例#2
0
文件: index.php 项目: atlcurling/tkt
            
            </p>
        </section>

        <section>
            <header>
                <h3><?php 
        print $PMF_LANG["ad_online_verification"];
        ?>
</h3>
            </header>
            <?php 
        $getJson = PMF_Filter::filterInput(INPUT_POST, 'getJson', FILTER_SANITIZE_STRING);
        if (!is_null($getJson) && 'verify' === $getJson) {
            $faqSystem = new PMF_System();
            $localHashes = $faqSystem->createHashes();
            $remoteHashes = file_get_contents('http://www.phpmyfaq.de/api/verify/' . $faqconfig->get('main.currentVersion'));
            $diff = array_diff(json_decode($localHashes, true), json_decode($remoteHashes, true));
            if (1 !== count($diff)) {
                printf('<p class="error">%s</p>', $PMF_LANG["ad_verification_notokay"]);
                print '<ul>';
                foreach ($diff as $file => $hash) {
                    if ('created' === $file) {
                        continue;
                    }
                    printf('<li><span title="%s">%s</span></li>', $hash, $file);
                }
                print '</ul>';
            } else {
                printf('<p class="success">%s</p>', $PMF_LANG["ad_verification_okay"]);
            }