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?


On Tue, Nov 11, 2014 at 12:24 PM, Dominik Tobschall <[email protected]>
wrote:

> 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
>
> > On 11.11.2014, at 07:38, Salman Akram <[email protected]>
> wrote:
> >
> > 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
> >
> > On Tuesday, November 11, 2014 2:49:50 AM UTC+5, Evert Pot wrote:
> > 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
> >
> > On Monday, November 10, 2014 10:34:04 AM UTC-5, Salman Akram wrote:
> > On Monday, November 10, 2014 8:29:11 PM UTC+5, Salman Akram wrote:
> > 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
> >
> >
> >
> > 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
> >
> > --
> > 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 [email protected].
> > 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>
>
> --
> 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
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sabredav-discuss/92B81219-CB1A-4C30-ABDB-6E13429AE8BC%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sabredav-discuss/CAEf4Puzg0C%2BdQ9on5sDHmetLG86NZUU1chfYKbpSYpE7ZCh6bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to