Subversion Repositories oidplus

Rev

Rev 928 | Rev 930 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 928 Rev 929
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 * OIDplus 2.0
4
 * OIDplus 2.0
5
 * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
5
 * Copyright 2019 - 2022 Daniel Marschall, ViaThinkSoft
6
 *
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
9
 * You may obtain a copy of the License at
10
 *
10
 *
Line 468... Line 468...
468
 
468
 
469
        public function getAltIds() {
469
        public function getAltIds() {
470
                if ($this->isRoot()) return array();
470
                if ($this->isRoot()) return array();
471
                $ids = parent::getAltIds();
471
                $ids = parent::getAltIds();
472
                if ($uuid = oid_to_uuid($this->oid)) {
472
                if ($uuid = oid_to_uuid($this->oid)) {
-
 
473
                        // UUID-OIDs are representation of an UUID
473
                        $ids[] = new OIDplusAltId('guid', $uuid, _L('GUID representation of this OID'));
474
                        $ids[] = new OIDplusAltId('guid', $uuid, _L('GUID representation of this OID'));
474
                }
475
                } else {
-
 
476
                        // All other OIDs can be formed into an UUID by making them a namebased OID
-
 
477
                        // You could theoretically also do this to an UUID-OID, but we exclude this case to avoid that users are confused
475
                $ids[] = new OIDplusAltId('guid', gen_uuid_md5_namebased(UUID_NAMEBASED_NS_OID, $this->oid), _L('Name based version 3 / MD5 UUID with namespace %1','UUID_NAMEBASED_NS_OID'));
478
                        $ids[] = new OIDplusAltId('guid', gen_uuid_md5_namebased(UUID_NAMEBASED_NS_OID, $this->oid), _L('Name based version 3 / MD5 UUID with namespace %1','UUID_NAMEBASED_NS_OID'));
476
                $ids[] = new OIDplusAltId('guid', gen_uuid_sha1_namebased(UUID_NAMEBASED_NS_OID, $this->oid), _L('Name based version 5 / SHA1 UUID with namespace %1','UUID_NAMEBASED_NS_OID'));
479
                        $ids[] = new OIDplusAltId('guid', gen_uuid_sha1_namebased(UUID_NAMEBASED_NS_OID, $this->oid), _L('Name based version 5 / SHA1 UUID with namespace %1','UUID_NAMEBASED_NS_OID'));
-
 
480
                }
477
                return $ids;
481
                return $ids;
478
        }
482
        }
479
 
483
 
480
        public function getDirectoryName() {
484
        public function getDirectoryName() {
481
                if ($this->isRoot()) return $this->ns();
485
                if ($this->isRoot()) return $this->ns();