How get the current loggined User_id

Submitted by manuvarghese on 2019-09-30
<?php require_once( '../../system/bootstrap.inc.php' );

$principal = System_Api_Principal::getCurrent();

print_r( $principal);
 ?>

this show null. I want the details of the current logged user_id.

For this to work, you would have to create a class which inherits System_Core_Application and implements the execute() method, then call System_Bootstrap::run( ...your class name );

Regards,
Michał