@{date:Y/m}
.",
+ true,
+ 'mcloud-no-upload-path',
+ 365
+ );
+ }
+
+ }
TaskManager::registerTask( CleanUploadsTask::class );
TaskManager::registerTask( DeleteUploadsTask::class );
foreach ( $this->toolInfo['compatibleImageOptimizers'] as $key => $plugin ) {
@@ -1267,6 +1283,9 @@ private function fixOffloadS3Meta( $postId, $meta )
public function addAttachment( $post_id )
{
$file = get_post_meta( $post_id, '_wp_attached_file', true );
+ if ( !isset( $this->uploadedDocs[$file] ) ) {
+ $file = '/' . $file;
+ }
if ( isset( $this->uploadedDocs[$file] ) ) {
add_post_meta( $post_id, 'ilab_s3_info', $this->uploadedDocs[$file] );
@@ -1276,6 +1295,11 @@ public function addAttachment( $post_id )
$file,
$this->uploadedDocs[$file]
);
+ } else {
+ Logger::info( "addAttachment - Missing '{$file}' key on uploadeDocs." );
+ $keys = array_keys( $this->uploadedDocs );
+ $keyList = implode( ' , ', $keys );
+ Logger::info( 'addAttachment - Have keys: ' . $keyList );
}
}
@@ -2588,19 +2612,7 @@ private function replaceImageInContent( $id, $data, $content )
public function attachmentIdFromURL( $postId, $url )
{
- if ( !empty($postId) ) {
- return $postId;
- }
- global $wpdb ;
- $parsedUrl = parse_url( $url );
- $path = ltrim( $parsedUrl['path'], '/' );
- if ( strpos( $path, $this->client()->bucket() ) === 0 ) {
- $path = ltrim( str_replace( $this->client()->bucket(), '', $path ), '/' );
- }
- $path = apply_filters( 'media-cloud/glide/clean-path', $path );
- $query = $wpdb->prepare( "select ID from {$wpdb->posts} where post_type='attachment' and guid like %s order by ID desc limit 1", '%' . $path );
- $postId = $wpdb->get_var( $query );
- return $postId;
+ return StoragePostMap::attachmentIdFromURL( $postId, $url, $this->client()->bucket() );
}
//endregion
diff --git a/classes/Utilities/Misc/Symfony/Component/Config/ConfigCache.php b/classes/Utilities/Misc/Symfony/Component/Config/ConfigCache.php
new file mode 100755
index 00000000..beea9642
--- /dev/null
+++ b/classes/Utilities/Misc/Symfony/Component/Config/ConfigCache.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config;
+
+use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\SelfCheckingResourceChecker;
+/**
+ * ConfigCache caches arbitrary content in files on disk.
+ *
+ * When in debug mode, those metadata resources that implement
+ * \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will
+ * be used to check cache freshness.
+ *
+ * @author Fabien Potencier
+ */
+class ComposerResource implements \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\SelfCheckingResourceInterface, \Serializable
+{
+ private $vendors;
+ private static $runtimeVendors;
+ public function __construct()
+ {
+ self::refresh();
+ $this->vendors = self::$runtimeVendors;
+ }
+ public function getVendors()
+ {
+ return \array_keys($this->vendors);
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function __toString()
+ {
+ return __CLASS__;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function isFresh($timestamp)
+ {
+ self::refresh();
+ return \array_values(self::$runtimeVendors) === \array_values($this->vendors);
+ }
+ /**
+ * @internal
+ */
+ public function serialize()
+ {
+ return \serialize($this->vendors);
+ }
+ /**
+ * @internal
+ */
+ public function unserialize($serialized)
+ {
+ $this->vendors = \unserialize($serialized);
+ }
+ private static function refresh()
+ {
+ self::$runtimeVendors = [];
+ foreach (\get_declared_classes() as $class) {
+ if ('C' === $class[0] && 0 === \strpos($class, 'ComposerAutoloaderInit')) {
+ $r = new \ReflectionClass($class);
+ $v = \dirname(\dirname($r->getFileName()));
+ if (\file_exists($v . '/composer/installed.json')) {
+ self::$runtimeVendors[$v] = @\filemtime($v . '/composer/installed.json');
+ }
+ }
+ }
+ }
+}
diff --git a/classes/Utilities/Misc/Symfony/Component/Config/Resource/DirectoryResource.php b/classes/Utilities/Misc/Symfony/Component/Config/Resource/DirectoryResource.php
new file mode 100755
index 00000000..4c5854e6
--- /dev/null
+++ b/classes/Utilities/Misc/Symfony/Component/Config/Resource/DirectoryResource.php
@@ -0,0 +1,107 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource;
+
+/**
+ * DirectoryResource represents a resources stored in a subdirectory tree.
+ *
+ * @author Fabien Potencier
+ */
+class GlobResource implements \IteratorAggregate, \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\SelfCheckingResourceInterface, \Serializable
+{
+ private $prefix;
+ private $pattern;
+ private $recursive;
+ private $hash;
+ /**
+ * @param string $prefix A directory prefix
+ * @param string $pattern A glob pattern
+ * @param bool $recursive Whether directories should be scanned recursively or not
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function __construct($prefix, $pattern, $recursive)
+ {
+ $this->prefix = \realpath($prefix) ?: (\file_exists($prefix) ? $prefix : \false);
+ $this->pattern = $pattern;
+ $this->recursive = $recursive;
+ if (\false === $this->prefix) {
+ throw new \InvalidArgumentException(\sprintf('The path "%s" does not exist.', $prefix));
+ }
+ }
+ public function getPrefix()
+ {
+ return $this->prefix;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function __toString()
+ {
+ return 'glob.' . $this->prefix . $this->pattern . (int) $this->recursive;
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function isFresh($timestamp)
+ {
+ $hash = $this->computeHash();
+ if (null === $this->hash) {
+ $this->hash = $hash;
+ }
+ return $this->hash === $hash;
+ }
+ /**
+ * @internal
+ */
+ public function serialize()
+ {
+ if (null === $this->hash) {
+ $this->hash = $this->computeHash();
+ }
+ return \serialize([$this->prefix, $this->pattern, $this->recursive, $this->hash]);
+ }
+ /**
+ * @internal
+ */
+ public function unserialize($serialized)
+ {
+ list($this->prefix, $this->pattern, $this->recursive, $this->hash) = \unserialize($serialized);
+ }
+ public function getIterator()
+ {
+ if (!\file_exists($this->prefix) || !$this->recursive && '' === $this->pattern) {
+ return;
+ }
+ if (0 !== \strpos($this->prefix, 'phar://') && \false === \strpos($this->pattern, '/**/') && (\defined('GLOB_BRACE') || \false === \strpos($this->pattern, '{'))) {
+ $paths = \glob($this->prefix . $this->pattern, \GLOB_NOSORT | (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0));
+ \sort($paths);
+ foreach ($paths as $path) {
+ if ($this->recursive && \is_dir($path)) {
+ $files = \iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveCallbackFilterIterator(new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), function (\SplFileInfo $file) {
+ return '.' !== $file->getBasename()[0];
+ }), \RecursiveIteratorIterator::LEAVES_ONLY));
+ \uasort($files, function (\SplFileInfo $a, \SplFileInfo $b) {
+ return (string) $a > (string) $b ? 1 : -1;
+ });
+ foreach ($files as $path => $info) {
+ if ($info->isFile()) {
+ (yield $path => $info);
+ }
+ }
+ } elseif (\is_file($path)) {
+ (yield $path => new \SplFileInfo($path));
+ }
+ }
+ return;
+ }
+ if (!\class_exists(\ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Finder\Finder::class)) {
+ throw new \LogicException(\sprintf('Extended glob pattern "%s" cannot be used as the Finder component is not installed.', $this->pattern));
+ }
+ $finder = new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Finder\Finder();
+ $regex = \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Finder\Glob::toRegex($this->pattern);
+ if ($this->recursive) {
+ $regex = \substr_replace($regex, '(/|$)', -2, 1);
+ }
+ $prefixLen = \strlen($this->prefix);
+ foreach ($finder->followLinks()->sortByName()->in($this->prefix) as $path => $info) {
+ if (\preg_match($regex, \substr('\\' === \DIRECTORY_SEPARATOR ? \str_replace('\\', '/', $path) : $path, $prefixLen)) && $info->isFile()) {
+ (yield $path => $info);
+ }
+ }
+ }
+ private function computeHash()
+ {
+ $hash = \hash_init('md5');
+ foreach ($this->getIterator() as $path => $info) {
+ \hash_update($hash, $path . "\n");
+ }
+ return \hash_final($hash);
+ }
+}
diff --git a/classes/Utilities/Misc/Symfony/Component/Config/Resource/ReflectionClassResource.php b/classes/Utilities/Misc/Symfony/Component/Config/Resource/ReflectionClassResource.php
new file mode 100755
index 00000000..45ca6f98
--- /dev/null
+++ b/classes/Utilities/Misc/Symfony/Component/Config/Resource/ReflectionClassResource.php
@@ -0,0 +1,204 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource;
+
+use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
+use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\EventDispatcher\EventSubscriberInterface;
+/**
+ * @author Nicolas Grekas
+ */
+class ReflectionClassResource implements \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\SelfCheckingResourceInterface, \Serializable
+{
+ private $files = [];
+ private $className;
+ private $classReflector;
+ private $excludedVendors = [];
+ private $hash;
+ public function __construct(\ReflectionClass $classReflector, $excludedVendors = [])
+ {
+ $this->className = $classReflector->name;
+ $this->classReflector = $classReflector;
+ $this->excludedVendors = $excludedVendors;
+ }
+ public function isFresh($timestamp)
+ {
+ if (null === $this->hash) {
+ $this->hash = $this->computeHash();
+ $this->loadFiles($this->classReflector);
+ }
+ foreach ($this->files as $file => $v) {
+ if (\false === ($filemtime = @\filemtime($file))) {
+ return \false;
+ }
+ if ($filemtime > $timestamp) {
+ return $this->hash === $this->computeHash();
+ }
+ }
+ return \true;
+ }
+ public function __toString()
+ {
+ return 'reflection.' . $this->className;
+ }
+ /**
+ * @internal
+ */
+ public function serialize()
+ {
+ if (null === $this->hash) {
+ $this->hash = $this->computeHash();
+ $this->loadFiles($this->classReflector);
+ }
+ return \serialize([$this->files, $this->className, $this->hash]);
+ }
+ /**
+ * @internal
+ */
+ public function unserialize($serialized)
+ {
+ list($this->files, $this->className, $this->hash) = \unserialize($serialized);
+ }
+ private function loadFiles(\ReflectionClass $class)
+ {
+ foreach ($class->getInterfaces() as $v) {
+ $this->loadFiles($v);
+ }
+ do {
+ $file = $class->getFileName();
+ if (\false !== $file && \file_exists($file)) {
+ foreach ($this->excludedVendors as $vendor) {
+ if (0 === \strpos($file, $vendor) && \false !== \strpbrk(\substr($file, \strlen($vendor), 1), '/' . \DIRECTORY_SEPARATOR)) {
+ $file = \false;
+ break;
+ }
+ }
+ if ($file) {
+ $this->files[$file] = null;
+ }
+ }
+ foreach ($class->getTraits() as $v) {
+ $this->loadFiles($v);
+ }
+ } while ($class = $class->getParentClass());
+ }
+ private function computeHash()
+ {
+ if (null === $this->classReflector) {
+ try {
+ $this->classReflector = new \ReflectionClass($this->className);
+ } catch (\ReflectionException $e) {
+ // the class does not exist anymore
+ return \false;
+ }
+ }
+ $hash = \hash_init('md5');
+ foreach ($this->generateSignature($this->classReflector) as $info) {
+ \hash_update($hash, $info);
+ }
+ return \hash_final($hash);
+ }
+ private function generateSignature(\ReflectionClass $class)
+ {
+ (yield $class->getDocComment());
+ (yield (int) $class->isFinal());
+ (yield (int) $class->isAbstract());
+ if ($class->isTrait()) {
+ (yield \print_r(\class_uses($class->name), \true));
+ } else {
+ (yield \print_r(\class_parents($class->name), \true));
+ (yield \print_r(\class_implements($class->name), \true));
+ (yield \print_r($class->getConstants(), \true));
+ }
+ if (!$class->isInterface()) {
+ $defaults = $class->getDefaultProperties();
+ foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
+ (yield $p->getDocComment() . $p);
+ (yield \print_r(isset($defaults[$p->name]) && !\is_object($defaults[$p->name]) ? $defaults[$p->name] : null, \true));
+ }
+ }
+ if (\defined('HHVM_VERSION')) {
+ foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
+ // workaround HHVM bug with variadics, see https://github.com/facebook/hhvm/issues/5762
+ (yield \preg_replace('/^ @@.*/m', '', new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\ReflectionMethodHhvmWrapper($m->class, $m->name)));
+ }
+ } else {
+ foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
+ $defaults = [];
+ $parametersWithUndefinedConstants = [];
+ foreach ($m->getParameters() as $p) {
+ if (!$p->isDefaultValueAvailable()) {
+ $defaults[$p->name] = null;
+ continue;
+ }
+ if (!$p->isDefaultValueConstant() || \defined($p->getDefaultValueConstantName())) {
+ $defaults[$p->name] = $p->getDefaultValue();
+ continue;
+ }
+ $defaults[$p->name] = $p->getDefaultValueConstantName();
+ $parametersWithUndefinedConstants[$p->name] = \true;
+ }
+ if (!$parametersWithUndefinedConstants) {
+ (yield \preg_replace('/^ @@.*/m', '', $m));
+ } else {
+ $stack = [$m->getDocComment(), $m->getName(), $m->isAbstract(), $m->isFinal(), $m->isStatic(), $m->isPublic(), $m->isPrivate(), $m->isProtected(), $m->returnsReference(), \PHP_VERSION_ID >= 70000 && $m->hasReturnType() ? \PHP_VERSION_ID >= 70100 ? $m->getReturnType()->getName() : (string) $m->getReturnType() : ''];
+ foreach ($m->getParameters() as $p) {
+ if (!isset($parametersWithUndefinedConstants[$p->name])) {
+ $stack[] = (string) $p;
+ } else {
+ $stack[] = $p->isOptional();
+ $stack[] = \PHP_VERSION_ID >= 70000 && $p->hasType() ? \PHP_VERSION_ID >= 70100 ? $p->getType()->getName() : (string) $p->getType() : '';
+ $stack[] = $p->isPassedByReference();
+ $stack[] = \PHP_VERSION_ID >= 50600 ? $p->isVariadic() : '';
+ $stack[] = $p->getName();
+ }
+ }
+ (yield \implode(',', $stack));
+ }
+ (yield \print_r($defaults, \true));
+ }
+ }
+ if ($class->isAbstract() || $class->isInterface() || $class->isTrait()) {
+ return;
+ }
+ if (\interface_exists(\ILAB\MediaCloud\Utilities\Misc\Symfony\Component\EventDispatcher\EventSubscriberInterface::class, \false) && $class->isSubclassOf(\ILAB\MediaCloud\Utilities\Misc\Symfony\Component\EventDispatcher\EventSubscriberInterface::class)) {
+ (yield \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\EventDispatcher\EventSubscriberInterface::class);
+ (yield \print_r(\call_user_func([$class->name, 'getSubscribedEvents']), \true));
+ }
+ if (\interface_exists(\ILAB\MediaCloud\Utilities\Misc\Symfony\Component\DependencyInjection\ServiceSubscriberInterface::class, \false) && $class->isSubclassOf(\ILAB\MediaCloud\Utilities\Misc\Symfony\Component\DependencyInjection\ServiceSubscriberInterface::class)) {
+ (yield \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\DependencyInjection\ServiceSubscriberInterface::class);
+ (yield \print_r(\call_user_func([$class->name, 'getSubscribedServices']), \true));
+ }
+ }
+}
+/**
+ * @internal
+ */
+class ReflectionMethodHhvmWrapper extends \ReflectionMethod
+{
+ public function getParameters()
+ {
+ $params = [];
+ foreach (parent::getParameters() as $i => $p) {
+ $params[] = new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource\ReflectionParameterHhvmWrapper([$this->class, $this->name], $i);
+ }
+ return $params;
+ }
+}
+/**
+ * @internal
+ */
+class ReflectionParameterHhvmWrapper extends \ReflectionParameter
+{
+ public function getDefaultValue()
+ {
+ return [$this->isVariadic(), $this->isDefaultValueAvailable() ? parent::getDefaultValue() : null];
+ }
+}
diff --git a/classes/Utilities/Misc/Symfony/Component/Config/Resource/ResourceInterface.php b/classes/Utilities/Misc/Symfony/Component/Config/Resource/ResourceInterface.php
new file mode 100755
index 00000000..5a83be99
--- /dev/null
+++ b/classes/Utilities/Misc/Symfony/Component/Config/Resource/ResourceInterface.php
@@ -0,0 +1,32 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Config\Resource;
+
+/**
+ * ResourceInterface is the interface that must be implemented by all Resource classes.
+ *
+ * @author Fabien Potencier
+ *
+ * @deprecated since version 3.4, to be removed in 4.0. Use Symfony\Component\Lock\Store\SemaphoreStore or Symfony\Component\Lock\Store\FlockStore instead.
+ */
+class LockHandler
+{
+ private $file;
+ private $handle;
+ /**
+ * @param string $name The lock name
+ * @param string|null $lockPath The directory to store the lock. Default values will use temporary directory
+ *
+ * @throws IOException If the lock directory could not be created or is not writable
+ */
+ public function __construct($name, $lockPath = null)
+ {
+ $lockPath = $lockPath ?: \sys_get_temp_dir();
+ if (!\is_dir($lockPath)) {
+ $fs = new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Filesystem\Filesystem();
+ $fs->mkdir($lockPath);
+ }
+ if (!\is_writable($lockPath)) {
+ throw new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Filesystem\Exception\IOException(\sprintf('The directory "%s" is not writable.', $lockPath), 0, null, $lockPath);
+ }
+ $this->file = \sprintf('%s/sf.%s.%s.lock', $lockPath, \preg_replace('/[^a-z0-9\\._-]+/i', '-', $name), \hash('sha256', $name));
+ }
+ /**
+ * Lock the resource.
+ *
+ * @param bool $blocking Wait until the lock is released
+ *
+ * @return bool Returns true if the lock was acquired, false otherwise
+ *
+ * @throws IOException If the lock file could not be created or opened
+ */
+ public function lock($blocking = \false)
+ {
+ if ($this->handle) {
+ return \true;
+ }
+ $error = null;
+ // Silence error reporting
+ \set_error_handler(function ($errno, $msg) use(&$error) {
+ $error = $msg;
+ });
+ if (!($this->handle = \fopen($this->file, 'r+') ?: \fopen($this->file, 'r'))) {
+ if ($this->handle = \fopen($this->file, 'x')) {
+ \chmod($this->file, 0666);
+ } elseif (!($this->handle = \fopen($this->file, 'r+') ?: \fopen($this->file, 'r'))) {
+ \usleep(100);
+ // Give some time for chmod() to complete
+ $this->handle = \fopen($this->file, 'r+') ?: \fopen($this->file, 'r');
+ }
+ }
+ \restore_error_handler();
+ if (!$this->handle) {
+ throw new \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Filesystem\Exception\IOException($error, 0, null, $this->file);
+ }
+ // On Windows, even if PHP doc says the contrary, LOCK_NB works, see
+ // https://bugs.php.net/54129
+ if (!\flock($this->handle, \LOCK_EX | ($blocking ? 0 : \LOCK_NB))) {
+ \fclose($this->handle);
+ $this->handle = null;
+ return \false;
+ }
+ return \true;
+ }
+ /**
+ * Release the resource.
+ */
+ public function release()
+ {
+ if ($this->handle) {
+ \flock($this->handle, \LOCK_UN | \LOCK_NB);
+ \fclose($this->handle);
+ $this->handle = null;
+ }
+ }
+}
diff --git a/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/MergeOperation.php b/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/MergeOperation.php
index e769816e..9f0440d5 100755
--- a/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/MergeOperation.php
+++ b/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/MergeOperation.php
@@ -10,7 +10,6 @@
*/
namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\Catalogue;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\MessageCatalogueInterface;
/**
* Merge operation between two catalogues as follows:
* all = source ∪ target = {x: x ∈ source ∨ x ∈ target}
@@ -28,10 +27,9 @@ class MergeOperation extends \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\T
protected function processDomain($domain)
{
$this->messages[$domain] = ['all' => [], 'new' => [], 'obsolete' => []];
- $intlDomain = $domain . \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
foreach ($this->source->all($domain) as $id => $message) {
$this->messages[$domain]['all'][$id] = $message;
- $this->result->add([$id => $message], $this->source->defines($id, $intlDomain) ? $intlDomain : $domain);
+ $this->result->add([$id => $message], $domain);
if (null !== ($keyMetadata = $this->source->getMetadata($id, $domain))) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
@@ -40,7 +38,7 @@ protected function processDomain($domain)
if (!$this->source->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
$this->messages[$domain]['new'][$id] = $message;
- $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
+ $this->result->add([$id => $message], $domain);
if (null !== ($keyMetadata = $this->target->getMetadata($id, $domain))) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
diff --git a/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/TargetOperation.php b/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/TargetOperation.php
index 7a2b9806..6474c92c 100755
--- a/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/TargetOperation.php
+++ b/classes/Utilities/Misc/Symfony/Component/Translation/Catalogue/TargetOperation.php
@@ -10,7 +10,6 @@
*/
namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\Catalogue;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\MessageCatalogueInterface;
/**
* Target operation between two catalogues:
* intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target}
@@ -29,7 +28,6 @@ class TargetOperation extends \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\
protected function processDomain($domain)
{
$this->messages[$domain] = ['all' => [], 'new' => [], 'obsolete' => []];
- $intlDomain = $domain . \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\MessageCatalogueInterface::INTL_DOMAIN_SUFFIX;
// For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``,
// because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback}
//
@@ -41,7 +39,7 @@ protected function processDomain($domain)
foreach ($this->source->all($domain) as $id => $message) {
if ($this->target->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
- $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
+ $this->result->add([$id => $message], $domain);
if (null !== ($keyMetadata = $this->source->getMetadata($id, $domain))) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
@@ -53,7 +51,7 @@ protected function processDomain($domain)
if (!$this->source->has($id, $domain)) {
$this->messages[$domain]['all'][$id] = $message;
$this->messages[$domain]['new'][$id] = $message;
- $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
+ $this->result->add([$id => $message], $domain);
if (null !== ($keyMetadata = $this->target->getMetadata($id, $domain))) {
$this->result->setMetadata($id, $keyMetadata, $domain);
}
diff --git a/classes/Utilities/Misc/Symfony/Component/Translation/Command/XliffLintCommand.php b/classes/Utilities/Misc/Symfony/Component/Translation/Command/XliffLintCommand.php
index 0b95e10e..a96ab6d8 100755
--- a/classes/Utilities/Misc/Symfony/Component/Translation/Command/XliffLintCommand.php
+++ b/classes/Utilities/Misc/Symfony/Component/Translation/Command/XliffLintCommand.php
@@ -12,12 +12,10 @@
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Command\Command;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Exception\RuntimeException;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Input\InputArgument;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Input\InputInterface;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Input\InputOption;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Output\OutputInterface;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Style\SymfonyStyle;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\Util\XliffUtils;
/**
* Validates XLIFF files syntax and outputs encountered errors.
*
@@ -32,26 +30,24 @@ class XliffLintCommand extends \ILAB\MediaCloud\Utilities\Misc\Symfony\Component
private $displayCorrectFiles;
private $directoryIteratorProvider;
private $isReadableProvider;
- private $requireStrictFileNames;
- public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = \true)
+ public function __construct($name = null, $directoryIteratorProvider = null, $isReadableProvider = null)
{
parent::__construct($name);
$this->directoryIteratorProvider = $directoryIteratorProvider;
$this->isReadableProvider = $isReadableProvider;
- $this->requireStrictFileNames = $requireStrictFileNames;
}
/**
* {@inheritdoc}
*/
protected function configure()
{
- $this->setDescription('Lints a XLIFF file and outputs encountered errors')->addArgument('filename', \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Input\InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')->addOption('format', null, \ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Console\Input\InputOption::VALUE_REQUIRED, 'The output format', 'txt')->setHelp(<<
- */
-interface IntlFormatterInterface
-{
- /**
- * Formats a localized message using rules defined by ICU MessageFormat.
- *
- * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html#details
- */
- public function formatIntl(string $message, string $locale, array $parameters = []) : string;
-}
diff --git a/classes/Utilities/Misc/Symfony/Component/Translation/Formatter/MessageFormatter.php b/classes/Utilities/Misc/Symfony/Component/Translation/Formatter/MessageFormatter.php
index 3595236c..a7e1565c 100755
--- a/classes/Utilities/Misc/Symfony/Component/Translation/Formatter/MessageFormatter.php
+++ b/classes/Utilities/Misc/Symfony/Component/Translation/Formatter/MessageFormatter.php
@@ -10,59 +10,33 @@
*/
namespace ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\Formatter;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\IdentityTranslator;
use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\MessageSelector;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface;
-use ILAB\MediaCloud\Utilities\Misc\Symfony\Contracts\Translation\TranslatorInterface;
/**
* @author Abdellatif Ait boudad =5?t.readUInt32BE(h+1):void 0};break;case"GEOB":{b=a.default.findZero(t,h+1,p,d);const e=a.default.decodeString(t.slice(h+1,b),c);h=b+1,b=a.default.findZero(t,h,p-h,d);const r=a.default.decodeString(t.slice(h+1,b),c);h=b+1,b=a.default.findZero(t,h,p-h,d),m={type:e,filename:r,description:a.default.decodeString(t.slice(h+1,b),c),data:t.slice(h+1,p)};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":m=a.default.decodeString(t.slice(h,b),d);break;case"WXXX":{b=a.default.findZero(t,h+1,p,d);const e=a.default.decodeString(t.slice(h+1,b),c);h=b+1,m={description:e,url:a.default.decodeString(t.slice(h,p-h),d)};break}case"MCDI":m=t.slice(0,p);break;default:o("Warning: unsupported id3v2-tag-type: "+r)}return m}static fixPictureMimeType(e){switch(e=e.toLocaleLowerCase()){case"jpg":return"image/jpeg";case"png":return"image/png"}return e}static functionList(e){const t={};for(let r=0;r+1wp_post
database table. But, if you are having problems, you can turn it off to restore the previous behavior.",
+ "type" => "checkbox",
+ "default" => true
+ ],
+ ]
+ ],
"ilab-media-cloud-display-settings" => [
"title" => "Display Settings",
"doc_link" => 'https://kb.mediacloud.press/articles/documentation/cloud-storage/media-library-integration',
diff --git a/ilab-media-tools.php b/ilab-media-tools.php
index 0dbb187f..a8b874f5 100755
--- a/ilab-media-tools.php
+++ b/ilab-media-tools.php
@@ -5,7 +5,7 @@
Plugin URI: https://github.com/interfacelab/ilab-media-tools
Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows.
Author: interfacelab
-Version: 3.3.11
+Version: 3.3.12
Author URI: http://interfacelab.io
*/
// Copyright (c) 2016 Interfacelab LLC. All rights reserved.
@@ -93,7 +93,7 @@
}
// Version Defines
-define( 'MEDIA_CLOUD_VERSION', '3.3.11' );
+define( 'MEDIA_CLOUD_VERSION', '3.3.12' );
define( 'MEDIA_CLOUD_INFO_VERSION', '1.0.0' );
// Directory defines
define( 'ILAB_TOOLS_DIR', dirname( __FILE__ ) );
diff --git a/public/js/ilab-media-direct-upload.js b/public/js/ilab-media-direct-upload.js
index 8bda1cc8..1b7d9250 100755
--- a/public/js/ilab-media-direct-upload.js
+++ b/public/js/ilab-media-direct-upload.js
@@ -1 +1 @@
-!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=185)}([,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6),i=(e,t,r,n)=>{if(t+r>e.length){if("function"!=typeof n)throw new Error("Buffer out of space and no valid flush() function found");return n(e,t),0}return t};t.UINT8={len:1,get:(e,t)=>e.readUInt8(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=255),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUInt8(r,s),s-t+this.len}},t.UINT16_LE={len:2,get:(e,t)=>e.readUInt16LE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=65535),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUInt16LE(r,s),s-t+this.len}},t.UINT16_BE={len:2,get:(e,t)=>e.readUInt16BE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=65535),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUInt16BE(r,s),s-t+this.len}},t.UINT24_LE={len:3,get:(e,t)=>e.readUIntLE(t,3),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=16777215),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUIntLE(r,s,3),s-t+this.len}},t.UINT24_BE={len:3,get:(e,t)=>e.readUIntBE(t,3),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=16777215),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUIntBE(r,s,3),s-t+this.len}},t.UINT32_LE={len:4,get:(e,t)=>e.readUInt32LE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=4294967295),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUInt32LE(r,s),s-t+this.len}},t.UINT32_BE={len:4,get:(e,t)=>e.readUInt32BE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=0&&r<=4294967295),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeUInt32BE(r,s),s-t+this.len}},t.INT8={len:1,get:(e,t)=>e.readInt8(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-128&&r<=127),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeInt8(r,s),s-t+this.len}},t.INT16_BE={len:2,get:(e,t)=>e.readInt16BE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-32768&&r<=32767),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeInt16BE(r,s),s-t+this.len}},t.INT16_LE={len:2,get:(e,t)=>e.readInt16LE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-32768&&r<=32767),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeInt16LE(r,s),s-t+this.len}},t.INT24_LE={len:3,get:(e,t)=>e.readIntLE(t,3),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-8388608&&r<=8388607),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeIntLE(r,s,3),s-t+this.len}},t.INT24_BE={len:3,get:(e,t)=>e.readIntBE(t,3),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-8388608&&r<=8388607),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeIntBE(r,s,3),s-t+this.len}},t.INT32_BE={len:4,get:(e,t)=>e.readInt32BE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-2147483648&&r<=2147483647),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeInt32BE(r,s),s-t+this.len}},t.INT32_LE={len:4,get:(e,t)=>e.readInt32LE(t),put(e,t,r,a){n.equal(typeof t,"number"),n.equal(typeof r,"number"),n.ok(r>=-2147483648&&r<=2147483647),n.ok(t>=0),n.ok(this.len<=e.length);const s=i(e,t,this.len,a);return e.writeInt32LE(r,s),s-t+this.len}},t.UINT64_LE={len:8,get(e,t){return function(e,t,r){r>>>=0;let n=e[t>>>=0],i=1,a=0;for(;++a