<?php
/**
* @ASCOOS-NAME : Ascoos OS
* @ASCOOS-VERSION : 26.0.0
* @ASCOOS-SUPPORT : support@ascoos.com
* @ASCOOS-BUGS : https://issues.ascoos.com
*
* @desc <English> Demonstrates the use of the isExecutable method to check if the current class version is executable based on Ascoos CMS and PHP versions.
* @desc <Greek> ??????????? ?? ????? ??? ??????? isExecutable ??? ??? ?????? ?? ? ???????? ?????? ??? ?????? ????? ?????????? ?? ???? ??? ???????? ??? Ascoos CMS ??? ??? PHP.
*
* @since PHP 8.2.0
*/
use ASCOOS\OS\Kernel\Core\TObject;
// <English> Declare global AOS_LOGS_PATH for log directory
// <Greek> ??????? ?? global ????????? AOS_LOGS_PATH ??? ??? ???????? ??????????
global $AOS_LOGS_PATH;
// <English> Initialize properties array with configuration
// <Greek> ???????????? ?????? ????????? ?? ??????????
$properties = [
'name' => 'TestObject',
'version' => 260000,
'logs' => [
'dir' => $AOS_LOGS_PATH . '/',
'file' => 'test.log'
]
];
// <English> Create a new TObject instance with properties
// <Greek> ?????????? ???? instance ??? TObject ?? ?????????
$object = new TObject($properties);
// <English> Check if the class is executable for Ascoos CMS version 26000 and PHP version 80200
// <Greek> ??????? ?? ? ????? ????? ?????????? ??? ??? ?????? 26000 ??? Ascoos CMS ??? ??? ?????? 80200 ??? PHP
$isExecutable = $object->isExecutable(260000, 80200);
// <English> Output the result
// <Greek> ???????? ??? ?????????????
echo $isExecutable ? "Class is executable\n" : "Class is not executable\n"; // Outputs: Class is executable
// <English> Check with an incompatible version
// <Greek> ??????? ?? ??? ?? ??????? ??????
$isExecutable = $object->isExecutable(250000, 70200);
// <English> Output the result
// <Greek> ???????? ??? ?????????????
echo $isExecutable ? "Class is executable\n" : "Class is not executable\n"; // Outputs: Class is not executable
// <English> Free resources
// <Greek> ???????????? ?????
$object->Free($object);
?>
|