mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Namespacing, reusing
This commit is contained in:
parent
c3e055549e
commit
f46b434a12
2 changed files with 11 additions and 4 deletions
|
|
@ -68,6 +68,9 @@ class Storage {
|
|||
//until the end one version per week
|
||||
6 => array('intervalEndsAfter' => -1, 'step' => 604800),
|
||||
);
|
||||
|
||||
/** @var \OCA\Files_Versions\AppInfo\Application */
|
||||
private static $application;
|
||||
|
||||
public static function getUidAndFilename($filename) {
|
||||
$uid = \OC\Files\Filesystem::getOwner($filename);
|
||||
|
|
@ -709,8 +712,10 @@ class Storage {
|
|||
* @return Expiration
|
||||
*/
|
||||
protected static function getExpiration(){
|
||||
$application = new Application();
|
||||
return $application->getContainer()->query('Expiration');
|
||||
if (is_null(self::$application)) {
|
||||
self::$application = new Application();
|
||||
}
|
||||
return self::$application->getContainer()->query('Expiration');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
namespace OCA\Files_Versions;
|
||||
namespace OCA\Files_Versions\Tests;
|
||||
|
||||
class Expiration_Test extends \PHPUnit_Framework_TestCase {
|
||||
use \OCA\Files_Versions\Expiration;
|
||||
|
||||
class Expiration_Test extends \Test\TestCase {
|
||||
const SECONDS_PER_DAY = 86400; //60*60*24
|
||||
|
||||
public function expirationData(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue