Sabre/VObject autoload.php is creating problem

105 views
Skip to first unread message

Salman Akram

unread,
Nov 10, 2014, 10:29:11 AM11/10/14
to sabredav...@googlegroups.com
i have created a new project sabre/vobject v3.x using Composer, when i run my code the page remain blank.
i have explored my code and come to know that autoload.php did not respond because it can not find a file

the problem is with line
ComposerAutoloaderInit10090aea46bb08efc2674b995834ba0c::getLoader();

autoloads.php file is created by composer and it may possible composer is not creating

ComposerAutoloaderInit10090aea46bb08efc2674b995834ba0c file.

here is my complete autoload.php
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit10090aea46bb08efc2674b995834ba0c::getLoader();


Any help will be appreciated

Thanks
Salman Akram

Salman Akram

unread,
Nov 10, 2014, 10:34:04 AM11/10/14
to sabredav...@googlegroups.com



Also when i download sabre/vobject from github "https://github.com/fruux/sabre-vobject" v3.3 it is also missing some files such as vendor, Sabro etc so that i cant run tests/bootstrap

Evert Pot

unread,
Nov 10, 2014, 4:49:50 PM11/10/14
to sabredav...@googlegroups.com
Hi Salman,

The only real supported way to install sabre/vobject (assuming you already installed composer) is to just run this on the command line:

composer require sabre/vobject

This should create 3 items in your current directory:

1. composer.json
2. composer.lock
3. vendor/

If that doesn't work, post here again. The vendor directory is not supposed to be on github as it's automatically generated.

Evert

Salman Akram

unread,
Nov 11, 2014, 1:38:03 AM11/11/14
to sabredav...@googlegroups.com
Hello Evert,

First of all Thanks for your reply.I have attached all the directory folder/files that i have gotten from composer using command line, I just want to parse icalendar file(basic.ics located at root directory) for this i have created a test.php file at root directory and have copy/pasted code i have gotten from sabre/vobject doc usage("http://sabre.io/vobject/usage/"),So it stuck in autoloads.php when it include autoloads.php and call ____::getLoader() please review my code and let me know what and where i am doing mistake.

Thanks
Salman Akram
my_project.zip

Dominik Tobschall

unread,
Nov 11, 2014, 10:13:10 AM11/11/14
to sabredav...@googlegroups.com
Hi Salman,

the autoloader is invoked just fine more me in your sample project. Which php version are you using?

But there’s another problem with your test.php.
This:

VObject\Reader::read(‘basic.ics');

should look like this

VObject\Reader::read(file_get_contents(dirname(__FILE__) . '/basic.ics'));

because the read method expects either a string or a resource.

For additional clarity you could also rename your $vcard variable to e.g. $vobject since you are trying to read an .ics file.

Dominik
> --
> You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/f7dc0fdf-bfc5-45c1-80c5-529f7bfe07b9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
> <my_project.zip>

Salman Akram

unread,
Nov 12, 2014, 3:04:52 AM11/12/14
to sabredav...@googlegroups.com
Hi Dominik,

Thanks, it seems to be working with

VObject\Reader::read(file_get_contents(dirname(__FILE__) . '/basic.ics'));

Now i want to use ICalendar splitter, According to doc

http://sabre.io/vobject/usage/

Splitting export files

// You can either pass a readable stream, or a string.
$h = fopen('backupfile.vcf', 'r');
$splitter = new VObject\Splitter\VCard($h);

while($vcard = $splitter->next()) {

    // $vCard is a single vCard object. You can just call serialize() on it
    // if you were looking for the string version.

}

i just changed VCard to ICalendar Splitter and a blank page appears to me, here is my test.php file code

should i need to include anything more?

<?php

use Sabre\VObject;

include 'vendor/autoload.php';

//1. $vobjectStream = fopen(file_get_contents(dirname(__FILE__) . '/basic.ics'),'r');
//2. $vobjectStream = fopen(dirname(__FILE__) . '/basic.ics','r');
$vobjectStream
= fopen('http://localhost/my_project/basic.ics','r');
$splitter = new VObject\Splitter\ICalendar($vobjectStream);

while($VEVENT = $splitter->next()) {
echo "<pre>";
print_r($VEVENT);
echo "</pre>";

}

I have provided all of three ways 1,2,3 for input stream.

For some VEVENT in ICalendar(in basic.ics file) have DTSTART and DTEND with tzid, will your library automatically convert DTSTART and DTEND according to tzid or further i need to process on DTSTART and DTEND?


--
You received this message because you are subscribed to a topic in the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sabredav-discuss/JNHRsdURxMQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sabredav-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/92B81219-CB1A-4C30-ABDB-6E13429AE8BC%40gmail.com.

Evert Pot

unread,
Nov 12, 2014, 12:52:32 PM11/12/14
to sabredav...@googlegroups.com
Hi Salman,

The first thing you need to do, is to get rid of your blank pages. Every time you are getting a blank page, it means you are actually getting a PHP error.
In your php configuration, you should make sure that display_errors is on.

The error messages you are getting probably tells you a lot more about what you are doing wrong.

Evert
> To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sabredav-discuss/JNHRsdURxMQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sabredav-discuss+unsubscribe@googlegroups.com.

Salman Akram

unread,
Nov 13, 2014, 5:37:14 AM11/13/14
to sabredav...@googlegroups.com
Hi Evert,

My display_errors is on in php configuration file, my screen get dimmed and don't load anything, i need to restart my browser

$splitter->next() function is not available anymore in the ICalendar or VCard, it have changed to $splitter->getNext(), old doc confused me a lot

Splitting export files

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Now i have concerned only with DTSTART and DTEND datetime object, these are two things thats why i want to use sabre/object.

if i import basic.ics file in the google calendar, the DTSTART and DTEND are not same as i have parsed basic.ics file using sabre/vobject Icalendar.Below is parsed data, i just print out SUMMARY, DTSTART(DateTime object) and DTSTART(in W3C format).

Also there are some VEVENT with DTSTART having not time but only date, your parser include 00:00:00 with them, it seam event will start 12:00 AM or PM.

i have attached my test.php file you can replace with test.php(roor directory) in the zip file, zip file i had sent you earlier few days.

can you please just import basic.ics file to your google calendar and and can matched the DTSTART object parsed through sabre/vobject?

Or

can you please provide some other solution using sabre/vobject so that they should be same?

1. AHS coaches at shop
object(DateTime)#1180 (3) { ["date"]=> string(19) "2014-10-16 19:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-10-16T19:30:00-05:00

2. Lakers Pasta Dinner
object(DateTime)#1184 (3) { ["date"]=> string(19) "2015-01-09 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-09T18:00:00-06:00

3. Lakers Annual Xmas Camp (DH)
object(DateTime)#1187 (3) { ["date"]=> string(19) "2014-12-26 09:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-26T09:00:00-06:00

4. Lakers/OHS Ski swap
object(DateTime)#1189 (3) { ["date"]=> string(19) "2014-11-07 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-11-07T18:00:00-06:00

5. Lakers Training (Lil Switz)
object(DateTime)#1193 (3) { ["date"]=> string(19) "2015-02-05 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-02-05T18:00:00-06:00

6. Lakers Training (Lil Switz)
object(DateTime)#1196 (3) { ["date"]=> string(19) "2015-01-15 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-15T18:00:00-06:00

7. Lakers Training (Lil Switz)
object(DateTime)#1199 (3) { ["date"]=> string(19) "2014-12-09 16:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-09T16:00:00-06:00

8. Lakers Training (DH)
object(DateTime)#1202 (3) { ["date"]=> string(19) "2014-12-21 08:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-21T08:30:00-06:00

9. Lakers Training
object(DateTime)#1205 (3) { ["date"]=> string(19) "2014-12-21 08:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-21T08:30:00-06:00

10. Lakers Training (Lil Switz)
object(DateTime)#1208 (3) { ["date"]=> string(19) "2014-12-11 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-11T18:00:00-06:00

11. WC Races (Women Aspen GS, SL)
object(DateTime)#1210 (3) { ["date"]=> string(19) "2014-11-28 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-11-28T18:00:00-06:00

12. WILLSKI Early Camp #5 (U14-U18 Week)
object(DateTime)#1213 (3) { ["date"]=> string(19) "2014-11-18 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-11-18T18:00:00-06:00

13. WILLSKI Early Camp #4 (U8-U12 project)
object(DateTime)#1216 (3) { ["date"]=> string(19) "2014-11-11 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-11-11T18:00:00-06:00

14. USSA Race (Ripley 2 GS)
object(DateTime)#1219 (3) { ["date"]=> string(19) "2015-01-02 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-02T18:00:00-06:00

15. USSA Event (GS Camp Ripley)
object(DateTime)#1222 (3) { ["date"]=> string(19) "2014-12-31 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-31T18:00:00-06:00

16. WI High School State Meet
object(DateTime)#1225 (3) { ["date"]=> string(19) "2015-02-13 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-02-13T18:00:00-06:00

17. WJR Race (Lil Switz SL)
object(DateTime)#1228 (3) { ["date"]=> string(19) "2015-02-06 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-02-06T18:00:00-06:00

18. WJR Race (Lakers GS, Kombi)
object(DateTime)#1231 (3) { ["date"]=> string(19) "2015-01-30 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-30T18:00:00-06:00

19. WJR Race (AV SL)
object(DateTime)#1234 (3) { ["date"]=> string(19) "2015-01-23 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-23T18:00:00-06:00

20. WJR Race (HH GS)
object(DateTime)#1237 (3) { ["date"]=> string(19) "2015-01-16 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-16T18:00:00-06:00

21. WJR Race (AUS SL)
object(DateTime)#1240 (3) { ["date"]=> string(19) "2015-01-09 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-09T18:00:00-06:00

22. JT Hilligoss Memorial Race
object(DateTime)#1243 (3) { ["date"]=> string(19) "2014-12-19 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-19T18:00:00-06:00

23. WJR Race (SUN GS)
object(DateTime)#1246 (3) { ["date"]=> string(19) "2015-01-02 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2015-01-02T18:00:00-06:00

24. WILLSKI Early Camp #1
object(DateTime)#1249 (3) { ["date"]=> string(19) "2014-10-22 19:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-10-22T19:00:00-05:00

25. Lakers Opening Pot Luck Dinner
object(DateTime)#1253 (3) { ["date"]=> string(19) "2014-10-15 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-10-15T18:00:00-05:00

26. Lakers Training (Opening Weekend, Devils Head)
object(DateTime)#1256 (3) { ["date"]=> string(19) "2014-12-13 08:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-13T08:30:00-06:00

27. WILLSKI WC Camp (8th Annual)
object(DateTime)#1258 (3) { ["date"]=> string(19) "2014-12-02 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-12-02T18:00:00-06:00

28. WILLSKI Early Camp #3 (Masters)
object(DateTime)#1261 (3) { ["date"]=> string(19) "2014-11-04 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-11-04T18:00:00-06:00

29. WILLSKI Early Camp#2
object(DateTime)#1264 (3) { ["date"]=> string(19) "2014-10-28 19:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2014-10-28T19:00:00-05:00

30. Awards Banquet
object(DateTime)#1268 (3) { ["date"]=> string(19) "2011-04-02 17:30:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2011-04-02T17:30:00-05:00

31. K13 SL Camp
object(DateTime)#1271 (3) { ["date"]=> string(19) "2011-01-24 09:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2011-01-24T09:00:00-06:00

32. WJR Race (SL all ages)
object(DateTime)#1273 (3) { ["date"]=> string(19) "2011-01-21 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2011-01-21T18:00:00-06:00

33. Lakers Practice (SL all ages)
object(DateTime)#1276 (3) { ["date"]=> string(19) "2011-01-22 18:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "America/Chicago" }
2011-01-22T18:00:00-06:00



To unsubscribe from this group and all its topics, send an email to sabredav-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/7a1c00a5-871f-461c-b1ac-5c056f5037a2%40googlegroups.com.
test.php

Evert Pot

unread,
Nov 13, 2014, 12:03:15 PM11/13/14
to sabredav...@googlegroups.com


On Thursday, November 13, 2014 5:37:14 AM UTC-5, Salman Akram wrote:
Hi Evert,

My display_errors is on in php configuration file, my screen get dimmed and don't load anything, i need to restart my browser

If you get a completely blank page when triggering a PHP error, there is definitely an issue with your configuration. I would strongly recommend to fix that first, as you are basically coding blind otherwise.
 

$splitter->next() function is not available anymore in the ICalendar or VCard, it have changed to $splitter->getNext(), old doc confused me a lot

Splitting export files


It looks like our documentation was wrong :( that sucks. Sorry about that. I fixed the docs now as well. The library is pretty well tested, but I don't think all our documentation samples are.

 

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Now i have concerned only with DTSTART and DTEND datetime object, these are two things thats why i want to use sabre/object.

if i import basic.ics file in the google calendar, the DTSTART and DTEND are not same as i have parsed basic.ics file using sabre/vobject Icalendar.Below is parsed data, i just print out SUMMARY, DTSTART(DateTime object) and DTSTART(in W3C format).

Also there are some VEVENT with DTSTART having not time but only date, your parser include 00:00:00 with them, it seam event will start 12:00 AM or PM.

i have attached my test.php file you can replace with test.php(roor directory) in the zip file, zip file i had sent you earlier few days.

can you please just import basic.ics file to your google calendar and and can matched the DTSTART object parsed through sabre/vobject?

Or

can you please provide some other solution using sabre/vobject so that they should be same?


[snip]

DTSTART can indeed always have either a DATE or DATE-TIME value. When you call:

$dateTime = $vevent->DTSTART->getDateTime();

You get a PHP DateTime object back. That object has a date and a time, and for DATE values, we indeed just put the time on midnight.

This shouldn't be an issue however, because if you want to just output the date, you can just call the format function:

echo $dateTime->format('Y-m-d');



See:
http://php.net/manual/en/datetime.format.php

If you want to know if an event is an all-day event or if it also has time associated with it, you can use the hasTime function:

$vevent->DTSTART->hasTime()

This returns back true or false.

Does that help at all?

Evert
Reply all
Reply to author
Forward
0 new messages