Saves the current version of the linked File object in a versions
directory, then returns the relative path to where it is stored.

@return string
972818
protected function saveCurrentVersion()
    {
        // Ensure we re-fetch fresh record from database (in case it was recently renamed / moved)
        $file = File::get()->byID($this->FileID);
        if ($file->ParentID) {
            $base = Controller::join_links(
                $file->Parent()->getFullPath(),
                self::VERSION_FOLDER,
                $this->FileID
            );
        } else {
            $base = Controller::join_links(
                Director::baseFolder(),
                ASSETS_DIR,
                self::VERSION_FOLDER,
                $this->FileID
            );
        }

        Filesystem::makeFolder($base);

        $extension = $file->getExtension();
        $basename  = basename($file->Name, $extension);
        $version   = $this->VersionNumber;

        $cachedPath = Controller::join_links(
            $base, "{$basename}$version.$extension"
        );

        if (!copy($file->getFullPath(), $cachedPath)) {
            throw new Exception(
                "Unable to copy version #$version of file #$this->FileID from:\n \"{$file->getFullPath()}\"\nto:\n\"$cachedPath\""
            );
        }

        return Director::makeRelative($cachedPath);
    }
716208
public function save()
    {
        if (true == file_exists($this->getFileName())) {
            unlink($this->getFileName());
        }
        touch($this->getFileName());
        $content = "";
        foreach ($this->getEnvironments() as $environment) {
            $content .= "{$environment}\n";
        }
        file_put_contents($this->getFileName(), $content);
        return $content;
    }
203701
public function getLink()
    {
        if ($file = $this->UploadedFile()) {
            if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) {
                return $this->UploadedFile()->AbsoluteLink();
            }
        }
    }
28947
public function getVersion()
    {
        $returnValue = (string) '';

        if (!empty($this->version)){
        	$returnValue = $this->version;
        }

        return (string) $returnValue;
    }
96967
public function version()
    {
        if ( $this->versionObject === null )
            $this->versionObject = eZContentObjectVersion::fetch( $this->attribute( 'ezcontentobject_version_id' ) );

        return $this->versionObject;
    }
1023559
public function getLastModified()
	{
		if (is_null($this->lastModified)) {
			$this->lastModified = new \DateTime('@' . filemtime($this->path));
		}
		return $this->lastModified;
	}
565646
public function getLDAPVersion()
    {
        if ($this->_link) {
            $version = $this->getOption("LDAP_OPT_PROTOCOL_VERSION");
        } else {
            $version = $this->_config['version'];
        }
        return $version;
    }
1013620
public function version()
    {
        $this->sendCommand('version');
        $res = fgets($this->conn, 4096);
        $this->checkForError($res);

        return trim($res);
    }
1056914
public function getRelativePathToCurrentDirectoryParent()
    {
        if ($this->baseDir === $this->currentDir) {
            return DIRECTORY_SEPARATOR;
        }

        $path = realpath($this->currentDir . DIRECTORY_SEPARATOR . '..');

        return $this->getPathRelativeToBaseDir($path) ?: DIRECTORY_SEPARATOR;
    }
482624
public function getFilesPath() {
		$repo = $this->getServiceContainer()->getResourceRepository();
		if (!$repo->contains($this->getFilesPuliPath())) {
			$dir = new Directory($repo->get('/files')->getFilesystemPath());
			$path = $dir->toPath()->append('managed/' . $this->model->getName());
			$dir = new Directory($path);
			$dir->make();
		}
		$dir = new Directory($repo->get($this->getFilesPuliPath())->getFilesystemPath());

		return $dir->toPath();
	}
878552
public static function getVersion() {
		if (empty(self::$version)) {
			$filename = Application::get(['application', 'path_full']) . (Application::isDeployed() ? '../../../deployed' : '../../deployed');
			self::$version = filemtime($filename);
		}
		return self::$version;
	}
566327
def version(self):
        
        this_path = os.path.dirname(os.path.realpath(__file__))
        version_file = os.path.join(this_path, 'VERSION')
        return open(version_file).read().strip()
1163193
public function getPath(Version $file_version, ThumbnailVersion $thumbnail)
    {
        /** @var File $file */
        $file = $file_version->getFile();
        $format = $this->formatService->getFormatForFile($file_version);
        $file_id = $file->getFileID();
        $storage_location = $file->getFileStorageLocationObject();
        $configuration = $storage_location->getConfigurationObject();
        $version_id = $file_version->getFileVersionID();
        $storage_location_id = $storage_location->getID();
        $thumbnail_handle = $thumbnail->getHandle();
        $defer = $configuration instanceof DeferredConfigurationInterface;

        // Get the path from the storage
        $path = $this->getStoredThumbnailPath(
            $file_id,
            $version_id,
            $storage_location_id,
            $thumbnail_handle,
            $format
        );

        // If we don't have a stored path already, lets determine one and store it
        if (!$path) {
            $path = $this->determineThumbnailPath($file_version, $thumbnail, $storage_location, $configuration, $format);
            if ($path) {
                $this->storeThumbnailPath($path, $file_id, $version_id, $storage_location_id, $thumbnail_handle, $format, !$defer);
            }
        }

        // Pass the path to the "getBuiltThumbnailPath" method which will alter the path if it wants to
        $realPath = $this->getBuiltThumbnailPath($path, $file_version, $thumbnail, $storage_location, $configuration, $format);

        // If the "getBuiltThumbnailPath" method didn't alter the path, lLet's let the configuration resolve the path now
        if ($path == $realPath && $defer) {
            try {
                $realPath = $this->getPathFromConfiguration($realPath, $configuration);
            } catch (\InvalidArgumentException $e) {
                // Unable to resolve the path from the configuration object, lets return the real path
            }
        }

        return $realPath;
    }
1204062
public function getVersions()
    {
        if (!$this->isPropertyAvailable('Versions')) {
            $this->setProperty("Versions", new FileVersionCollection($this->getContext(), $this->getResourcePath(), "Versions"));
        }
        return $this->getProperty("Versions");
    }
1023106
public function findVersionOfFile($file, $version)
    {
        if($file == null || ($f2 = $this->findOriginalFileToVersion($file)) == null ||
            $file->getAbsoluteFilePath() != $f2->getAbsoluteFilePath()){
            return null;
        }
        $name = $this->versionFileName($file, $version);
        $f = new FileImpl($file->getParentFolder()->getAbsolutePath()."/".$name);
        return $this->containsFile($f)?$f:null;
    }
1170614
public function getAbsolutePath()
    {
        if ($this->storage->supportsAbsolutePaths()) {
            return $this->storage->getAbsolutePath($this->key);
        }

        return $this->getKey();
    }
547689
public function getVersionsToSync()
    {
        $versionsToSync      = [ ];
        $remote              = $this->client($this->setting('connection'));
        $currentVersions     = $this->project->getRefs();
        $allowedVersionRange = new expression($this->setting('sync.constraints.versions'));
        $tags                = $remote->getTags($this->setting('repository'), $this->setting('owner'));
        $skipPatch           = $this->setting('sync.constraints.skip_patch_versions', false);
        $skipMinor           = $this->setting('sync.constraints.skip_minor_versions', false);
        $skipPatch           = $skipMinor === true ? true : $skipPatch; // if we skip minors, we automaticly skip patches as well

        $this->fire('versions.start', [ $tags ]);

        foreach ( $tags as $tag => $sha )
        {
            try
            {
                $version = new version($tag);
            }
            catch (SemVerException $e)
            {
                continue;
            }

            // Check all version constraints
            if ( $version->satisfies($allowedVersionRange) === false || in_array($version->getVersion(), $currentVersions, true) )
            {
                continue;
            }
            if ( $skipPatch === true && $version->getPatch() !== 0 )
            {
                continue;
            }
            if ( $skipMinor === true && $version->getMinor() !== 0 )
            {
                continue;
            }

            // This version is inside constraints, add it
            $versionsToSync[] = $version;
        }

        $this->fire('versions.finish', [ $versionsToSync ]);
        return $versionsToSync;
    }