Go to the source code of this file.
Function Documentation
| _collapse_params |
( |
& |
$Params | ) |
|
Function collapses parameters.
- Parameters
-
| $Params | - Data for displaying. |
- Author
- Dodonov A.A.
Definition at line 264 of file core_utilities.php.
{
if( is_array( $Params ) && count( $Params ) == 0 )
{
return( '' );
}
if( is_array( $Params ) || is_object( $Params ) )
{
}
else
{
}
}
Function prcesses data.
- Parameters
-
| $k | - Key. |
| $v | - Data for displaying. |
- Returns
- Processed data.
- Author
- Dodonov A.A.
Definition at line 148 of file core_utilities.php.
{
if( is_object( $v ) || is_array( $v ) )
{
if(
in_array( $k , $_parsed_objects ) ===
false || is_numeric( $k ) )
{
$_parsed_objects[] = $k;
}
else
{
$Data = base64_encode( ' {X} ' );
}
}
else
{
}
return( $Data );
}
| _compile_params |
( |
|
$Params | ) |
|
Function compiles parameters.
- Parameters
-
| $Params | - Parameters for displaying. |
- Returns
- Compiled parameters.
- Author
- Dodonov A.A.
Definition at line 227 of file core_utilities.php.
{
$Str = ' ';
foreach( $Params as $k => $v )
{
$_collapse_span_id += 1;
$PlaceHolders = array( '{id}' , '{data}' , '{k}' );
$Template =
_file_get_contents( dirname( __FILE__ ).
'/../../res/templates/func_link.tpl' );
$Str .= str_replace( $PlaceHolders , array( $id , $Data , $k ) , $Template );
}
return( $Str );
}
| _file_get_contents |
( |
|
$FilePath | ) |
|
Function loads file and cache it.
- Parameters
-
| $FilePath | - Path to the loading file. |
- Returns
- Content of the loaded file.
- Author
- Dodonov A.A.
Definition at line 37 of file core_utilities.php.
{
if( isset( $CachedFiles[ $FilePath ] ) === false )
{
$CachedFiles[ $FilePath ] = @file_get_contents( $FilePath );
}
return( $CachedFiles[ $FilePath ] );
}
| _get_exception_object |
( |
|
$Method, |
|
|
|
$Args, |
|
|
|
$ExceptionObject |
|
) |
| |
Function creates exception object.
- Parameters
-
| $Method | - Method. |
| $Args | - Arguments. |
| $ExceptionObject | - Object of the caught exception. |
- Returns
- Exception object.
- Author
- Dodonov A.A.
Definition at line 307 of file core_utilities.php.
{
$ExceptionMessage = $ExceptionObject->getMessage();
return(
new Exception(
"$Method(".
_collapse_params( $Args ).
")::$ExceptionMessage" ) );
}
| _get_loaded_packages_paths |
( |
| ) |
|
Definition at line 109 of file core_utilities.php.
{
try
{
return( $LoadedPackagesPaths );
}
catch( Exception $e )
{
}
}
| _return_params |
( |
|
$Params | ) |
|
Function processes parameters.
- Parameters
-
| $Params | - Parameters for displaying. |
- Returns
- Processed parameters.
- Author
- Dodonov A.A.
Definition at line 190 of file core_utilities.php.
{
if( $Params === false )
{
return( 'false' );
}
elseif( $Params === true )
{
return( 'true' );
}
else
{
return( $Params );
}
}
Function recursively deletes directory.
- Parameters
-
| $Path | - Directory to delete. |
- Author
- Dodonov A.A.
Definition at line 63 of file core_utilities.php.
{
$Handle = @opendir( $Path = rtrim( $Path , '/' ).'/' );
if( $Handle !== false )
{
for( ; false !== ( $File = readdir( $Handle ) ) ; )
{
if( $File != "." and $File != ".." )
{
$FullPath = $Path.$File;
if( is_dir( $FullPath ) )
{
rmdir( $FullPath );
}
else
{
unlink( $FullPath );
}
}
}
closedir( $Handle );
}
}
| _throw_exception_object |
( |
|
$Method, |
|
|
|
$Args, |
|
|
|
$ExceptionObject |
|
) |
| |
Function throws exception.
- Parameters
-
| $Method | - Method. |
| $Args | - Arguments. |
| $ExceptionObject | - Object of the caught exception. |
- Author
- Dodonov A.A.
Definition at line 336 of file core_utilities.php.
| str_replace_once |
( |
|
$Pattern, |
|
|
|
$Replacement, |
|
|
|
$Str |
|
) |
| |
Function replaces substring only once.
- Parameters
-
| $Pattern | - String to be replaced with. |
| $Replacement | - Replacement. |
| $Str | - String. |
- Returns
- Processed string.
- Author
- Dodonov A.A.
Definition at line 367 of file core_utilities.php.
{
if( strpos( $Str , $Pattern ) !== false )
{
return( substr_replace( $Str , $Replacement , strpos( $Str , $Pattern ) , strlen( $Pattern ) ) );
}
return( $Str );
}
Variable Documentation
| $_parsed_objects = array() |
| $LoadedPackagesPaths = array() |