Go to the source code of this file.
Function Documentation
| _get_package_from_cache |
( |
|
$Key | ) |
|
Selecting instance of package.
- Parameters
-
- Returns
- Reference on package's object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 105 of file core_public_api.php.
{
try
{
$ObjectLabel = 'default';
return( $PackageCache[ $PackagePathsCache[ $Key ][ 'path' ] ] );
}
catch( Exception $e )
{
}
}
| get_package |
( |
|
$PackageName, |
|
|
|
$PackageVersion = 'last', |
|
|
|
$PackageScriptPath = false |
|
) |
| |
Selecting instance of package.
- Parameters
-
| $PackageName | - Name of the package. |
| $PackageVersion | - Package's version. |
| $PackageScriptPath | - Path to the package's script. |
- Returns
- Reference on package's object.
- Note
- Function sets value of the $ObjectLabel to 'default'. If the script file was not found then false will be returned.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 157 of file core_public_api.php.
{
try
{
if( $Fetched )
{
$ObjectLabel = 'default';
return( $Object );
}
$Key = "$PackageName $PackageVersion $ObjectLabel";
}
catch( Exception $e )
{
}
}
| get_package_object |
( |
|
$PackageName, |
|
|
|
$PackageVersion = 'last', |
|
|
|
$PackageScriptPath = false |
|
) |
| |
Selecting copy of package object.
- Parameters
-
| $PackageName | - name of the package. |
| $PackageVersion | - package's version. In case string 'last' is passed, then function returns the latest version. |
| $PackageScriptPath | - path to the package's script. |
- Returns
- Reference on package's object.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 218 of file core_public_api.php.
{
try
{
$PackageName , $PackageVersion , $PackageScriptPath
);
$Key = "$PackageName $PackageVersion";
if( isset( $GetPackageObjectCache[ $Key ] ) === false )
{
get_package( $PackageName , $PackageVersion , $PackageScriptPath );
}
$ClassName = $GetPackageObjectCache[ $Key ];
return( new $ClassName() );
}
catch( Exception $e )
{
}
}
| get_package_version_s |
( |
|
$ClassName | ) |
|
Function joins object's/array's fields.
- Parameters
-
- Returns
- - Package version.
- Author
- Dodonov A.A.
Definition at line 73 of file core_public_api.php.
{
$ClassVersion = explode( '_' , $ClassName );
$ClassVersionRet = '';
$ClassVersionRet = array_pop( $ClassVersion ).$ClassVersionRet;
$ClassVersionRet = array_pop( $ClassVersion ).'.'.$ClassVersionRet;
$ClassVersionRet = array_pop( $ClassVersion ).'.'.$ClassVersionRet;
return( $ClassVersionRet );
}
This function creates directory (empty index.html is also created).
- Parameters
-
| $Path | - Path to the creating directory. |
- Author
- Dodonov A.A.
Definition at line 49 of file core_public_api.php.
{
@mkdir( $Path );
file_put_contents( rtrim( $Path , "/\\" ).'/index.html' , '<html><head></head><body></body></html>' );
}
| throw_exception |
( |
|
$Message | ) |
|
Function throws exception.
- Parameters
-
| $Message | - Exception's message. |
- Author
- Dodonov A.A.
Definition at line 30 of file core_public_api.php.
{
throw( new Exception( $Message ) );
}
Variable Documentation
| $GetPackageObjectCache = array() |