src/Folder.php
public function createFile($name, $content = '', array $options = [])
    {
        $client = $this->_client;

        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive   = $client->getMyDrive();
        $item    = $client->getDriveItemById($drive->id, $this->_id);
        $options = [];

        if ($description !== null) {
            $options += [
                'description' => (string) $description,
            ];
        }

        $item    = $item->upload($name, $content, $options);
        $options = $client->buildOptions($item, ['parent_id' => $parentId]);

        return new File($client, $item->id, $options);
    }
public function createFile($name, $content = '', array $options = [])
    {
        $client = $this->_client;

        $message = sprintf(
            '%s() is deprecated and will be removed in version 3;'
                . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()'
                . ' instead',
            __METHOD__
        );

        @trigger_error($message, E_USER_DEPRECATED);
        $drive   = $client->getMyDrive();
        $item    = $client->getDriveItemById($drive->id, $this->_id);
        $options = [];

        if ($description !== null) {
            $options += [
                'description' => (string) $description,
            ];
        }

        $item    = $item->upload($name, $content, $options);
        $options = $client->buildOptions($item, ['parent_id' => $parentId]);

        return new File($client, $item->id, $options);
    }
public function createFile ( $ name , $ content = '' , array $ options = [ ] ) { $ client = $ this -> _client ; $ message = sprintf ( '%s() is deprecated and will be removed in version 3;' . ' use Krizalys\Onedrive\Proxy\DriveItemProxy::upload()' . ' instead' , __METHOD__ ) ; @ trigger_error ( $ message , E_USER_DEPRECATED ) ; $ drive = $ client -> getMyDrive ( ) ; $ item = $ client -> getDriveItemById ( $ drive -> id , $ this -> _id ) ; $ options = [ ] ; if ( $ description !== null ) { $ options += [ 'description' => ( string ) $ description , ] ; } $ item = $ item -> upload ( $ name , $ content , $ options ) ; $ options = $ client -> buildOptions ( $ item , [ 'parent_id' => $ parentId ] ) ; return new File ( $ client , $ item -> id , $ options ) ; }
Creates a file in the OneDrive folder referenced by this Folder instance.

@param string $name
The name of the OneDrive file to be created.
@param string|resource $content
The content of the OneDrive file to be created, as a string or
handle to an already opened file. In the latter case, the
responsibility to close the handle is is left to the calling
function. Default: ''.
@param array $options
The options.

@return File
The file created, as a File instance.

@throws Exception
Thrown on I/O errors.

@deprecated Use Krizalys\Onedrive\Proxy\DriveItemProxy::upload() instead.
Creates a file in the OneDrive folder referenced by this Folder instance .