echo " module for entities deployed as part of the 'structure' module\n\n"; echo "\n* run from the structure directory, and the entities exported to 'export_staging'\n"; echo "will be merged/updated into the specified module_name and deploy_plan\n\n"; echo "usage: php uuid-update.php input_file module_name deploy_plan_name entity_types\n\n"; echo "module_name\tmachine name of module\n"; echo "entity_types\tmachine names of entity_types (e.g. 'node','menu_link','taxonomy_term')\n"; echo "\n\n"; exit; } // arguments $module = $argv[1]; $types = array_slice($argv, 2); // import $current = get_uuid_entities($module); $updates = get_updated_entities(); // update update_current($current, $updates, $types); // export $export = fopen($module . '/' . $module . '.features.uuid_entities.inc', 'w+'); fwrite($export, export_header($module)); foreach ($current['entities'] as $i => $entity) { $type = $entity->__metadata['type']; $object = '$entities[\'' . $current['plan'] . '\'][] = ' . improved_var_export($entity, true) . ";\n\n"; fwrite($export, $object); } fwrite($export, export_footer()); fclose($export); fclose($stderr); ?>
$rets->useragent_password = '******'; $current_GMT_time = get_GMT(time()); $current_GMT_time_string = date("Y-m-d H:i:s", $current_GMT_time); $current_YVR_time = getTimeByCity($current_GMT_time, 'YVR'); $current_YVR_time_string = date("Y-m-d H:i:s", $current_YVR_time); $current_YVR_date = date("Y-m-d", $current_YVR_time); $insert_size = 0; //login and receive server response. $response = $rets->Login(); var_dump($response); //The following code is to test if the cron job is executed. $file = "file.txt"; $current = file_get_contents($file); $current .= "{$current_YVR_time_string} from sysid_test.php\n"; file_put_contents($file, $current); update_current(); update_new(); update_recent_update(); update_recent_image(); get_open_house(); /* *Functions */ function update_current() { global $rets, $useradmin, $insert_size; $sysid_array = $rets->GetDataArray('Property', '11', '(363=|A)', 'sysid', null); $truncateSQL = "TRUNCATE TABLE sysid_raw_current"; $result = mysql_query_or_die($truncateSQL, $useradmin); foreach ($sysid_array as $index => $array) { insert_sysid($array['sysid']);