Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read LOCAL OPML files #4

Open
RafaelLinux opened this issue Jun 16, 2021 · 3 comments
Open

Read LOCAL OPML files #4

RafaelLinux opened this issue Jun 16, 2021 · 3 comments

Comments

@RafaelLinux
Copy link

RafaelLinux commented Jun 16, 2021

I'm trying to read a OPML file (sources.opml) stored in same path that opml-parser.php in server, but it doesn't work, even preceding with "DIR" the path.

$O_Contenido->ParseLocation('sources.opml', null);    // doesn't work
$O_Contenido->ParseLocation('./sources.opml', null);    // doesn't work
$O_Contenido->ParseLocation(__DIR__.'/sources.opml', null);    // doesn't work
$O_Contenido->ParseLocation('https:/mysite/sources.opml', null); // works

Am I doing something wrong? I noticed that you use "curl" to retrieve file, but not sure if that's the issue.

Thank you

@imelgrat
Copy link
Owner

Hi @RafaelLinux. If you want to use this class on a local file, you should use the file:// protocol, followed by the full path of the file you're trying to read. The file protocol is disabled by cURL if open_basedir is set.

Best regards,
Iván

@RafaelLinux
Copy link
Author

file:// on server? As I wrote, the file will be read by PHP as a file IN server folder.

@imelgrat
Copy link
Owner

Yes. The file:// protocol is used for reading files stored in a server folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants