Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Errore: Class XX cannot extend from interface YY

    Buonasera forum
    dopo aver installato il database, sto avendo qualche difficoltà a far girare in locale un sito, che sul server funziona correttamente.
    In pratica, l'home page e tutte le pagine interne fanno riferimento ad un file, QueryIterator.php, che genera un errore:

    Fatal error: Class QueryIterator cannot extend from interface Iterator in C:\www\housesofcharme\eclipse\QueryIterator.php on line 120

    La pagina incriminata è questa:

    Codice PHP:
    <?php
    /*** 
     * Eclipse - Extensible Class Library for PHP Software Engineers
     * Copyright (C) 2001, 2002  Vincent Oostindie
     *
     * This library is free software; you can redistribute it and/or
     * modify it under the terms of the GNU Lesser General Public
     * License as published by the Free Software Foundation; either
     * version 2.1 of the License, or (at your option) any later version.
     *
     * This library is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * Lesser General Public License for more details.
     * 
     * You should have received a copy of the GNU Lesser General Public
     * License along with this library; if not, write to the Free Software
     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     ***/

    if (!defined('ECLIPSE_ROOT')) 
    {
        
    define('ECLIPSE_ROOT''');
    }

    require_once(
    ECLIPSE_ROOT 'Iterator.php');

    /***
     * Class <code>QueryIterator</code> implements an iterator for query results.
     * 


     *   In [b]Eclipse[/b], this class can be used on an object of class
     *   <code>QueryResult</code> for queries that return rows (a 
     *   <code>SELECT</code>-query). An object is this class is returned after
     *   running a query on a <code>Database</code> or a <code>Query</code>.
     * </p>
     * 


     *   Pass an object of class <code>QueryResult</code> to the constructor to
     *   enable iteration of the records in the result, together with the type
     *   each row in the result should have. This is <code>ECLIPSE_DB_NUM</code>,
     *   <code>ECLIPSE_DB_ASSOC</code> or <code>ECLIPSE_DB_BOTH</code>, with the
     *   latter the default. See class <code>QueryResult</code> for additional
     *   information.
     * </p>
     * @see Database
     * @see QueryResult
     ***/
    class QueryIterator extends Iterator 
    {
        
    // DATA MEMBERS

        /***
         * The query to iterator over (a <code>QueryResult</code> or a
         * <code>Query</code>)
         * @type QueryResult
         ***/
        
    var $queryResult;

        
    /***
         * How each row should be retrieved. Should be <code>ECLIPSE_DB_BOTH</code>,
         * <code>ECLIPSE_DB_ASSOC</code> or <code>ECLIPSE_DB_NUM</code>
         * @type int
         ***/
        
    var $rowType;
        
        
    /***
         * The index of the current row
         * @type int
         ***/
        
    var $index;

        
    // CREATORS

        /***
         * Construct a new <code>QueryIterator</code>-object
         * @param $queryResult the <code>QueryResult</code> to iterate over
         ***/
        
    function QueryIterator(&$queryResult$rowType ECLIPSE_DB_BOTH
        {
            
    $this->queryResult =& $queryResult;
            
    $this->rowType     =  $rowType;
            
    $this->reset();
        }

        
    // MANIPULATORS

        /***
         * @returns void
         ***/
        
    function reset() 
        {
            
    $this->index 0;
        }

        
    /***
         * @returns void
         ***/
        
    function next() 
        {
            
    $this->index++;
        }

        
    // ACCESSORS

        /***
         * @returns bool
         ***/
        
    function isValid() 
        {
            return (
    $this->index $this->queryResult->getRowCount());
        }

        
    /***
         * Return a reference to the current row of the <code>QueryResult</code>
         * @returns array
         ***/
        
    function &getCurrent() 
        {
            return 
    $this->queryResult->getRow($this->index$this->rowType);
        }
    }
    ?>
    (la riga 120 è quella con cui si chiude la pagina)
    Qualcuno può darmi una mano per favore?
    Grazie

    PS lavoro con php 5.2.2
    shine on you!!

  2. #2
    Ciao.
    Ad occhio fai un misto
    di php4 e php5
    L'interfaccia Iterator è inclusa in php5
    quindi immagino che lo script (che è per php4)
    ne implemente una sua propria.


    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  3. #3
    grazie per la risposta whisher. Nel frattempo ho provato a pubblicare tutto sotto un altro dominio (qui la versione di php è la 4.4.7) ma... nulla!! Tutto inchiodato! Non mi da nessun errore
    shine on you!!

  4. #4
    Strano che sul server (php 4.4.7) non abbia funzionato. Comunque rinominando la classe, come suggerivi tu, il problema si è risolto.
    Ciao e grazie ancora
    shine on you!!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.