PHP Classes

File: examples/kernel/core/TObject/isExecutable.php

Recommend this page to a friend!
  Packages of Christos Drogidis   Ascoos OS   examples/kernel/core/TObject/isExecutable.php   Download  
File: examples/kernel/core/TObject/isExecutable.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Ascoos OS
A PHP Web 5.0 Kernel for decentralized web and IoT
Author: By
Last change: Update of examples/kernel/core/TObject/isExecutable.php
Date: 8 months ago
Size: 2,446 bytes
 

Contents

Class file image Download
<?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);
?>