{"action":"created","issue":{"url":"https://api.github.com/repos/jarednova/timber/issues/457","labels_url":"https://api.github.com/repos/jarednova/timber/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/jarednova/timber/issues/457/comments","events_url":"https://api.github.com/repos/jarednova/timber/issues/457/events","html_url":"https://github.com/jarednova/timber/pull/457","id":55990085,"number":457,"title":"work with Wordpress UPLOADS constant","user":{"login":"xavierpriour","id":2295912,"avatar_url":"https://avatars.githubusercontent.com/u/2295912?v=3","gravatar_id":"","url":"https://api.github.com/users/xavierpriour","html_url":"https://github.com/xavierpriour","followers_url":"https://api.github.com/users/xavierpriour/followers","following_url":"https://api.github.com/users/xavierpriour/following{/other_user}","gists_url":"https://api.github.com/users/xavierpriour/gists{/gist_id}","starred_url":"https://api.github.com/users/xavierpriour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xavierpriour/subscriptions","organizations_url":"https://api.github.com/users/xavierpriour/orgs","repos_url":"https://api.github.com/users/xavierpriour/repos","events_url":"https://api.github.com/users/xavierpriour/events{/privacy}","received_events_url":"https://api.github.com/users/xavierpriour/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-30T03:21:57Z","updated_at":"2015-02-10T00:27:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jarednova/timber/pulls/457","html_url":"https://github.com/jarednova/timber/pull/457","diff_url":"https://github.com/jarednova/timber/pull/457.diff","patch_url":"https://github.com/jarednova/timber/pull/457.patch"},"body":"Wordpress lets you define a custom uploads directory by setting the UPLOADS constant (http://codex.wordpress.org/Editing_wp-config.php#Moving_uploads_folder).\r\nThe existing implementation of \"resize\" did not take that case into account and generated incorrect URL for the files, resulting in broken img links.\r\nTo fix it, I rewrote the function, then also updated the other image manipulation filters (retina, img_to_jpg and letterbox) to handle that case as well.\r\n\r\nIn the end, I significantly refactored TimberImageHelper to focus on comprehensive directory handling, and moved image manipulation to dedicated class hierarchy (under TimberImageOperation)."},"comment":{"url":"https://api.github.com/repos/jarednova/timber/issues/comments/73620938","html_url":"https://github.com/jarednova/timber/pull/457#issuecomment-73620938","issue_url":"https://api.github.com/repos/jarednova/timber/issues/457","id":73620938,"user":{"login":"jarednova","id":1298086,"avatar_url":"https://avatars.githubusercontent.com/u/1298086?v=3","gravatar_id":"","url":"https://api.github.com/users/jarednova","html_url":"https://github.com/jarednova","followers_url":"https://api.github.com/users/jarednova/followers","following_url":"https://api.github.com/users/jarednova/following{/other_user}","gists_url":"https://api.github.com/users/jarednova/gists{/gist_id}","starred_url":"https://api.github.com/users/jarednova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarednova/subscriptions","organizations_url":"https://api.github.com/users/jarednova/orgs","repos_url":"https://api.github.com/users/jarednova/repos","events_url":"https://api.github.com/users/jarednova/events{/privacy}","received_events_url":"https://api.github.com/users/jarednova/received_events","type":"User","site_admin":false},"created_at":"2015-02-10T00:27:24Z","updated_at":"2015-02-10T00:27:24Z","body":"@xavierpriour there's some [discussion here](https://github.com/Varying-Vagrant-Vagrants/VVV/issues/98) about switching PHP versions in VVV (conclusion: not a part of the software). So the best bet seems to be using Travis to report issues and fixing (and then pushing back to your branch to re-test). You can see the builds you submit listed here:\r\n\r\nhttps://travis-ci.org/jarednova/timber/pull_requests\r\n\r\n... I've found that you can solve 99% of the problems with this:\r\n\r\n### Arrays from methods\r\n###### PHP 5.4\r\n```php\r\n$foo = get_my_bar()['foo'];\r\n```\r\n###### PHP 5.3\r\n```php\r\n$bar = get_my_bar();\r\n$foo = $bar['foo'];\r\n```\r\n\r\n### Declaring arrays\r\n###### PHP 5.4\r\n```php\r\n$foo = [];\r\n```\r\n##### PHP 5.3\r\n```\r\n$foo = array();\r\n```\r\n\r\n### `$this` in Closures\r\n###### PHP 5.4\r\n```php\r\nadd_filter('my_foo', function() {\r\n    $this->bar = 'quack';\r\n});\r\n```\r\n\r\n###### PHP 5.3\r\n```php\r\nadd_filter('my_foo', function() use ($this) {\r\n    $this->bar = 'quack';\r\n});\r\n```"}}