Class 'PHRETS\Configuration' not found

689 views
Skip to first unread message

Vilmos Branyik

unread,
Oct 26, 2015, 10:23:24 AM10/26/15
to PHRETS
Sorry for such a a basic question but I have zero experience with using Composer and limited experience with PHRETS ...

The RETS server I had been connecting to was using 1.x but just upgrade to 2.0 so I've attempted to install the latest version of PHRETS.

I'm running the web site on a hosted server so had to install composer locally on an Ubuntu workstation. The install was without error.

I initially created the composer.json file using the expample I found on the PHRETS github home page. I ran the install copied those libraries up and couldn't connect. I got this error:

Fatal error: Class 'PHRETS\Configuration' not found in /[path to files]

I then found the composer.json file in the download zip that forced PHP 5.4 and ran a composer upgrade and copied those files up

I still received the same error.

I'm wondering if I'm having an issue when it comes to the path I have put the composer libraries in.

In the example connect script it shows a required_once path of

require_once("vendor/autoload.php")

Which would place the files at the root of the site. I have a habit of putting php libraries in a separate directory not "publicly viewable". In this case mine is:

require_once("/home/public_code/vendor/autoload.php")

So I copied the libraries to the root directory and am still receiving the error.

I also don't use classes much I mostly write functions (I'm an old school VB programmer), so my ability to trouble shoot an error like this is difficult for me.

I'm hoping for some direction to find my mistake.

Thanks in advance for any help.

Vilmos

Gennadiy Kofman

unread,
Oct 26, 2015, 1:52:21 PM10/26/15
to PHRETS
Make sure composer actually downloaded the phrets vendor folder.

It should be inside the troydavisson folder.

Then if it's there, make sure there is the Configuration.php file inside vendor\troydavisson\phrets\src

Vilmos Branyik

unread,
Oct 26, 2015, 9:37:11 PM10/26/15
to PHRETS
Thanks very much for the help Gennadiy!

I deleted the entire folder and recreated the composer.json file with:

{
    "require": {
        "troydavisson/phrets": "2.*"
    }
}
When I run the test script in the readme.md file I get the following error:

Fatal error: Class 'Monolog\Logger' not found

So I commented that out and the script connects and runs without any other errors.

Am I still missing something?

In addition to that I inserted some code to run a simple search for all properties in the MLS in a specific city. I the following error when attempting to run SearchQuery:

Cal to undefined method PHRETS\Session::SearchQuery()

I assume that means that there has been a change in the function list. I have been searching the github site and the Google Group but haven't found a function list. The wiki seems to still be support for V1.x. Is there something set up for the new version?

Thanks agin for your assistance!

Vilmos

Gennadiy Kofman

unread,
Oct 27, 2015, 2:40:14 PM10/27/15
to PHRETS
Can you post the code that you are running?

Erick Kamamba

unread,
Mar 24, 2016, 3:28:50 PM3/24/16
to PHRETS
I'm getting the same error message. I have download the vendor folder through the terminal but I don't see the troydavisson folder. I visited this link: https://packagist.org/packages/troydavisson/phrets but there is no where to download the folder. Can anyone assist me?

Gennadiy Kofman

unread,
Mar 24, 2016, 3:54:10 PM3/24/16
to PHRETS
Did you use composer?

Erick Kamamba

unread,
Mar 24, 2016, 4:10:24 PM3/24/16
to phr...@googlegroups.com
Yes I used the composer

Sent from my iPhone
--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Gennadiy Kofman

unread,
Mar 24, 2016, 4:31:05 PM3/24/16
to PHRETS
Ok, make sure you run the composer on

{
   
"require": {
       
"troydavisson/phrets": "2.*"
   
}
}

I have seen people run composer on the composer file found inside the downloadable git files.

If you run composer on the provided file, it will download everything but phrets.

Mariano Iglesias

unread,
Mar 24, 2016, 4:33:25 PM3/24/16
to phr...@googlegroups.com
No need to create the JSON. The proper way is:

$ composer require troydavisson/phrets 
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Erick Kamamba

unread,
Mar 24, 2016, 7:06:38 PM3/24/16
to phr...@googlegroups.com
Thank you ALL for your help. Below is what I have done:-
1. I removed this code in my composer.json file:-

{
    "require": {
        "monolog/monolog": "1.0.*"
    }
}

2. Then added the following code:-

{
   
    "require": {
        "troydavisson/phrets": "2.*"
    }

}

3. Ran this code in the terminal: php composer.phar update. I was able to download the updates and I can now see the troydavisson folder.

4. I executed the attached scripts and I get this error message "PHP Fatal error:  Class 'Monolog\Logger' not found in /home/brlfq4u/Connection.php on line 7"

What am I missing?



Have a wonderful day!

Thanks & Regards,
Erick Kamamba, Msc,
Microsoft Certified Professional (MCP),
Microsoft Specialist in Visual Studio
Software Engineer
ekam...@gmail.com
Connection.php

David R

unread,
Mar 24, 2016, 7:53:25 PM3/24/16
to PHRETS
You are missing Monolog. You wil need to install Monolog or If you comment out line 7 your script should work.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Erick Kamamba

unread,
Mar 29, 2016, 5:37:42 AM3/29/16
to phr...@googlegroups.com
Thank you all.

Now I'm getting an error message "Invalid username/password". Has anyone run into this kind of issue?


Have a wonderful day!

Thanks & Regards,
Erick Kamamba, Msc,
Microsoft Certified Professional (MCP),
Microsoft Specialist in Visual Studio
Software Engineer
ekam...@gmail.com

$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Gennadiy Kofman

unread,
Mar 29, 2016, 12:48:22 PM3/29/16
to PHRETS
Yes, but then I put in the correct username and password and it started working... lol
$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Erick Kamamba

unread,
Mar 29, 2016, 1:51:10 PM3/29/16
to phr...@googlegroups.com
I wish it was that simple.. Lol

I asked whoever gave me the username/ password, he said that the username and password is correct :(

Sent from my iPhone

Mariano Iglesias

unread,
Mar 29, 2016, 2:02:26 PM3/29/16
to phr...@googlegroups.com
What else besides asking that person did you try to test your credentials?

$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "PHRETS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phrets/yylcimCSN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Gennadiy Kofman

unread,
Mar 29, 2016, 2:04:59 PM3/29/16
to PHRETS
Try logging in through here:
http://retsmd.com/

Sometimes you also need a user agent (and password) or to specify a rets version.

Also, some older ones will require basic http authentication method.

Erick Kamamba

unread,
Mar 29, 2016, 8:18:58 PM3/29/16
to phr...@googlegroups.com
Thank you Gennadiy,

I was able to login. Does it mean I didn't my composer/ phrets properly?


Have a wonderful day!

Thanks & Regards,
Erick Kamamba, Msc,
Microsoft Certified Professional (MCP),
Microsoft Specialist in Visual Studio
Software Engineer
ekam...@gmail.com

$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Gennadiy Kofman

unread,
Mar 30, 2016, 1:11:52 PM3/30/16
to PHRETS
No, it doesn't mean that.  Your getting back a valid error message so something must be working.

When you logged in to retsmd, did you put in anything else besides the login/pass?  Like rets version or user agent?

Can you post the code here that your trying to use?  You can xxx the user/pass if you want.
$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

Erick Kamamba

unread,
Mar 30, 2016, 7:20:56 PM3/30/16
to phr...@googlegroups.com
When I logged in to retsmd, I just put the username and password nothing else. Below is the code I'm using to test the connection to the stage (TEST) server, I was following this video from Youtube (https://www.youtube.com/watch?v=c8lpa7IOrlw):-

<?php

try{
   
require('vendor/autoload.php');

$config = new \PHRETS\Configuration;

$config->setLoginUrl('https://rets-stage-paragon.sandicor.com/rets/fnisrets.aspx/sandicor/login?rets-version=RETS/1.7.2');
$config->setUsername('***');
$config->setPassword(getenv('***'));
// $config->setPassword('***');

$config->setRetsVersion('1.7.2');

$config->setOption('disable_follow_location', false);
$config->setOption('use_post_method', true);

$session = new \PHRETS\Session($config);

$login = $session->Login();

} catch (Exception $e) {
    echo 'Caught exception: ',  $e->getMessage(), "\n";
}

?>

If there is another way of doing it, please share it with me.




Have a wonderful day!

Thanks & Regards,
Erick Kamamba, Msc,
Microsoft Certified Professional (MCP),
Microsoft Specialist in Visual Studio
Software Engineer
ekam...@gmail.com

$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Gennadiy Kofman

unread,
Mar 30, 2016, 7:57:11 PM3/30/16
to PHRETS
Your in luck cause sandicor is one of the feeds that I have...

However, in my version, I don't use the https version.
Comment out the 2 options that you have (I use the defaults).
And is your password an environment variable?  Try to use the password as it is just in case:
$config->setPassword('***');
$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

Erick Kamamba

unread,
Mar 30, 2016, 9:34:26 PM3/30/16
to phr...@googlegroups.com
Thank you a ton!!!!

The issue was the URL. I just changed to http:// version but I remember asking again for the URL but I was given the same https:// version after telling them it's not working.

Also I was able to login in retsmd with the https:// version. That's why I never doubted about the URL version. Now I have to figure how to search for listings and download them. Is there a place/ link I can go and get the code? Sandicor doesn't provide any documentation. If there isn't any link, I will make sure that I create the documentation and publish it online for beginners.

Again, thanks Gennadiy for the second pair of eyes :)




Have a wonderful day!

Thanks & Regards,
Erick Kamamba, Msc,
Microsoft Certified Professional (MCP),
Microsoft Specialist in Visual Studio
Software Engineer
ekam...@gmail.com

$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Gennadiy Kofman

unread,
Mar 31, 2016, 6:53:15 PM3/31/16
to PHRETS
Getting the listings is not difficult once you can connect.  It's what you do with those listings after you get them that's the problem.  Most commands are outlines in the intro.  Everyone has different needs and so you just have to program the system that works for you.  Because of that, there really isn't a tutorial.  But each rets provider may give "tips".

As an example, Rapattoni has a few documentations that works for them:
http://www.rapattoni.com/rets-documentation

Also, I just checked, and they did originally send me an https link.  I don't remember why I switched to http (it was a long time ago), but maybe I had the same problem and http just worked so I just rolled with it.
$ composer require troydavisson/phrets 
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

Roger Morris

unread,
Jan 13, 2022, 7:05:35 PM1/13/22
to PHRETS
I am getting the same error as described above however the configuration.php file is present in the src directory
<?php
echo 'test';
$config = new \PHRETS\Configuration;
$config = Configuration::load([
'username' => '****',
'password' => '****',
'user_agent' => 'UserAgent/1.0',
'rets_version' => '1.8',
'http_authentication' => 'basic',
]);

$rets = new \PHRETS\Session($config);
$bulletin = $rets->Login();
$resource = 'Property';
$class = 'RE_1';
$results = $rets->Search(
$resource,
$class,
$query,
[
'QueryType' => 'DMQL2',
'Count' => 1, // count and records
'Format' => 'COMPACT-DECODED',
'Limit' => 99999999,
'StandardNames' => 0, // give system names
]
);
?>
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

--

mark enriquez

unread,
Jan 13, 2022, 7:14:14 PM1/13/22
to phr...@googlegroups.com
You forgot to #include PHRets.php at the top of your source...

regards,
Mark

Reply all
Reply to author
Forward
0 new messages