<?php require_once ( "/var/www/your-magento-directory/app/Mage.php" ); //Include Magento application umask(0); Mage::app("default"); //Initialize Magento // You have two options here, Mage::getSingleton("core/session", array("name" => "frontend")); //"frontend" for frontend session Mage::getSingleton("core/session", array("name" => "adminhtml")); //"adminhtml" for admin session ?>
You have done! Now you can use the internal classes and functions of Magento into your custom Framework website. i.e. If you want to check whether a customer is logged in or not by checking the Magento session.
<?php $session = Mage::getSingleton("customer/session"); if($session->isLoggedIn()) { echo "Logged in"; }else{ echo "Not logged in"; } ?>
Now you can use all the functionality of the Magento in your Framework. Enjoy the Magento Coding.