egroupware et import calendrier iCal

トップ ページ

このメッセージに返信
著者: Jerome Kieffer
日付:  
To: guilde
題目: egroupware et import calendrier iCal
Bonjour à tous,

J'ai un petit problème avec l'importation d'un calendrier «iCal» généré
par evolution dans egroupware. C'est sans doute une erreur de
paramétrisation bête de mon système qui semblera triviale pour un
gourou PHP, c'est pourquoi je vous la soumets.


Voici le message d'erreur :

Warning: Horde_iCalendar::include_once
(/home/httpd/egroupware/phpgwapi/inc/horde/Horde/iCalendar/vcalendar.php)
[function.Horde-iCalendar-include-once]: failed to open stream: No such
file or directory
in /home/httpd/egroupware/phpgwapi/inc/horde/Horde/iCalendar.php on
line 53

Warning: Horde_iCalendar::include_once() [function.include]: Failed
opening
'/home/httpd/egroupware/phpgwapi/inc/horde/Horde/iCalendar/vcalendar.php'
for inclusion
(include_path='/home/httpd/egroupware/egw-pear:.:/usr/share/php:/usr/share/pear')
in /home/httpd/egroupware/phpgwapi/inc/horde/Horde/iCalendar.php on
line 53

Fatal error: Class 'PEAR' not found
in /home/httpd/egroupware/phpgwapi/inc/horde/Horde/iCalendar.php on
line 429


Les lignes de code incriminées sont :
 /**
     * Parse a string containing vCalendar data.
     *
     * @param string  $text  The data to parse.
     * @param string  $base  The type of the base object.
     * @param string  $charset (optional) The encoding charset for
$text. Defaults to utf-8
     * @param boolean $clear (optional) True to clear() the iCal object
before parsing. *
     * @return boolean  True on successful import, false otherwise.
     */
    function parsevCalendar($text, $base = 'VCALENDAR', $charset =
'utf-8', $clear = true) {
        if ($clear) {
            $this->clear();
        }
        if (preg_match('/(BEGIN:' . $base . '\r?\n)([\W\w]*)(END:' .
$base . '\r?\n?)/i', $text, $matches)) { $vCal = $matches[2];
        } else {
            // Text isn't enclosed in BEGIN:VCALENDAR
            // .. END:VCALENDAR. We'll try to parse it anyway.
            $vCal = $text;
        }


        // All subcomponents.
        $matches = null;
        if (preg_match_all('/BEGIN:([\S]*)(\r\n|\r|\n)([\W\w]*)END:\1(\r
\n|\r|\n)/U', $vCal, $matches)) { foreach ($matches[0] as $key =>
$data) { $type = $matches[1][$key];
                $component = &Horde_iCalendar::newComponent(trim
($type), $this); if ($component === false) {
                    return PEAR::raiseError("Unable to create object
for type $type"); }
                $component->parsevCalendar($data);


                $this->addComponent($component);


                // Remove from the vCalendar data.
                $vCal = str_replace($data, '', $vCal);
            }
        }



Merci de vos lumières.

--
Jérôme KIEFFER : http://www.terre-adelie.org
À vélo, prendre une rue à contre-sens est moins dangeureux
que prendre un boulevard dans le sens légal. À qui la faute ?