$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_pptf_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"); # } $process_product_text_files_lock_file = TrackitStockManagement_FeedFilesHelper::get_process_product_text_files_lock_file(); if ($process_product_text_files_lock_file->is_locked()) { throw new Exception('The process-product-files script is locked!'); } else { $process_product_text_files_lock_file->lock(); /* * Create the database objects. */ $muf = Database_MySQLUserFactory::get_instance(); $mu = $muf->get_for_this_project(); $database = $mu->get_database(); $dbh = $database->get_database_handle(); $feed_files_table = $database->get_table('hpi_trackit_stock_management_feed_files'); /* * Get the list of product files to parse. */