コード例 #1
0
ファイル: Rets.php プロジェクト: Qclanton/retheme
 public function login()
 {
     // Prepare config
     $config = new \PHRETS\Configuration();
     $config->setLoginUrl($this->url);
     $config->setUsername($this->login);
     $config->setPassword($this->password);
     // Create the connection
     $this->connection = new \PHRETS\Session($config);
     // Try to login
     $result = $this->connection->Login();
     return (bool) $result;
 }
コード例 #2
0
ファイル: mls-3-get-properties.php プロジェクト: ezinaz/rets
// Get config properties
$ini = parse_ini_file("ezrets.ini", true);
// use http://retsmd.com to help determine the SystemName of the DateTime field which
// designates when a record was last modified
$rets_modtimestamp_field = "LIST_87";
// use http://retsmd.com to help determine the names of the classes you want to pull.
// these might be something like RE_1, RES, RESI, 1, etc.
$property_classes = array("A");
// DateTime which is used to determine how far back to retrieve records.
// using a really old date so we can get everything
//$previous_start_time = "2016-02-12T00:00:00";
//$previous_start_time = "2016-01-01T00:00:00";
$config = new \PHRETS\Configuration();
$rets_config = $ini['rets_config'];
$config->setLoginUrl($rets_config['loginurl']);
$config->setUsername($rets_config['username']);
$config->setPassword($rets_config['password']);
$config->setRetsVersion($rets_config['rets-version']);
$config->setHttpAuthenticationMethod('digest');
$config->setOption('disable_follow_location', false);
$config->setOption('use_post_method', true);
$rets = new \PHRETS\Session($config);
$rets->setLogger($log);
$connect = $rets->Login();
$file = fopen('output/Property-A-fields.csv', 'r');
$header = fgetcsv($file);
$fields = array();
while (($result = fgetcsv($file)) !== false) {
    $fields[] = $result[0];
}
foreach ($property_classes as $class) {