test-https-everywhere.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. HTTPSEverywhere for Desktopd
  4. Copyright (C) 2015 Desktopd Developer(s)
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU Affero General Public License as
  7. published by the Free Software Foundation, either version 3 of the
  8. License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Affero General Public License for more details.
  13. You should have received a copy of the GNU Affero General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. https://www.gnu.org/licenses/agpl.html
  16. */
  17. namespace Desktopd;
  18. require_once __DIR__ . '/autoloader.php';
  19. $ruleDir = dirname(__DIR__) . '/https-everywhere/https-everywhere/src/chrome/content/rules';
  20. $userRuleDir = dirname(__DIR__) . '/https-everywhere/HTTPSEverywhereUserRules';
  21. $httpsEverywhere = new HTTPSEverywhere\HTTPSEverywhere($ruleDir, $userRuleDir);
  22. var_dump(count($httpsEverywhere));
  23. var_dump($httpsEverywhere->rewrite('http://www.eff.org/https-everywhere'));
  24. var_dump($httpsEverywhere->rewrite('http://www.twitter.com/twitter'));
  25. // vim: ts=4 et ai