Zend_Feed module uses zend_require(). Removing that function will break existing installations.

CommentFileSizeAuthor
#4 zend_require.patch708 bytesrobloach
#2 zend.patch859 bytesrobloach

Comments

robloach’s picture

Oops, I think I accidently got rid of it....

robloach’s picture

Status: Active » Needs review
StatusFileSize
new859 bytes

Will this do it?

mustafau’s picture

I prefer using require_once '';

robloach’s picture

StatusFileSize
new708 bytes

How about this? Remember that it's probably better to use Zend_Initialize, because that uses what the Zend Framework recommends to use (the loader).

mustafau’s picture

Zend Framework itself uses require_once. I don't think they are recommending Zend_Loader.

Zend_Loader is recommended only if class name is a variable and subject to change.

These examples from Zend_Feed.php shows how Zend Framework utilizes require_once and Zend_Loader:

Example for require_once:

        // Try to find the base feed element or a single <entry> of an Atom feed
        if ($doc->getElementsByTagName('feed')->item(0) ||
            $doc->getElementsByTagName('entry')->item(0)) {
            /**
             * @see Zend_Feed_Atom
             */
            require_once 'Zend/Feed/Atom.php';
            // return a newly created Zend_Feed_Atom object
            return new Zend_Feed_Atom(null, $string);
        }

        // Try to find the base feed element of an RSS feed
        if ($doc->getElementsByTagName('channel')->item(0)) {
            /**
             * @see Zend_Feed_Rss
             */
            require_once 'Zend/Feed/Rss.php';
            // return a newly created Zend_Feed_Rss object
            return new Zend_Feed_Rss(null, $string);
        }

Example for Zend_Loader:

    /**
     * Construct a new Zend_Feed_Abstract object from a custom array
     *
     * @param  array  $data
     * @param  string $format (rss|atom) the requested output format
     * @return Zend_Feed_Abstract
     */
    public static function importArray(array $data, $format = 'atom')
    {
        $obj = 'Zend_Feed_' . ucfirst(strtolower($format));
        /**
         * @see Zend_Loader
         */
        require_once 'Zend/Loader.php';
        Zend_Loader::loadClass($obj);
        Zend_Loader::loadClass('Zend_Feed_Builder');

        return new $obj(null, null, new Zend_Feed_Builder($data));
    }
mustafau’s picture

Status: Needs review » Reviewed & tested by the community
robloach’s picture

Would you mind committing this? I gave you CVS access, and am kind of busy right now. Feel free to commit anything else you feel appropriate too! :-)

mustafau’s picture

Status: Reviewed & tested by the community » Fixed

http://drupal.org/cvs?commit=118903

Thanks for giving me CVS access.

robloach’s picture

Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.