示例#1
0
 private function checkAkeebaOutputDirectory()
 {
     try {
         // If using PHP 5.2 then ABORT as Akeeba stuff needs newer PHP version
         if (version_compare(PHP_VERSION, '5.3.0', '<')) {
             throw new Exception('PHP version below 5.3.0 so Akeeba Will Not Work!');
         } else {
             require 'bfPHPFiveThreePlusOnly.php';
         }
         // Check Akeeba Installed - Prerequisite
         if (!file_exists(JPATH_SITE . '/libraries/f0f/include.php') || !file_exists(JPATH_SITE . '/administrator/components/com_akeeba/engine/Factory.php') || !file_exists(JPATH_SITE . '/administrator/components/com_akeeba/engine/serverkey.php')) {
             bfEncrypt::reply('success', array('paths' => array()));
         }
         $returnData = array();
         if (!defined('AKEEBAENGINE')) {
             define('AKEEBAENGINE', 1);
         }
         require_once JPATH_SITE . '/libraries/f0f/include.php';
         require_once JPATH_SITE . '/administrator/components/com_akeeba/engine/Factory.php';
         $serverKeyFile = JPATH_BASE . '/administrator/components/com_akeeba/engine/serverkey.php';
         if (!defined('AKEEBA_SERVERKEY') && file_exists($serverKeyFile)) {
             include $serverKeyFile;
         }
         // Get the list of profiles
         $profileList = F0FModel::getTmpInstance('Profiles', 'AkeebaModel')->getProfilesList();
         // for each profile
         foreach ($profileList as $config) {
             // if encrypted
             if (substr($config->configuration, 0, 12) == '###AES128###') {
                 $php53 = new bfPHPFiveThreePlusOnly();
                 $config->configuration = $php53->getAkeebaConfig($config->configuration);
             }
             // Convert ini to useable array
             $data = parse_ini_string($config->configuration, TRUE);
             // find the folder
             $dir = $data['akeeba']['basic.output_directory'];
             $returnData[] = array('path' => $dir, 'is_writable' => is_writable($dir), 'file_exists' => file_exists($dir));
         }
         bfEncrypt::reply('success', array('paths' => $returnData));
     } catch (Exception $e) {
         bfEncrypt::reply('error', array('msg' => $e->getMessage()));
     }
 }
示例#2
0
 private function getAkeebaOutputDirectoryProblems()
 {
     $problems = 0;
     try {
         // If using PHP 5.2 then ABORT as Akeeba stuff needs newer PHP version
         if (version_compare(PHP_VERSION, '5.3.0', '<')) {
             throw new Exception('PHP version below 5.3.0');
         } else {
             require 'bfPHPFiveThreePlusOnly.php';
         }
         // Check Akeeba Installed - Prerequisite
         if (!file_exists(JPATH_SITE . '/libraries/f0f/include.php') || !file_exists(JPATH_SITE . '/administrator/components/com_akeeba/engine/Factory.php') || !file_exists(JPATH_SITE . '/administrator/components/com_akeeba/engine/serverkey.php')) {
             throw new Exception('Cannot load Akeeba, maybe not installed');
         }
         if (!defined('AKEEBAENGINE')) {
             define('AKEEBAENGINE', 1);
         }
         require_once JPATH_SITE . '/libraries/f0f/include.php';
         require_once JPATH_SITE . '/administrator/components/com_akeeba/engine/Factory.php';
         $serverKeyFile = JPATH_BASE . '/administrator/components/com_akeeba/engine/serverkey.php';
         if (!defined('AKEEBA_SERVERKEY') && file_exists($serverKeyFile)) {
             include $serverKeyFile;
         }
         // Get the list of profiles
         $profileList = F0FModel::getTmpInstance('Profiles', 'AkeebaModel')->getProfilesList();
         // for each profile
         foreach ($profileList as $config) {
             // if encrypted
             if (substr($config->configuration, 0, 12) == '###AES128###') {
                 $php53 = new bfPHPFiveThreePlusOnly();
                 $config->configuration = $php53->getAkeebaConfig($config->configuration);
             }
             // Convert ini to useable array
             $data = parse_ini_string($config->configuration, TRUE);
             // find the folder
             $dir = $data['akeeba']['basic.output_directory'];
             if ($dir != '[DEFAULT_OUTPUT]' && (!is_writable($dir) || !file_exists($dir))) {
                 $problems++;
             }
         }
         return $problems;
     } catch (Exception $e) {
         // No need to pass back issues when looking for Akeeba or PHP versions - we will just ignore it
         // After all if the site is running in PHP 5.2 they have bigger issues!!!
         return $problems;
     }
 }