-
Notifications
You must be signed in to change notification settings - Fork 503
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
Media model api #110
Media model api #110
Conversation
@eyedol I think this is mostly on the right track..
|
In fact this might work for serving image thumbnails etc: https://github.com/Bodom78/kohana-imagefly |
@rjmackay Would be great if The |
If you guys end up doing dynamic image resizing on request, proceed with caution. It's very expensive to do in real time and also very difficult if you are serving media off a CDN. |
@brianherbert Good point. Doing it in real-time can mostly be avoided.. but also if the resized image is cached it only has to happens once anyway. CDN is a more serious issue though. |
There was an email/post from Evan on this, as I scramble to find it. It was quite detailed.
|
…have to be a json body
Progress so far:
Next
|
|
||
protected $upload_dir; | ||
|
||
public function before() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we overriding before() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to initialize $this->upload_dir
. I have removed this. The global scope of it is no longer needed as I'm moving the unlink
call to the model class.
@Henry RE: "As an API consumer, when I hit the media endpoint, I expect some re-resized images for my consumption, that was why I had the different sizes defined in the table."
However do what you think makes sense given the CDN and API limitations.. we probably can't get all of these sorted. Also agree on just maintaining file_url |
@@ -2,7 +2,7 @@ | |||
|
|||
/** | |||
* Ushahidi API Posts Controller | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to revert all the random whitespace changes in Posts and Sets before merge..
@@ -108,7 +108,7 @@ git submodule update --init | |||
6. Edit ```application/config/environments/development/init.php``` and change base_url to point the the httpdocs directory in your deployment | |||
7. Copy ```httpdocs/template.htaccess``` to ```httpdocs/.htaccess``` | |||
8. Edit ```httpdocs/.htaccess``` and change the RewriteBase value to match your deployment url | |||
9. Create directories ```application/cache``` and ```application/logs``` and make sure they're writeable by your webserver | |||
9. Create directories ```application/cache```, ```application/media/uploads``` and ```application/logs``` and make sure they're writeable by your webserver | |||
``` | |||
mkdir application/cache application/logs | |||
chown www-data application/cache application/logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the example commands too?
/** | ||
* Path to the image cache directory you would like to use, don't forget the trailing slash! | ||
*/ | ||
'cache_dir' => APPPATH.'cache/imagefly/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea if this should be using DIRECTORY_SEPARATOR here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DIRECTORY_SEPARATOR
is not really necessary but a good practice. I also think it's future safe. Maybe not. I'll change the /
to that instead for the sake of 'good practice'
I think this is done bar minor things.. fix the docs. make a call on the config. Merge it! 👍 |
@eyedol is this: https://wiki.ushahidi.com/display/WIKI/Ushahidi+3.x+API+Media+Resource all up to date with the changes? |
Yes. Updated it with the changes. Mind a review? |
* add toggle button to sidebar at data view page * fix angular json
Initial implementation and getting myself up to speed with the current code base. So far:
media
table with schema defined in the migration file 20131007103144.phpmedia
model.application/classes/Controller/Api/Media.php
with some initial implementation for the various endpointsmedia
modelNext
application/media/uploads