Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24327467
DockerImage.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
DockerImage.php
View Options
<?php
namespace
Keruald\DockerHub
;
use
InvalidArgumentException
;
abstract
class
DockerImage
{
///
/// Public properties
///
/**
* @var string
*/
public
$registry
;
/**
* @var string
*/
public
$user
;
/**
* @var string
*/
public
$image
;
///
/// Constructors
///
/**
* Initializes a new instance of a DockerImage object.
*
* @param string $user
* @param string $image
*/
public
function
__construct
(
$user
,
$image
)
{
$this
->
user
=
$user
;
$this
->
image
=
$image
;
}
/**
* Initializes a new instance of a DockerImage object
* from the slash notation.
*
* @param string $image the full user image name (e.g. "acme/foo")
* @return DockerImage
*
* @throws InvalidArgumentException when image name doesn't contain a slash.
*/
public
static
function
loadFromSlashNotation
(
$image
)
{
if
(
strpos
(
$image
,
'/'
)
===
false
)
{
throw
new
InvalidArgumentException
(
"Image name doesn't contain a slash (/)."
);
}
$imageFragments
=
explode
(
'/'
,
$image
,
2
);
return
new
static
(...
$imageFragments
);
}
///
/// Helper methods
///
/**
* Gets the URL to the image on the registry.
*
* @return string
*/
public
abstract
function
getRegistryUrl
();
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Feb 16, 09:31 (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3446871
Default Alt Text
DockerImage.php (1 KB)
Attached To
Mode
rKDOCKERHUB Keruald Docker Hub
Attached
Detach File
Event Timeline
Log In to Comment