entries.js 30f7226d9a first commit 2 anni fa entriesIn.js 30f7226d9a first commit 2 anni fa eq.js 30f7226d9a first commit 2 anni fa escape.js 30f7226d9a first commit 2 anni fa escapeRegExp.js 30f7226d9a first commit 2 anni fa every.js 30f7226d9a first commit 2 anni fa extend.js 30f7226d9a first commit 2 anni fa extendWith.js 30f7226d9a first commit 2 anni fa fill.js 30f7226d9a first commit 2 anni fa filter.js 30f7226d9a first commit 2 anni fa find.js 30f7226d9a first commit 2 anni fa findIndex.js 30f7226d9a first commit 2 anni fa findKey.js 30f7226d9a first commit 2 anni fa findLast.js 30f7226d9a first commit 2 anni fa findLastIndex.js 30f7226d9a first commit 2 anni fa findLastKey.js 30f7226d9a first commit 2 anni fa first.js 30f7226d9a first commit 2 anni fa flake.lock 30f7226d9a first commit 2 anni fa flake.nix 30f7226d9a first commit 2 anni fa flatMap.js 30f7226d9a first commit 2 anni fa flatMapDeep.js 30f7226d9a first commit 2 anni fa flatMapDepth.js 30f7226d9a first commit 2 anni fa flatten.js 30f7226d9a first commit 2 anni fa flattenDeep.js 30f7226d9a first commit 2 anni fa flattenDepth.js 30f7226d9a first commit 2 anni fa flip.js 30f7226d9a first commit 2 anni fa floor.js 30f7226d9a first commit 2 anni fa flow.js 30f7226d9a first commit 2 anni fa flowRight.js 30f7226d9a first commit 2 anni fa forEach.js 30f7226d9a first commit 2 anni fa forEachRight.js 30f7226d9a first commit 2 anni fa forIn.js 30f7226d9a first commit 2 anni fa forInRight.js 30f7226d9a first commit 2 anni fa forOwn.js 30f7226d9a first commit 2 anni fa forOwnRight.js 30f7226d9a first commit 2 anni fa fp.js 30f7226d9a first commit 2 anni fa fromPairs.js 30f7226d9a first commit 2 anni fa function.js 30f7226d9a first commit 2 anni fa functions.js 30f7226d9a first commit 2 anni fa functionsIn.js 30f7226d9a first commit 2 anni fa get.js 30f7226d9a first commit 2 anni fa groupBy.js 30f7226d9a first commit 2 anni fa gt.js 30f7226d9a first commit 2 anni fa gte.js 30f7226d9a first commit 2 anni fa has.js 30f7226d9a first commit 2 anni fa hasIn.js 30f7226d9a first commit 2 anni fa head.js 30f7226d9a first commit 2 anni fa identity.js 30f7226d9a first commit 2 anni fa inRange.js 30f7226d9a first commit 2 anni fa includes.js 30f7226d9a first commit 2 anni fa index.js 30f7226d9a first commit 2 anni fa indexOf.js 30f7226d9a first commit 2 anni fa initial.js 30f7226d9a first commit 2 anni fa intersection.js 30f7226d9a first commit 2 anni fa intersectionBy.js 30f7226d9a first commit 2 anni fa intersectionWith.js 30f7226d9a first commit 2 anni fa invert.js 30f7226d9a first commit 2 anni fa invertBy.js 30f7226d9a first commit 2 anni fa invoke.js 30f7226d9a first commit 2 anni fa invokeMap.js 30f7226d9a first commit 2 anni fa isArguments.js 30f7226d9a first commit 2 anni fa isArray.js 30f7226d9a first commit 2 anni fa isArrayBuffer.js 30f7226d9a first commit 2 anni fa isArrayLike.js 30f7226d9a first commit 2 anni fa isArrayLikeObject.js 30f7226d9a first commit 2 anni fa isBoolean.js 30f7226d9a first commit 2 anni fa isBuffer.js 30f7226d9a first commit 2 anni fa isDate.js 30f7226d9a first commit 2 anni fa isElement.js 30f7226d9a first commit 2 anni fa isEmpty.js 30f7226d9a first commit 2 anni fa isEqual.js 30f7226d9a first commit 2 anni fa isEqualWith.js 30f7226d9a first commit 2 anni fa isError.js 30f7226d9a first commit 2 anni fa isFinite.js 30f7226d9a first commit 2 anni fa isFunction.js 30f7226d9a first commit 2 anni fa isInteger.js 30f7226d9a first commit 2 anni fa isLength.js 30f7226d9a first commit 2 anni fa isMap.js 30f7226d9a first commit 2 anni fa isMatch.js 30f7226d9a first commit 2 anni fa isMatchWith.js 30f7226d9a first commit 2 anni fa isNaN.js 30f7226d9a first commit 2 anni fa isNative.js 30f7226d9a first commit 2 anni fa isNil.js 30f7226d9a first commit 2 anni fa isNull.js 30f7226d9a first commit 2 anni fa isNumber.js 30f7226d9a first commit 2 anni fa isObject.js 30f7226d9a first commit 2 anni fa isObjectLike.js 30f7226d9a first commit 2 anni fa isPlainObject.js 30f7226d9a first commit 2 anni fa isRegExp.js 30f7226d9a first commit 2 anni fa isSafeInteger.js 30f7226d9a first commit 2 anni fa isSet.js 30f7226d9a first commit 2 anni fa isString.js 30f7226d9a first commit 2 anni fa isSymbol.js 30f7226d9a first commit 2 anni fa isTypedArray.js 30f7226d9a first commit 2 anni fa isUndefined.js 30f7226d9a first commit 2 anni fa isWeakMap.js 30f7226d9a first commit 2 anni fa isWeakSet.js 30f7226d9a first commit 2 anni fa iteratee.js 30f7226d9a first commit 2 anni fa join.js 30f7226d9a first commit 2 anni fa kebabCase.js 30f7226d9a first commit 2 anni fa keyBy.js 30f7226d9a first commit 2 anni fa keys.js 30f7226d9a first commit 2 anni fa keysIn.js 30f7226d9a first commit 2 anni fa lang.js 30f7226d9a first commit 2 anni fa last.js 30f7226d9a first commit 2 anni fa lastIndexOf.js 30f7226d9a first commit 2 anni fa lodash.js 30f7226d9a first commit 2 anni fa lodash.min.js 30f7226d9a first commit 2 anni fa lowerCase.js 30f7226d9a first commit 2 anni fa lowerFirst.js 30f7226d9a first commit 2 anni fa lt.js 30f7226d9a first commit 2 anni fa lte.js 30f7226d9a first commit 2 anni fa map.js 30f7226d9a first commit 2 anni fa mapKeys.js 30f7226d9a first commit 2 anni fa mapValues.js 30f7226d9a first commit 2 anni fa matches.js 30f7226d9a first commit 2 anni fa matchesProperty.js 30f7226d9a first commit 2 anni fa math.js 30f7226d9a first commit 2 anni fa max.js 30f7226d9a first commit 2 anni fa maxBy.js 30f7226d9a first commit 2 anni fa mean.js 30f7226d9a first commit 2 anni fa meanBy.js 30f7226d9a first commit 2 anni fa memoize.js 30f7226d9a first commit 2 anni fa merge.js 30f7226d9a first commit 2 anni fa mergeWith.js 30f7226d9a first commit 2 anni fa method.js 30f7226d9a first commit 2 anni fa methodOf.js 30f7226d9a first commit 2 anni fa min.js 30f7226d9a first commit 2 anni fa minBy.js 30f7226d9a first commit 2 anni fa mixin.js 30f7226d9a first commit 2 anni fa multiply.js 30f7226d9a first commit 2 anni fa negate.js 30f7226d9a first commit 2 anni fa next.js 30f7226d9a first commit 2 anni fa noop.js 30f7226d9a first commit 2 anni fa now.js 30f7226d9a first commit 2 anni fa nth.js 30f7226d9a first commit 2 anni fa nthArg.js 30f7226d9a first commit 2 anni fa number.js 30f7226d9a first commit 2 anni fa object.js 30f7226d9a first commit 2 anni fa omit.js 30f7226d9a first commit 2 anni fa omitBy.js 30f7226d9a first commit 2 anni fa once.js 30f7226d9a first commit 2 anni fa orderBy.js 30f7226d9a first commit 2 anni fa over.js 30f7226d9a first commit 2 anni fa overArgs.js 30f7226d9a first commit 2 anni fa overEvery.js 30f7226d9a first commit 2 anni fa overSome.js 30f7226d9a first commit 2 anni fa package.json 30f7226d9a first commit 2 anni fa pad.js 30f7226d9a first commit 2 anni fa padEnd.js 30f7226d9a first commit 2 anni fa padStart.js 30f7226d9a first commit 2 anni fa parseInt.js 30f7226d9a first commit 2 anni fa partial.js 30f7226d9a first commit 2 anni fa partialRight.js 30f7226d9a first commit 2 anni fa partition.js 30f7226d9a first commit 2 anni fa pick.js 30f7226d9a first commit 2 anni fa pickBy.js 30f7226d9a first commit 2 anni fa plant.js 30f7226d9a first commit 2 anni fa property.js 30f7226d9a first commit 2 anni fa propertyOf.js 30f7226d9a first commit 2 anni fa pull.js 30f7226d9a first commit 2 anni fa pullAll.js 30f7226d9a first commit 2 anni fa pullAllBy.js 30f7226d9a first commit 2 anni fa pullAllWith.js 30f7226d9a first commit 2 anni fa pullAt.js 30f7226d9a first commit 2 anni fa random.js 30f7226d9a first commit 2 anni fa range.js 30f7226d9a first commit 2 anni fa rangeRight.js 30f7226d9a first commit 2 anni fa rearg.js 30f7226d9a first commit 2 anni fa reduce.js 30f7226d9a first commit 2 anni fa reduceRight.js 30f7226d9a first commit 2 anni fa reject.js 30f7226d9a first commit 2 anni fa release.md 30f7226d9a first commit 2 anni fa remove.js 30f7226d9a first commit 2 anni fa repeat.js 30f7226d9a first commit 2 anni fa replace.js 30f7226d9a first commit 2 anni fa rest.js 30f7226d9a first commit 2 anni fa result.js 30f7226d9a first commit 2 anni fa reverse.js 30f7226d9a first commit 2 anni fa round.js 30f7226d9a first commit 2 anni fa sample.js 30f7226d9a first commit 2 anni fa sampleSize.js 30f7226d9a first commit 2 anni fa seq.js 30f7226d9a first commit 2 anni fa set.js 30f7226d9a first commit 2 anni fa setWith.js 30f7226d9a first commit 2 anni fa shuffle.js 30f7226d9a first commit 2 anni fa size.js 30f7226d9a first commit 2 anni fa slice.js 30f7226d9a first commit 2 anni fa snakeCase.js 30f7226d9a first commit 2 anni fa some.js 30f7226d9a first commit 2 anni fa sortBy.js 30f7226d9a first commit 2 anni fa sortedIndex.js 30f7226d9a first commit 2 anni fa sortedIndexBy.js 30f7226d9a first commit 2 anni fa sortedIndexOf.js 30f7226d9a first commit 2 anni fa sortedLastIndex.js 30f7226d9a first commit 2 anni fa sortedLastIndexBy.js 30f7226d9a first commit 2 anni fa sortedLastIndexOf.js 30f7226d9a first commit 2 anni fa sortedUniq.js 30f7226d9a first commit 2 anni fa sortedUniqBy.js 30f7226d9a first commit 2 anni fa split.js 30f7226d9a first commit 2 anni fa spread.js 30f7226d9a first commit 2 anni fa startCase.js 30f7226d9a first commit 2 anni fa startsWith.js 30f7226d9a first commit 2 anni fa string.js 30f7226d9a first commit 2 anni fa stubArray.js 30f7226d9a first commit 2 anni fa stubFalse.js 30f7226d9a first commit 2 anni fa stubObject.js 30f7226d9a first commit 2 anni fa stubString.js 30f7226d9a first commit 2 anni fa stubTrue.js 30f7226d9a first commit 2 anni fa subtract.js 30f7226d9a first commit 2 anni fa sum.js 30f7226d9a first commit 2 anni fa sumBy.js 30f7226d9a first commit 2 anni fa tail.js 30f7226d9a first commit 2 anni fa take.js 30f7226d9a first commit 2 anni fa takeRight.js 30f7226d9a first commit 2 anni fa takeRightWhile.js 30f7226d9a first commit 2 anni fa takeWhile.js 30f7226d9a first commit 2 anni fa tap.js 30f7226d9a first commit 2 anni fa template.js 30f7226d9a first commit 2 anni fa templateSettings.js 30f7226d9a first commit 2 anni fa throttle.js 30f7226d9a first commit 2 anni fa thru.js 30f7226d9a first commit 2 anni fa times.js 30f7226d9a first commit 2 anni fa toArray.js 30f7226d9a first commit 2 anni fa toFinite.js 30f7226d9a first commit 2 anni fa toInteger.js 30f7226d9a first commit 2 anni fa toIterator.js 30f7226d9a first commit 2 anni fa toJSON.js 30f7226d9a first commit 2 anni fa toLength.js 30f7226d9a first commit 2 anni fa toLower.js 30f7226d9a first commit 2 anni fa toNumber.js 30f7226d9a first commit 2 anni fa toPairs.js 30f7226d9a first commit 2 anni fa toPairsIn.js 30f7226d9a first commit 2 anni fa toPath.js 30f7226d9a first commit 2 anni fa toPlainObject.js 30f7226d9a first commit 2 anni fa toSafeInteger.js 30f7226d9a first commit 2 anni fa toString.js 30f7226d9a first commit 2 anni fa toUpper.js 30f7226d9a first commit 2 anni fa transform.js 30f7226d9a first commit 2 anni fa trim.js 30f7226d9a first commit 2 anni fa trimEnd.js 30f7226d9a first commit 2 anni fa trimStart.js 30f7226d9a first commit 2 anni fa truncate.js 30f7226d9a first commit 2 anni fa unary.js 30f7226d9a first commit 2 anni fa unescape.js 30f7226d9a first commit 2 anni fa union.js 30f7226d9a first commit 2 anni fa unionBy.js 30f7226d9a first commit 2 anni fa unionWith.js 30f7226d9a first commit 2 anni fa uniq.js 30f7226d9a first commit 2 anni fa uniqBy.js 30f7226d9a first commit 2 anni fa uniqWith.js 30f7226d9a first commit 2 anni fa uniqueId.js 30f7226d9a first commit 2 anni fa unset.js 30f7226d9a first commit 2 anni fa unzip.js 30f7226d9a first commit 2 anni fa unzipWith.js 30f7226d9a first commit 2 anni fa update.js 30f7226d9a first commit 2 anni fa updateWith.js 30f7226d9a first commit 2 anni fa upperCase.js 30f7226d9a first commit 2 anni fa upperFirst.js 30f7226d9a first commit 2 anni fa util.js 30f7226d9a first commit 2 anni fa value.js 30f7226d9a first commit 2 anni fa valueOf.js 30f7226d9a first commit 2 anni fa values.js 30f7226d9a first commit 2 anni fa valuesIn.js 30f7226d9a first commit 2 anni fa without.js 30f7226d9a first commit 2 anni fa words.js 30f7226d9a first commit 2 anni fa wrap.js 30f7226d9a first commit 2 anni fa wrapperAt.js 30f7226d9a first commit 2 anni fa wrapperChain.js 30f7226d9a first commit 2 anni fa wrapperLodash.js 30f7226d9a first commit 2 anni fa wrapperReverse.js 30f7226d9a first commit 2 anni fa wrapperValue.js 30f7226d9a first commit 2 anni fa xor.js 30f7226d9a first commit 2 anni fa xorBy.js 30f7226d9a first commit 2 anni fa xorWith.js 30f7226d9a first commit 2 anni fa zip.js 30f7226d9a first commit 2 anni fa zipObject.js 30f7226d9a first commit 2 anni fa zipObjectDeep.js 30f7226d9a first commit 2 anni fa zipWith.js 30f7226d9a first commit 2 anni fa

README.md

lodash v4.17.21

The Lodash library exported as Node.js modules.

Installation

Using npm:

$ npm i -g npm
$ npm i --save lodash

In Node.js:

// Load the full build.
var _ = require('lodash');
// Load the core build.
var _ = require('lodash/core');
// Load the FP build for immutable auto-curried iteratee-first data-last methods.
var fp = require('lodash/fp');

// Load method categories.
var array = require('lodash/array');
var object = require('lodash/fp/object');

// Cherry-pick methods for smaller browserify/rollup/webpack bundles.
var at = require('lodash/at');
var curryN = require('lodash/fp/curryN');

See the package source for more details.

Note:
Install n_ for Lodash use in the Node.js < 6 REPL.

Support

Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
Automated browser & CI test runs are available.

tum/whitesports - Gogs: Simplico Git Service

暫無描述

MetadataCache.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace MailPoet\Doctrine;
  3. if (!defined('ABSPATH')) exit;
  4. use MailPoetVendor\Doctrine\Common\Cache\CacheProvider;
  5. use MailPoetVendor\Doctrine\ORM\Mapping\ClassMetadata as DoctrineClassMetadata;
  6. use MailPoetVendor\Symfony\Component\Validator\Mapping\ClassMetadata as ValidatorClassMetadata;
  7. use ReflectionClass;
  8. use ReflectionException;
  9. // Simple filesystem-based cache storage for Doctrine Metadata.
  10. //
  11. // Needed because Doctrine's FilesystemCache doesn't work read-only (when metadata dumped)
  12. // and it calls realpath() that could fail on some hostings due to filesystem permissions.
  13. class MetadataCache extends CacheProvider {
  14. /** @var bool */
  15. private $isDevMode;
  16. /** @var string */
  17. private $directory;
  18. public function __construct($dir, $isReadOnly) {
  19. $this->isDevMode = defined('WP_DEBUG') && WP_DEBUG && !$isReadOnly;
  20. $this->directory = rtrim($dir, '/\\');
  21. if (!file_exists($this->directory)) {
  22. mkdir($this->directory);
  23. }
  24. }
  25. protected function doFetch($id) {
  26. if (!$this->doContains($id)) {
  27. return false;
  28. }
  29. return unserialize((string)file_get_contents($this->getFilename($id)));
  30. }
  31. protected function doContains($id) {
  32. $filename = $this->getFilename($id);
  33. $fileExists = file_exists($filename);
  34. // in dev mode invalidate cache if source file has changed
  35. if ($fileExists && $this->isDevMode) {
  36. $classMetadata = unserialize((string)file_get_contents($filename));
  37. assert($classMetadata instanceof DoctrineClassMetadata || $classMetadata instanceof ValidatorClassMetadata);
  38. if (!class_exists($classMetadata->name) && !interface_exists($classMetadata->name)) {
  39. return false;
  40. }
  41. try {
  42. $reflection = new ReflectionClass($classMetadata->name);
  43. } catch (ReflectionException $e) {
  44. return false;
  45. }
  46. clearstatcache();
  47. return filemtime((string)$filename) >= filemtime((string)$reflection->getFileName());
  48. }
  49. return $fileExists;
  50. }
  51. protected function doSave($id, $data, $lifeTime = 0) {
  52. $filename = $this->getFilename($id);
  53. $result = @file_put_contents($filename, serialize($data));
  54. if ($result === false) {
  55. throw new \RuntimeException("Error while writing to '$filename'");
  56. }
  57. return true;
  58. }
  59. protected function doDelete($id) {
  60. @unlink($this->getFilename($id));
  61. return true;
  62. }
  63. protected function doFlush() {
  64. $directoryContent = glob($this->directory . DIRECTORY_SEPARATOR . '*');
  65. if ($directoryContent === false) {
  66. return false;
  67. }
  68. foreach ($directoryContent as $filename) {
  69. if (is_file($filename)) {
  70. @unlink($filename);
  71. }
  72. }
  73. return true;
  74. }
  75. protected function doGetStats() {
  76. return null;
  77. }
  78. private function getFilename($id) {
  79. return $this->directory . DIRECTORY_SEPARATOR . md5($id);
  80. }
  81. }
tum/freight - Gogs: Simplico Git Service

1 次代碼提交 (master)

作者 SHA1 備註 提交日期
  tum 9ba4fe2450 firstcommit 4 年之前