[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/phing/system/util/ -> Register.php (sommaire)

(pas de description)

Poids: 115 lignes (3 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 2 classes

Register:: (1 méthode):
  getSlot()

RegisterSlot:: (5 méthodes):
  __construct()
  setKey()
  getKey()
  setValue()
  getValue()


Classe: Register  - X-Ref

Static class to handle a slot-listening system.

Unlike the slots/signals Qt model, this class manages something that is
more like a simple hashtable, where each slot has only one value.  For that
reason "Registers" makes more sense, the reference being to CPU registers.

This could be used for anything, but it's been built for a pretty specific phing
need, and that is to allow access to dynamic values that are set by logic
that is not represented in a build file.  For exampe, we need a system for getting
the current resource (file) that is being processed by a filterchain in a fileset.

Each slot corresponds to only one read-only, dynamic-value RegisterSlot object. In
a build.xml register slots are expressed using a syntax similar to variables:

<replaceregexp>
<regexp pattern="\n" replace="%{task.current_file}"/>
</replaceregexp>

The task/type must provide a supporting setter for the attribute:

<code>
function setListeningReplace(RegisterSlot $slot) {
$this->replace = $slot;
}

// in main()
if ($this->replace instanceof RegisterSlot) {
$this->regexp->setReplace($this->replace->getValue());
} else {
$this->regexp->setReplace($this->replace);
}
</code>

getSlot($key)   X-Ref
Returns RegisterSlot for specified key.

If not slot exists a new one is created for key.

param: string $key
return: RegisterSlot

Classe: RegisterSlot  - X-Ref

Represents a slot in the register.

__construct($key)   X-Ref
Constructs a new RegisterSlot, setting the key to passed param.

param: string $key

setKey($k)   X-Ref
Sets the key / name for this slot.

param: string $k

getKey()   X-Ref
Gets the key / name for this slot.

return: string

setValue($v)   X-Ref
Sets the value for this slot.

param: mixed

getValue()   X-Ref
Returns the value at this slot.

return: mixed



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7