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

Need Source subclass to use external URLs as sources #300

Closed
mrclay opened this issue Sep 4, 2015 · 2 comments
Closed

Need Source subclass to use external URLs as sources #300

mrclay opened this issue Sep 4, 2015 · 2 comments

Comments

@mrclay
Copy link
Owner

mrclay commented Sep 4, 2015

Originally reported on Google Code with ID 156

I wish to be able to use external URLs like /js/myscript.js
So the behaviour should remain as if the file was local, but it should be 
loaded externally.

Reported by admin@mrmunk.dk on 2010-01-30 12:08:16

@mrclay
Copy link
Owner Author

mrclay commented Sep 4, 2015

A crude solution is already possible:
http://code.google.com/p/minify/wiki/CustomSource#Example:_Content_from_a_URL

But something that would be resilient to remote errors is forthcoming, with usage
looking something like: (in groupsConfig.php)

$src1 = new Minify_Source_Url(array(
  'url' => 'http://3rdparty.com/file.js'
  ,'contentPattern' => '@if this doesn\'t match, use backup@'
  ,'backupFile' => '/path/to/file_backup.js' 
  /* many more options */
));

return array(
  'js' => array('//js/file1.js', $src1, '//js/file3.js');
);

Reported by mrclay.org on 2010-01-30 21:20:18

  • Status changed: Started
  • Labels added: Type-Enhancement
  • Labels removed: Type-Defect

@mrclay
Copy link
Owner Author

mrclay commented Sep 4, 2015

Great! Looking forward for true integration with Minify. 

(Offtopic: Thank you for making this great script, I've reduced HTTP requests from
16 
to 2!)

Reported by admin@mrmunk.dk on 2010-02-01 20:19:42

@mrclay mrclay closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant