I'm working with phpSPO library for work with sharePooint in a PHP app. https://github.com/vgrem/phpSPO
For example, I retrieve the files of an specific folder
try {
$authCtx = new AuthenticationContext($Settings['Url']);
$authCtx->acquireTokenForUser($Settings['UserName'],$Settings['Password']);
// conecction successfull
$folderUrl = "/sites/mySite/Tfts/eiic";
$url = $Settings['Url'] . "/_api/web/getFolderByServerRelativeUrl('{$folderUrl}')/Files";
$request = new RequestOptions($url);
$ctx = new ClientContext($url,$authCtx);
$data = $ctx->executeQueryDirect($request);
// HOW to Convert $data to FolderItem or Folder class ??
}
catch (Exception $e) {
echo 'Error: ', $e->getMessage(), "
";
}
In the example above, $data is a JSON with the folder files but, How can I convert this JSON to a File or FileCollection for working with its properties?
Another Question, How to Upload a file to a specific folder ??
Thank u very much !