stumped. i really need help.

Forum
Last Post
Threads / Messages

Phoeniix

Member
Member
Joined
Oct 28, 2013
Messages
62
Points
6
Mysidian Dollar
3,427
I have been trying to upload thos script for 7 hrs and i am VERY frustrated. i have installed it how Chibi and G (Forgot her/his name) said to do so. But i keep getting a Syntax line everythime i try to preview my site.

http://antillia.co.nf/index.php


Fatal error: Can't inherit abstract function Resource\Collection\Collective::iterator() (previously declared abstract in Resource\Collection\Collection) in /srv/disk9/1540094/www/antillia.co.nf/classes/resource/collection/collection.php on line 23

I am really frustrated as i have been working on this for 7+hrs continuously.
 
Check the version of your PHP. If it's between PHP 5.3.0 to 5.3.8 I will help you fix 2-3 lines if code to get it to work. If it's PHP 5.2 you will have to upgrade PHP, since the script requires PHP 5.3 or later versions to run.
 
Sorry, but im kind of illiterate how will i go about checking my php version?
 
Assuming uare using a webhost with cpanel, the version of PHP should be readily available to u after logging into the control panel. U can always ask ur webhost for this info too by submitting a ticket. If u are fine with writing PHP code, you can always call phpinfo() to check the version of ur PHP.
 
I see, if u are running PHP 5.3.0 - 5.3.8, u may get this abstract method inheritance error. It's very easy to fix, just open the abstract class files and remove the abstract methods. In ur case for instance, open the collection.php class file and get rid of the abstract method called iterator(). I am sure u need to fix more than this, just keep following the instruction above until all abstract methods causing errors are removed.
 
what do the abstract messages look like? sorry to be a pain but i dont want to ruin it and then have to bombard you with more.
 
If u open the file collection.php in directory classes/resources/collection/.., u should see a method defined as:

PHP:
abstract public function iterator();

Remove this line that declares abstract method should fix this error, but u will likely encounter another error similar to this. You will have to keep repeating what you do with collection class file to the other files that contains abstract methods and remove them if necessary.
 
Fatal error: Can't inherit abstract function Resource\Collection\Collective::size() (previously abstract in Resource\Collection\Collection) in /srv/disk9/1540094/www/antillia.co.nf/classes/resource/collection/collection.php on line 23

i search for other Abstract functions but couldnt find them


edit: Im really frustrated....do you think i could just give you my hosting account and you can take a peek. i'll delete what ive done and start from fresh cause all i did was delete the mehods
 
Last edited:
The other abstract method should be defined like this:

PHP:
abstract public function size();

You may want to search for the keyword 'abstract' or 'abstract public function' to locate the lines you need to edit. Don't give it up, I guarantee you that it's very easy to fix.
 
Fatal error: Can't inherit abstract function Resource\Collection\Mappable::entrySet() (previously abstract in Resource\Collection\Map) in /srv/disk9/1540094/www/antillia.co.nf/classes/resource/collection/map.php on line 22

thats what i get after i deleted those files
 
Yes keep deleting abstract methods until all error messages go away. You may be surprised since you have more than just 1-2 abstract methods to fix, it's just that PHP can only display one error message at a time so you have to remove them one by one by reading the error messages carefully to locate these abstract methods that cause your problem.
 
all abstract messages are deleted. the public functions are still there and i am still getting errors.
 
Umm what are the new errors you get? Note if you just remove the two abstract methods in collection class file its unlikely to work, you will have to search for more.
 
i dont know what im doing, so after i delete the two files, i dont know what im doing, l looked for other abstact codes but theyre are none there. I am wrecking my brain. I dont understand why i am having these issues and no one else seems to...its quite annoying.


Parse error: , unexpected ';', expecting T_FUNCTION in /srv/disk9/1540094/www/antillia.co.nf/classes/resource/collection/collection.php on line 232


line 232 is the last line after im done deleting the files and only has the closing code.
 
Looks like you may have not edited the file properly. Post whatever is in your collection.php file and I will try to identify the problem for you.
 
Code:
<?php

namespace Resource\Collection;
use Resource\Native\Objective;
use Resource\Native\Object;
use Resource\Native\String;
use Resource\Exception\UnsupportedOperationException;

/**
 * The abstract Collection Class, extending from the root Object Class and implements Collective Interface.
 * It is parent to all Collection objects, subclasses have access to all its defined methods.
 * @category Resource
 * @package Collection
 * @author Hall of Famer
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.4
 * @todo Not much at this point.
 * @abstract
 *
 */
 
abstract class Collection extends Object implements Collective{

   /**
     * The add method, append an object to the end of the collection.
   * The method is disabled in abstract collection class, thus child class must implement its own version of add method.
     * @param Objective  $object
     * @access public
     * @return Boolean
     */  
  public function add(Objective $object){
      throw new UnsupportedOperationException;
  }
  
   /**
     * The addAll method, append a collection of objects to the end of the Collection.
     * @param Collective  $collection
     * @access public
     * @return Boolean
     */  
  public function addAll(Collective $collection){
      $added = FALSE;
    foreach($collection as $object){
        if($this->add($object)) $added = TRUE;
    }
    return $added;
  }  

   /**
     * The clear method, drops all objects currently stored in Collection.
     * @access public
     * @return Void
     */        
  public function clear(){
      $iterator = $this->iterator();
    while($iterator->hasNext()){
        $iterator->next();
      $iterator->remove();
    }
  }
  
  /**
     * The contains method, checks if a given object is already on the Collection.
     * @param Objective  $object
     * @access public
     * @return Boolean
     */      
  public function contains(Objective $object){
      $iterator = $this->iterator();    
    while($iterator->hasNext()){
      if($object->equals($iterator->next())) return TRUE;
      }    
    return FALSE;
  }
  
  /**
     * The containsAll method, checks if a collection of objects are all available on the Collection.
     * @param Collective  $collection
     * @access public
     * @return Boolean
     */      
  public function containsAll(Collective $collection){
      foreach($collection as $object){
        if(!$this->contains($object)) return FALSE;
    }
    return TRUE;
  }

  /**
     * The count method, alias to the size() method.
     * @access public
     * @return Int
     */    
  public function count(){
        return $this->size();
    }

  /**
     * The getIterator method, alias to the iterator() method.
     * @access public
     * @return Iterator
     */      
    public function getIterator(){
        return $this->iterator();
    }

  /**
     * The hashCode method, returns the hash code for this collection.
   * The method is disabled in abstract collection class, thus child class must implement its own version of hashCode method.
     * @access public
     * @return String
     */    
  public function hashCode(){
      return NULL;
  }
  
  /**
     * The isEmpty method, checks if the collection is empty or not.
     * @access public
     * @return Boolean
     */    
  public function isEmpty(){
      return ($this->size() == 0);
  }

   /**
     * The remove method, removes a supplied Object from this collection.
     * @param Objective  $object
     * @access public
     * @return Boolean
     */    
  public function remove(Objective $object){
      $iterator = $this->iterator();
    while($iterator->hasNext()){
      if($object->equals($iterator->next())){
          $iterator->remove();
        return TRUE;
      }
      }    
    return FALSE;
  }

   /**
     * The removeAll method, removes a collection of objects from this collection.
     * @param Collective  $collection
     * @access public
     * @return Boolean
     */    
  public function removeAll(Collective $collection){
      $removed = FALSE;
    $iterator = $this->iterator();
    while($iterator->hasNext()){
        if($collection->contains($iterator->next())){
          $iterator->remove();
        $removed = TRUE;
      }
    }
    return $removed;
  }
  
  /**
     * The removeAll method, removes everything but the given collection of objects from this collection.
     * @param Collective  $collection
     * @access public
     * @return Boolean
     */      
  public function retainAll(Collective $collection){
    $retained = FALSE;
    $iterator = $this->iterator();
    while($iterator->hasNext()){
        if(!$collection->contains($iterator->next())){
          $iterator->remove();
        $retained = TRUE;
      }
    }
    return $retained;
  }
  
  /**
     * The toArray method, acquires an array copy of the objects stored in the collection.
     * @access public
     * @return Array
     */        
  public function toArray(){
      $iterator = $this->iterator();
    $size = $iterator->size();
      $array = array();
    for($i = 0; $i < $size; $i++){
        $array[$i] = $iterator->next();
    }
    return $array;
  }
  
  /**
     * The magic method __toString, defines the string expression of the collection.
     * @access public
     * @return String
     */  
  public function __toString(){
      $iterator = $this->iterator();
    if(!$iterator->valid()) return new String("[]");
    
    $stringBuilder = new String("[");
    while($iterator->hasNext()){
        $object = $iterator->next();
      $stringBuilder->add(($object == $this) ? "(this collection)" : $object);
      if(!$iterator->hasNext()) {
          $stringBuilder->add("]");
        return $stringBuilder;
      }
      $stringBuilder->add(", ");
    }
  }

  /**
     * The abstract size method, must be implemented by child class.
     * @access public
     * @return Int
   * @abstract
     */    
   
  
  /**
     * The abstract iterator method, must be implemented by child class.
     * @access public
     * @return Iterator
   * @abstract
     */    
   
}
?>
 
Parse error: , unexpected ';', expecting T_FUNCTION in /srv/disk9/1540094/www/antillia.co.nf/classes/resource/collection/collection.php on line 216

Thats after i deleted the lines.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,132
Members
1,603
Latest member
Monako
BETA

Latest Threads

Top