Permalink
Browse files

Move 3rd party stuff in vendor

  • Loading branch information...
ozh committed May 18, 2017
1 parent 5a8441c commit a755711a7edd437daf4336b8c6ab44086de74845
Showing with 3,209 additions and 1,299 deletions.
  1. +4 βˆ’4 .gitattributes
  2. +16 βˆ’8 composer.json
  3. +211 βˆ’0 composer.lock
  4. +0 βˆ’5 includes/BookmarkletGen/README.md
  5. +1 βˆ’5 includes/functions-auth.php
  6. +1 βˆ’42 includes/functions-compat.php
  7. +1 βˆ’5 includes/functions-formatting.php
  8. +4 βˆ’7 includes/functions-http.php
  9. +3 βˆ’3 includes/functions-l10n.php
  10. +3 βˆ’0 includes/load-yourls.php
  11. +0 βˆ’6 includes/phpass/README.md
  12. +0 βˆ’78 includes/pomo/entry.php
  13. +0 βˆ’257 includes/pomo/mo.php
  14. +0 βˆ’384 includes/pomo/po.php
  15. +0 βˆ’209 includes/pomo/streams.php
  16. +0 βˆ’275 includes/pomo/translations.php
  17. +7 βˆ’0 includes/vendor/autoload.php
  18. +127 βˆ’0 includes/vendor/build-script/yourls-build.sh
  19. +445 βˆ’0 includes/vendor/composer/ClassLoader.php
  20. +21 βˆ’0 includes/vendor/composer/LICENSE
  21. +9 βˆ’0 includes/vendor/composer/autoload_classmap.php
  22. +12 βˆ’0 includes/vendor/composer/autoload_namespaces.php
  23. +10 βˆ’0 includes/vendor/composer/autoload_psr4.php
  24. +52 βˆ’0 includes/vendor/composer/autoload_real.php
  25. +53 βˆ’0 includes/vendor/composer/autoload_static.php
  26. +198 βˆ’0 includes/vendor/composer/installed.json
  27. +74 βˆ’0 includes/vendor/ozh/bookmarkletgen/README.md
  28. +20 βˆ’0 includes/vendor/ozh/bookmarkletgen/composer.json
  29. +3 βˆ’1 ...kletGen/BookmarkletGen.php β†’ vendor/ozh/bookmarkletgen/src/Ozh/Bookmarkletgen/Bookmarkletgen.php}
  30. +45 βˆ’0 includes/vendor/ozh/phpass/README.md
  31. +21 βˆ’0 includes/vendor/ozh/phpass/composer.json
  32. +55 βˆ’8 includes/{phpass β†’ vendor/ozh/phpass/src/Ozh/Phpass}/PasswordHash.php
  33. +52 βˆ’0 includes/vendor/pomo/pomo/README.md
  34. +36 βˆ’0 includes/vendor/pomo/pomo/composer.json
  35. +314 βˆ’0 includes/vendor/pomo/pomo/src/MO.php
  36. +499 βˆ’0 includes/vendor/pomo/pomo/src/PO.php
  37. +27 βˆ’0 includes/vendor/pomo/pomo/src/Streams/CachedFileReader.php
  38. +22 βˆ’0 includes/vendor/pomo/pomo/src/Streams/CachedIntFileReader.php
  39. +62 βˆ’0 includes/vendor/pomo/pomo/src/Streams/FileReader.php
  40. +122 βˆ’0 includes/vendor/pomo/pomo/src/Streams/Reader.php
  41. +63 βˆ’0 includes/vendor/pomo/pomo/src/Streams/StringReader.php
  42. +91 βˆ’0 includes/vendor/pomo/pomo/src/Translations/EntryTranslations.php
  43. +127 βˆ’0 includes/vendor/pomo/pomo/src/Translations/GettextTranslations.php
  44. +104 βˆ’0 includes/vendor/pomo/pomo/src/Translations/NOOPTranslations.php
  45. +173 βˆ’0 includes/vendor/pomo/pomo/src/Translations/Translations.php
  46. +96 βˆ’0 includes/vendor/pomo/pomo/src/Translations/TranslationsInterface.php
  47. 0 includes/{Requests β†’ vendor/rmccue/requests}/README.md
  48. +23 βˆ’0 includes/vendor/rmccue/requests/composer.json
  49. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests.php
  50. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Auth.php
  51. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Auth/Basic.php
  52. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Cookie.php
  53. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Cookie/Jar.php
  54. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception.php
  55. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP.php
  56. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/304.php
  57. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/305.php
  58. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/306.php
  59. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/400.php
  60. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/401.php
  61. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/402.php
  62. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/403.php
  63. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/404.php
  64. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/405.php
  65. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/406.php
  66. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/407.php
  67. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/408.php
  68. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/409.php
  69. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/410.php
  70. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/411.php
  71. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/412.php
  72. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/413.php
  73. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/414.php
  74. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/415.php
  75. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/416.php
  76. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/417.php
  77. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/418.php
  78. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/428.php
  79. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/429.php
  80. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/431.php
  81. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/500.php
  82. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/501.php
  83. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/502.php
  84. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/503.php
  85. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/504.php
  86. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/505.php
  87. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/511.php
  88. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/HTTP/Unknown.php
  89. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/Transport.php
  90. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Exception/Transport/cURL.php
  91. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Hooker.php
  92. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Hooks.php
  93. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/IDNAEncoder.php
  94. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/IPv6.php
  95. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/IRI.php
  96. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Proxy.php
  97. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Proxy/HTTP.php
  98. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Response.php
  99. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Response/Headers.php
  100. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/SSL.php
  101. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Session.php
  102. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Transport.php
  103. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Transport/cURL.php
  104. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Transport/cacert.pem
  105. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Transport/fsockopen.php
  106. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Utility/CaseInsensitiveDictionary.php
  107. 0 includes/{Requests β†’ vendor/rmccue/requests/library}/Requests/Utility/FilteredIterator.php
  108. +2 βˆ’2 yourls-loader.php
View
@@ -5,7 +5,7 @@
*.php diff=php
# Exclude certain files or directories when generating an archive
-assets/less/ export-ignore
-.travis.yml export-ignore
-composer.json
-.git* export-ignore
+assets/less/ export-ignore
+.travis.yml export-ignore
+/.git* export-ignore
+/*.md export-ignore
View
@@ -1,10 +1,18 @@
{
- "name": "yourls/yourls",
- "description": "Your Own URL Shortener",
- "keywords": ["shortener", "url shortener", "short url", "url", "bitly"],
- "homepage": "http://yourls.org",
- "license": "MIT",
- "require": {
- "php": ">=5.3"
- }
+ "name": "yourls/yourls",
+ "description": "Your Own URL Shortener",
+ "keywords": ["shortener", "url shortener", "short url", "url", "bitly"],
+ "homepage": "http://yourls.org",
+ "license": "MIT",
+ "require": {
+ "php": ">=5.3",
+ "ext-pdo": "*",
+ "ozh/bookmarkletgen": "1.2",
+ "ozh/phpass": "1.2.0",
+ "rmccue/Requests" : "1.7",
+ "pomo/pomo" : "1.3.0-beta"
+ },
+ "config": {
+ "vendor-dir": "includes/vendor"
+ }
}
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,5 +0,0 @@
-# Bookmarklet Gen
-
-Convert readable Javascript code into bookmarklet links
-
-Home: https://github.com/ozh/bookmarkletgen
@@ -230,13 +230,9 @@ function yourls_phpass_instance( $iteration = 8, $portable = false ) {
$iteration = yourls_apply_filter( 'phpass_new_instance_iteration', $iteration );
$portable = yourls_apply_filter( 'phpass_new_instance_portable', $portable );
- if( !class_exists( 'Hautelook\Phpass\PasswordHash' ) ) {
- require_once( YOURLS_INC.'/phpass/PasswordHash.php' );
- }
-
static $instance = false;
if( $instance == false ) {
- $instance = new Hautelook\Phpass\PasswordHash( $iteration, $portable );
+ $instance = new \Ozh\Phpass\PasswordHash( $iteration, $portable );
}
return $instance;
@@ -223,46 +223,5 @@ function yourls_mb_strlen( $str, $encoding = null ) {
return --$count;
}
-/**
- * hash_equals compatibility function. Stolen from Code Igniter
- *
- * Source: https://github.com/bcit-ci/CodeIgniter/blob/3.1.4/system/core/compat/hash.php
- * For PHP < 5.6
- *
- * @since 1.7.2
- */
-if ( ! function_exists('hash_equals'))
-{
- /**
- * hash_equals()
- *
- * @link http://php.net/hash_equals
- * @param string $known_string
- * @param string $user_string
- * @return bool
- */
- function hash_equals($known_string, $user_string)
- {
- if ( ! is_string($known_string))
- {
- trigger_error('hash_equals(): Expected known_string to be a string, '.strtolower(gettype($known_string)).' given', E_USER_WARNING);
- return FALSE;
- }
- elseif ( ! is_string($user_string))
- {
- trigger_error('hash_equals(): Expected user_string to be a string, '.strtolower(gettype($user_string)).' given', E_USER_WARNING);
- return FALSE;
- }
- elseif (($length = strlen($known_string)) !== strlen($user_string))
- {
- return FALSE;
- }
- $diff = 0;
- for ($i = 0; $i < $length; $i++)
- {
- $diff |= ord($known_string[$i]) ^ ord($user_string[$i]);
- }
- return ($diff === 0);
- }
-}
+
@@ -763,10 +763,6 @@ function yourls_rawurldecode_while_encoded( $string ) {
* @return string Bookmarklet link
*/
function yourls_make_bookmarklet( $code ) {
- if ( !class_exists( 'BookmarkletGen', false ) ) {
- require_once YOURLS_INC . '/BookmarkletGen/BookmarkletGen.php';
- }
-
- $book = new BookmarkletGen;
+ $book = new \Ozh\Bookmarkletgen\Bookmarkletgen;
return $book->crunch( $code );
}
@@ -224,18 +224,15 @@ function yourls_http_request( $type, $url, $headers, $data, $options ) {
}
/**
- * Check if Requests class is defined, include Requests library if need be
+ * Include Requests library if need be
*
- * All HTTP functions should perform that check prior to any operation. This is to avoid
- * include()-ing all the Requests files on every YOURLS instance disregarding whether needed or not.
+ * This is to avoid include()-ing all the Requests files on every YOURLS instance
+ * disregarding whether needed or not.
*
* @since 1.7
*/
function yourls_http_load_library() {
- if ( !class_exists( 'Requests', false ) ) {
- require_once __DIR__ . '/Requests/Requests.php';
- Requests::register_autoloader();
- }
+ Requests::register_autoloader();
}
/**
@@ -12,8 +12,8 @@
/**
* Load POMO files required to run library
*/
-require_once __DIR__ . '/pomo/mo.php';
-require_once __DIR__ . '/pomo/translations.php';
+use \POMO\MO;
+use POMO\Translations\NOOPTranslations;
/**
* Gets the current locale.
@@ -522,7 +522,7 @@ function yourls_load_default_textdomain() {
function yourls_get_translations_for_domain( $domain ) {
global $yourls_l10n;
if ( !isset( $yourls_l10n[$domain] ) ) {
- $yourls_l10n[$domain] = new NOOP_Translations;
+ $yourls_l10n[$domain] = new NOOPTranslations;
}
return $yourls_l10n[$domain];
}
View
@@ -100,6 +100,9 @@
error_reporting( E_ERROR | E_PARSE );
}
+// Load 3rd party libraries
+require_once YOURLS_INC. '/vendor/autoload.php';
+
// Include all functions
require_once( YOURLS_INC.'/version.php' );
require_once( YOURLS_INC.'/functions.php');
@@ -1,6 +0,0 @@
-phpass
-======
-
-**phpass** (pronounced "pH pass") is a portable public domain password hashing framework
-
-https://github.com/hautelook/phpass
Oops, something went wrong.

0 comments on commit a755711

Please sign in to comment.