Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 请教高人:两个php平台之间的数据导入导出

请教高人:两个php平台之间的数据导入导出

Jun 23, 2016 pm 02:18 PM

PHP moodle 数据传输

需求:
报名招生平台中的学生信息(用户名、密码、姓名、email、选择专业代码)导入到moodle平台数据库中相应的数据表中,
使学生可以在moodle平台中使用用户名和密码登陆moodle系统进行在线学习和参加课程测验,
测验完成后将学生的成绩(用户名、专业代码、课程名称、课程成绩)导出到报名招生平台中,学生可以查看自己的成绩信息。
要求:
这些操作在每天凌晨0点进行自动更新,自动将学生信息和学生成绩导入导出。
现在需要写一个脚本文件,定时执行,请教高人指点,做这个功能的主要步骤,在不同平台不同数据库之间的数据传输应该采用什么过渡保存,数组还是文件?或者是session、cookie?
在线等。。。。。。

回复讨论(解决方案)

没做过,提个思路

数据传输用接口. B平台每天定时执行php文件,请求A平台对应的接口.  A平台将新的数据通过接口传给B平台,B平台收到后入库.

用shell脚本应该可以实现的吧。

2个平台能否直接互访问数据库,如果可以的话,直接用shell脚本从a库插入b库就可以了。

如果不能话,那么都需要开发响应的接口

插入数据库放主动拉取数据:
报名招生平台需要提供批量获取用户信息的接口
moodle平台提供批量成绩信息接口

插入数据库被动更新数据:
报名招生平台需要提供批量插入成绩信息的接口
moodle平台提供批量插入用户信息接口

双方通讯可以使用post json 或者 直接下载txt文件

但是上面都是紧紧牵涉的插入,而不牵涉到更新的问题,更新的问题例如
a用户已经在moodle平台中,但是a用户的密码在报名招生平台修改了,那么moodle怎么同步这个密码?
总不能每次都是全部用户更新吧

所以说最好的方式还是报名招生平台提供sso,保持报名招生平台和moodle平台同步登陆登出才是王道。

首先要确定下数据库,如果可以,通过第三方工具。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Explain the concept of late static binding in PHP. Explain the concept of late static binding in PHP. Mar 21, 2025 pm 01:33 PM

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

PHP Logging: Best Practices for PHP Log Analysis PHP Logging: Best Practices for PHP Log Analysis Mar 10, 2025 pm 02:32 PM

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Discover File Downloads in Laravel with Storage::download Discover File Downloads in Laravel with Storage::download Mar 06, 2025 am 02:22 AM

The Storage::download method of the Laravel framework provides a concise API for safely handling file downloads while managing abstractions of file storage. Here is an example of using Storage::download() in the example controller:

How to Register and Use Laravel Service Providers How to Register and Use Laravel Service Providers Mar 07, 2025 am 01:18 AM

Laravel's service container and service providers are fundamental to its architecture. This article explores service containers, details service provider creation, registration, and demonstrates practical usage with examples. We'll begin with an ove

See all articles