I have buyed arvixe host service and some plugin and themes (all original).
After 1 week my site go very slow with 50 users.
I asked hosting service why and they told me that the problem is cron job so now i paste my run.php script if anyone can help me....thank you very much and sorry for my english...
define('_OW_', true);
define('DS', DIRECTORY_SEPARATOR);
define('OW_DIR_ROOT', substr(dirname(__FILE__), 0, - strlen('ow_cron')));
define('OW_CRON', true);
require_once(OW_DIR_ROOT . 'ow_includes' . DS . 'init.php');
if ( !isset($_GET['ow-light-cron']) && !OW::getConfig()->getValue('base', 'cron_is_configured') ){ if ( OW::getConfig()->configExists('base', 'cron_is_configured') ) { OW::getConfig()->saveConfig('base', 'cron_is_configured', 1); } else { OW::getConfig()->addConfig('base', 'cron_is_configured', 1); }}
OW::getRouter()->setBaseUrl(OW_URL_HOME);
OW::getPluginManager()->initPlugins();$event = new OW_Event(OW_EventManager::ON_PLUGINS_INIT);OW::getEventManager()->trigger($event);
//init cache manager$beckend = OW::getEventManager()->call('base.cache_backend_init');
if ( $beckend !== null ){ OW::getCacheManager()->setCacheBackend($beckend); OW::getCacheManager()->setLifetime(3600); OW::getDbo()->setUseCashe(true);}
OW::getThemeManager()->initDefaultTheme();
// setting current theme$activeThemeName = OW::getConfig()->getValue('base', 'selectedTheme');
if ( $activeThemeName !== BOL_ThemeService::DEFAULT_THEME && OW::getThemeManager()->getThemeService()->themeExists($activeThemeName) ){ OW_ThemeManager::getInstance()->setCurrentTheme(BOL_ThemeService::getInstance()->getThemeObjectByName(trim($activeThemeName)));}
$plugins = BOL_PluginService::getInstance()->findActivePlugins();
foreach ( $plugins as $plugin ){ /* @var $plugin BOL_Plugin */ $pluginRootDir = OW::getPluginManager()->getPlugin($plugin->getKey())->getRootDir(); if ( file_exists($pluginRootDir . DS . 'cron.php') ) { include $pluginRootDir . DS . 'cron.php'; $className = strtoupper($plugin->getKey()) . '_Cron'; $cron = new $className;
$runJobs = array(); $newRunJobDtos = array();
foreach ( BOL_CronService::getInstance()->findJobList() as $runJob ) { /* @var $runJob BOL_CronJob */ $runJobs[$runJob->methodName] = $runJob->runStamp; }
$jobs = $cron->getJobList();
foreach ( $jobs as $job => $interval ) { $methodName = $className . '::' . $job; $runStamp = ( isset($runJobs[$methodName]) ) ? $runJobs[$methodName] : 0; $currentStamp = time(); if ( ( $currentStamp - $runStamp ) > ( $interval * 60 ) ) { $runJobDto = new BOL_CronJob(); $runJobDto->methodName = $methodName; $runJobDto->runStamp = $currentStamp; $newRunJobDtos[] = $runJobDto;
BOL_CronService::getInstance()->batchSave($newRunJobDtos);
$newRunJobDtos = array();
$cron->$job(); } } }}