Skip to content

Fix subdirectories - #4

Open
exhnozoaa wants to merge 2 commits into
gilbitron:masterfrom
exhnozoaa:fix-subdirectories
Open

Fix subdirectories#4
exhnozoaa wants to merge 2 commits into
gilbitron:masterfrom
exhnozoaa:fix-subdirectories

Conversation

@exhnozoaa

Copy link
Copy Markdown

In this fork/branch, do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, it is now using parse_url().

Currently, Pico does not support files with the same names as directories. In this fork/branch, the plugin uses the correct file/directory based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end (a different bug for a different project).

do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, we are now using parse_url().

Currently, Pico does not support files with the same names as directories. This plugin will use the correct version based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end.
@exhnozoaa

Copy link
Copy Markdown
Author

This is meant to address issue #2, but I can't seem to figure out how to link them in GitHub. I apologize for the duplicate issue.

@csholmq

csholmq commented Aug 13, 2013

Copy link
Copy Markdown

This didn't fix my issues. If anything now I can't edit anything.

@exhnozoaa

Copy link
Copy Markdown
Author

Thanks for the feedback. Hmm... I'm not sure what the problem could be. Where there any error messages, or did it just not work?

@csholmq

csholmq commented Aug 14, 2013

Copy link
Copy Markdown

I have no idea. I turned on all PHP errors but nothing showed up. All I get is Error: Invalid file. I can successfully create and edit a file. But as soon as I click on another file the error message pops up. So something is up with opening them.

@csholmq

csholmq commented Aug 14, 2013

Copy link
Copy Markdown

I did some probing and it's line 122 that goes off. I.e the second die(error) in do_open. I think it's due to my site being in a subdirectory.

print_r($parse_file_url)
Array
(
[scheme] => http
[host] => honken.eu
[path] => /pages/blog/pwd_req
)

echo CONTENT_DIR . $parse_file_url['path']
/share/MD0_DATA/Web/pages/content//pages/blog/pwd_req

As you can see /pages is my subdirectory and is in both path and the physical file path.

@pomaxa

pomaxa commented Aug 27, 2013

Copy link
Copy Markdown

It will be nice, to be able to create subdirictory and a new page in subdirictory; btw, - thanks

@pomaxa

pomaxa commented Aug 28, 2013

Copy link
Copy Markdown

@exhnozoaa I've taken your changes and create a new pull request with some more improvements (#5)

@pomaxa

pomaxa commented Mar 12, 2014

Copy link
Copy Markdown

@varakh - I haven't use pico for a while, - so can't tell you right now, but if you can describe the error in my version, I'll be able to update it.

@pomaxa

pomaxa commented Mar 12, 2014

Copy link
Copy Markdown

@varakh have you update base_url ?

@pomaxa

pomaxa commented Mar 12, 2014

Copy link
Copy Markdown

all scripts use this var when load resources like

<script src="{{ base_url }}/{{ plugin_path }}/epiceditor/js/epiceditor.min.js"></script>

so if you change your base_url, by moving your project from root dir, please be sure to update this var.

@pomaxa

pomaxa commented Mar 12, 2014

Copy link
Copy Markdown

@varakh - have you check error log ? can you show an example?

@ghost

ghost commented Mar 12, 2014

Copy link
Copy Markdown

@pomaxa I just moved it to / and won't try it in /blog/ again. Guess I won't be able to figure out a solution to this problem. But nevermind. It's okay like this. Thanks anyway.

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

Successfully merging this pull request may close these issues.

3 participants