autoloader
[ class tree: autoloader ] [ index: autoloader ] [ all elements ]

Class: AutoloaderIndex

Source Location: /classes/index/AutoloaderIndex.php

Class Overview


The AutoloaderIndex stores the location of class defintions for speeding up recurring searches.


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (C) 2010 Markus Malkusch

Methods


Child classes:

AutoloaderIndex_PDO
The index is a PDO object.
AutoloaderIndex_SerializedHashtable
The index is a serialized hashtable.
AutoloaderIndex_Dummy
A Dummy implementation without any persistent abilities.

Class Details

[line 34]
The AutoloaderIndex stores the location of class defintions for speeding up recurring searches.

Searching a class definition in the filesystem takes a lot of time, as every file is read. To avoid these long searches, a found class definition will be stored in an index. The next search for an already found class definition will take no time.




Tags:

author:  Markus Malkusch <markus@malkusch.de>
version:  1.0
copyright:  Copyright (C) 2010 Markus Malkusch
abstract:  


[ Top ]


Class Methods


destructor __destruct [line 124]

void __destruct( )

Destruction of this index will make changes persistent.



Tags:

see:  AutoloaderIndex::save()
throws:  AutoloaderException_Index
access:  public


[ Top ]

method delete [line 69]

void delete( )

Deletes the index



Tags:

abstract:  
throws:  AutoloaderException_Index
access:  public


Overridden in child classes as:

AutoloaderIndex_PDO::delete()
deletes the relation autoloadindex.
AutoloaderIndex_SerializedHashtable::delete()
Deletes the index file
AutoloaderIndex_Dummy::delete()
Does nothing

[ Top ]

method getContext [line 179]

String getContext( )

The Autoloader class path context

Only Autoloaders with an equal class path configuration work in the same context.




Tags:

return:  A context to distinguish different autoloaders
access:  protected


[ Top ]

method getPath [line 57]

String getPath( String $class)



Tags:

return:  The absolute path of the found class $class
abstract:  
throws:  AutoloaderException_Index
throws:  AutoloaderException_Index_NotFound the class is not in the index
access:  public


Overridden in child classes as:

AutoloaderIndex_PDO::getPath()
AutoloaderIndex_SerializedHashtable::getPath()
AutoloaderIndex_Dummy::getPath()

Parameters:

String   $class  

[ Top ]

method hasPath [line 63]

bool hasPath( String $class)



Tags:

return:  True if the class $class is already stored in the index
abstract:  
throws:  AutoloaderException_Index
access:  public


Overridden in child classes as:

AutoloaderIndex_PDO::hasPath()
AutoloaderIndex_SerializedHashtable::hasPath()
AutoloaderIndex_Dummy::hasPath()

Parameters:

String   $class  

[ Top ]

method save [line 105]

void save( )

Makes the changes to the index persistent.

The destructor is calling this method.




Tags:

see:  AutoloaderIndex::__destruct()
see:  AutoloaderIndex::_unsetPath()
see:  AutoloaderIndex::_setPath()
abstract:  
throws:  AutoloaderException_Index
access:  public


Overridden in child classes as:

AutoloaderIndex_PDO::save()
Does nothing as _setPath() and _unsetPath() stored imediatly.
AutoloaderIndex_SerializedHashtable::save()
AutoloaderIndex_Dummy::save()
Does nothing

[ Top ]

method setAutoloader [line 113]

void setAutoloader( Autoloader $autoloader)

The Autoloader calls this to set itself to this index.



Tags:

see:  Autoloader::setIndex()
access:  public


Parameters:

Autoloader   $autoloader  

[ Top ]

method setPath [line 146]

void setPath( String $class, String $path)

Set the path for the class $class to $path

This must not yet be persistent to the index. The Destructor will call save() to make it persistent.




Tags:

see:  AutoloaderIndex::unsetPath()
see:  AutoloaderIndex::_setPath()
see:  AutoloaderIndex::__destruct()
see:  AutoloaderIndex::save()
throws:  AutoloaderException_Index
access:  public


Parameters:

String   $class  
String   $path  

[ Top ]

method unsetPath [line 165]

void unsetPath( String $class)

Unset the path for the class

This must not yet be persistent to the index. The Destructor will call save() to make it persistent.




Tags:

see:  AutoloaderIndex::save()
see:  AutoloaderIndex::setPath()
see:  AutoloaderIndex::__destruct()
see:  AutoloaderIndex::_unsetPath()
throws:  AutoloaderException_Index
access:  public


Parameters:

String   $class  

[ Top ]

method _setPath [line 82]

void _setPath( String $class, String $path)

Set the path for the class $class to $path

This must not yet be persistent to the index. The Destructor will call save() to make it persistent.




Tags:

see:  AutoloaderIndex::save()
see:  AutoloaderIndex::_unsetPath()
abstract:  
throws:  AutoloaderException_Index
access:  protected


Overridden in child classes as:

AutoloaderIndex_PDO::_setPath()
Stores the path imediatly persistent.
AutoloaderIndex_SerializedHashtable::_setPath()
AutoloaderIndex_Dummy::_setPath()

Parameters:

String   $class  
String   $path  

[ Top ]

method _unsetPath [line 94]

void _unsetPath( String $class)

Unset the path for the class $class.

This must not yet be persistent to the index. The Destructor will call save() to make it persistent.




Tags:

see:  AutoloaderIndex::_setPath()
see:  AutoloaderIndex::save()
abstract:  
throws:  AutoloaderException_Index
access:  protected


Overridden in child classes as:

AutoloaderIndex_PDO::_unsetPath()
Deletes the path imediatly persistent.
AutoloaderIndex_SerializedHashtable::_unsetPath()
AutoloaderIndex_Dummy::_unsetPath()

Parameters:

String   $class  

[ Top ]


Documentation generated on Fri, 27 Nov 2009 11:36:38 +0100 by phpDocumentor 1.4.3