$cmf = HaddockProjectOrganisation_ConfigManagerFactory::get_instance(); $tsm_cm = $cmf->get_config_manager('plug-ins', 'trackit-stock-management'); /* * Find out if there is an instance of this file already running. */ #$lock_file_name = $tsm_cm->get_dltf_lock_file_name(); # #if (!is_file($lock_file_name)) { # /* # * Lock the process. # */ # if ($fh = fopen($lock_file_name, 'w')) { # fwrite($fh, date('c') . "\n"); # fwrite($fh, getmypid() . "\n"); # } $download_text_files_lock_file = TrackitStockManagement_FeedFilesHelper::get_download_text_files_lock_file(); if ($download_text_files_lock_file->is_locked()) { throw new Exception('The download-text-files script is locked!'); } else { $download_text_files_lock_file->lock(); #echo date('c'); /* * Create the database objects. */ $muf = Database_MySQLUserFactory::get_instance(); $mu = $muf->get_for_this_project(); $database = $mu->get_database(); $feed_files_table = $database->get_table('hpi_trackit_stock_management_feed_files'); /* * Get the list of text files to download. */