Open s4shi87 opened 8 years ago
This makes it impossible to use this API with any existing framework, as they do their own session management, which breaks if this library just globally starts the session.
There might be a way to integrate this with WordPress.
I think this code snippet helps:
function register_session(){ if( !session_id() ) session_start(); } add_action('init','register_session');
Just tested it in a flat WP installation where I integrated this API as a plugin. With this code in the main plugin file, I don't get any "headers already sent" messages and the API returns region data, all properties for an account, and the other demo function calls seem to work as well.
Without the snippet I do get the warnings - API works too though.
Not sure how this affects compatibility to other plugins with session handling!
Wenn das Projekt schon die Session per
session_start();
gestartet hat, dann kommt eine Notice Meldung, weil in/Immobilienscout/Rest.php
in Zeile 2 die Session erneut gestartet wird.Es ist zwar nur eine Notice, aber bitte beheben ... oder ein Workaround vorschlagen :)