src/CarteBlanche/App/Container.php
public function set($name, $object, $force_overload = false)
    {
        if (!is_object($object)) {
            throw new DomainException(
                sprintf('A container entry must be an object (got "%s" for "%s")!', gettype($object), $name)
            );
        }
        if (true===$this->instances->isEntry($name) && true!==$force_overload) {
            throw new InvalidArgumentException(
                sprintf('You can not over-write a container entry (for "%s")!', $name)
            );
        }
        return (Boolean) $this->instances->setEntry($name, $object);
    }
public function set($name, $object, $force_overload = false)
    {
        if (!is_object($object)) {
            throw new DomainException(
                sprintf('A container entry must be an object (got "%s" for "%s")!', gettype($object), $name)
            );
        }
        if (true===$this->instances->isEntry($name) && true!==$force_overload) {
            throw new InvalidArgumentException(
                sprintf('You can not over-write a container entry (for "%s")!', $name)
            );
        }
        return (Boolean) $this->instances->setEntry($name, $object);
    }
Global setter

@param   string  $name           The variable name to set
@param   object  $object         The object to set
@param   bool    $force_overload Over-write an existing value ?
@return  bool
@throws  \CarteBlanche\Exception\DomainException if `$object` is not an object
@throws  \CarteBlanche\Exception\InvalidArgumentException if the entry is already defined and `$force_overload = false`