コード例 #1
0
ファイル: revision.php プロジェクト: Gfksx/customisation-db
            }
            $revision_attachment = new titania_attachment(TITANIA_CONTRIB);
            $revision_attachment->attachment_id = $revision->attachment_id;
            if (!$revision_attachment->load()) {
                trigger_error('ERROR_NO_ATTACHMENT');
            }
            titania::_include('library/translations/translation_validation');
            $zip_file = titania::$config->upload_path . '/' . utf8_basename($revision_attachment->attachment_directory) . '/' . utf8_basename($revision_attachment->physical_filename);
            $new_dir_name = titania::$contrib->contrib_name_clean . '_' . preg_replace('#[^0-9a-z]#', '_', strtolower($revision->revision_version));
            $validation_tools = new translation_validation($zip_file, $new_dir_name);
            $sql = 'SELECT row_id, phpbb_version_branch, phpbb_version_revision FROM ' . TITANIA_REVISIONS_PHPBB_TABLE . '
				WHERE revision_id = ' . $revision->revision_id;
            $result = phpbb::$db->sql_query($sql);
            while ($row = phpbb::$db->sql_fetchrow($result)) {
                $version_string = $row['phpbb_version_branch'][0] . '.' . $row['phpbb_version_branch'][1] . '.' . $row['phpbb_version_revision'];
                $reference_filepath = $validation_tools->automod_phpbb_files($version_string);
                // path to files against which we will validate the package
            }
            $errors = $validation_tools->check_package($reference_filepath);
            if (!empty($errors)) {
                trigger_error(implode('<br /><br />', $errors));
            }
            $validation_tools->remove_temp_files();
            phpbb::$template->assign_var('S_PASSED_TRANSLATION_VALIDATION', true);
            break;
        case 5:
            $revision = new titania_revision(titania::$contrib, $revision_id);
            if (!$revision->load()) {
                trigger_error('NO_REVISION');
            }
            // Repack if that's what we want
コード例 #2
0
    public function translation_validate(&$contrib, &$revision, &$revision_attachment, &$contrib_tools, $download_package)
    {
        $new_dir_name = $contrib->contrib_name_clean . '_' . preg_replace('#[^0-9a-z]#', '_', strtolower($revision->revision_version));
        $validation_tools = new translation_validation($contrib_tools->original_zip, $new_dir_name);
        $sql = 'SELECT row_id, phpbb_version_branch, phpbb_version_revision FROM ' . TITANIA_REVISIONS_PHPBB_TABLE . '
			WHERE revision_id = ' . $revision->revision_id;
        $result = phpbb::$db->sql_query($sql);
        while ($row = phpbb::$db->sql_fetchrow($result)) {
            $version_string = $row['phpbb_version_branch'][0] . '.' . $row['phpbb_version_branch'][1] . '.' . $row['phpbb_version_revision'];
            $reference_filepath = $validation_tools->automod_phpbb_files($version_string);
            // path to files against which we will validate the package
        }
        $errors = $validation_tools->check_package($reference_filepath);
        if (!empty($errors)) {
            trigger_error(implode('<br /><br />', $errors));
        }
        $validation_tools->remove_temp_files();
        phpbb::$template->assign_var('S_PASSED_TRANSLATION_VALIDATION', true);
    }