PHP 클래스 ExperimentServer, psychopy

Note:

  • The server requires the cURL PHP library to be installed. Under linux, that can usually be done using: sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
  • PHP error logs can usually be found here: Ubuntu => /var/log/apache2/error.log
  • 파일 보기 프로젝트 열기: psychopy/psychopy 1 사용 예제들

    공개 메소드들

    메소드 설명
    __construct ( )
    osfPull ( ) Download resources from the OSF server onto the experiment server
    processPOST ( ) Process the HTTP POST request sent to this experiment server.

    비공개 메소드들

    메소드 설명
    addResource ( {String} $name ) Manually add a resource to the resource manager
    cleanString ( {String} $string ) : {String} Clean strings by removing all characters except A-Z, a-z, 0-9, dots, hyphens and spaces and replacing sequences of spaces with underscore
    expUpload ( ) Upload data to the project's resource directory on the local experiment server
    getOsfDataDirectoryLink ( ) Get project's data folder URL on OSF server
    getOsfDownloadLinks ( ) Get download links for all available resources in the project's OSF resource directory
    getOsfResource ( {String} $name ) Get resource from OSF server
    getOsfResourceDirectoryLink ( ) Get project's resource directory URL on OSF server
    getOsfStorageProvider ( ) Get storage provider and upload URL of project on OSF server
    listLocalResources ( ) : {String} List the resources available in the resource directory of the local experiment server
    osfUpload ( ) Upload data to the project's resource directory on the local experiment server and upload them to OSF
    saveDataToLocalFile ( {String} $session, {Object} $data, {{('RESULT' | 'LOG')}} $dataType ) : {String} Save data to a file on the local experiment server
    sendEmail ( ) Send an email to the experimenter.
    showSynchronisationGUI ( ) Show the experiment server synchronisation GUI
    uploadLocalFileToOSF ( {String} $localFileName, {String} $OSFFileName ) : {String} Upload a file from the local experiment server onto the OSF server

    메소드 상세

    __construct() 공개 메소드

    public __construct ( )

    osfPull() 공개 메소드

    Download all available resources from the resource directory of the project on the OSF server onto the experiment server's resource directory

    public osfPull ( )

    processPOST() 공개 메소드

    Get the 'command' variable passed to the experiment server via a HTTP POST method

    • if 'command' is not set, we show the server's synchronisation GUI
    • if 'command' = 'EXP_UPLOAD', data contained in the 'data' variable passed via the POST method is saved locally on the local experiment server's data directory
    • if 'command' = 'OSF_UPLOAD', data contained in the 'data' variable passed via the POST method is saved locally on the local experiment server's data directory and uploaded to the remote OSF server
    • if 'command' = 'PULL', all of the project's resources are downloaded from the project's resource directory on the remote OSF server onto the local experiment server's resource directory
    • if 'command' = 'LIST_RESOURCES', return the list of all available resource names in local resource directory as a stringified json array of resource names
    • if 'command' = 'EMAIL', we send an email to the experimenter using the specified SMTP email server

    public processPOST ( )