%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/hr/api/vendor/flowjs/flow-php-server/src/Flow/Mongo/
Upload File :
Create Path :
Current File : /var/www/html/hr/api/vendor/flowjs/flow-php-server/src/Flow/Mongo/MongoUploader.php

<?php

namespace Flow\Mongo;

use Flow\FileOpenException;

/**
 * @codeCoverageIgnore
 */
class MongoUploader
{
    /**
     * Delete chunks older than expiration time.
     *
     * @param \MongoGridFS $gridFs
     * @param int $expirationTime seconds
     *
     * @throws FileOpenException
     */
    public static function pruneChunks($gridFs, $expirationTime = 172800)
    {
        $result = $gridFs->remove([
            'flowUpdated' => ['$lt' => new \MongoDate(time() - $expirationTime)],
            'flowStatus' => 'uploading'
        ]);

        if (!$result) {
            throw new FileOpenException("Could not remove chunks!");
        }
    }
}

Zerion Mini Shell 1.0