note 127864 added to language.types.resource
| From: | mmenzel at it-economics dot de | Date: | Wed, 26 Oct 2022 09:52:48 +0000 |
| Subject: | note 127864 added to language.types.resource | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219816@lists.php.net to get a copy of this message | ||
'stream' is a general resource type and can have specific subtypes (imap, pop, curl ...).
Casting from 'stream' to them makes sense alright.
E.g. Making OAUTH2 work for imap, but still use the normal imap_ functions. Just open a ssl://
stream to the IMAP server with stream_socket_client(), send the "AUTHENTICATE XOAUTH2 ..."
authentication with valid token and then use the imap_ functions on the casted 'stream' to
'imap' resource.
Not being able to cast from 'stream' to 'imap' makes it necessary to use 3rd
party solutions, like php-imap. Doesn't have to be necessary, if the cast would be possible.
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.161 (proxied: 212.114.221.222)
----
Manual Page -- https://php.net/manual/en/language.types.resource.php
Edit -- https://main.php.net/note/edit/127864
Del: integrated -- https://main.php.net/note/delete/127864/integrated
Del: useless -- https://main.php.net/note/delete/127864/useless
Del: bad code -- https://main.php.net/note/delete/127864/bad+code
Del: spam -- https://main.php.net/note/delete/127864/spam
Del: non-english -- https://main.php.net/note/delete/127864/non-english
Del: in docs -- https://main.php.net/note/delete/127864/in+docs
Del: other reasons-- https://main.php.net/note/delete/127864
Reject -- https://main.php.net/note/reject/127864
Search -- https://main.php.net/manage/user-notes.php