public static function enable($name)
    {
        $obj = self::getInstance($name);

        // If not installed, install it
        if (self::__requiresInstallation($name) && $obj->install() === false) {
            // If the installation failed, run the uninstall method which
            // should rollback the install method. #1326
            $obj->uninstall();
            return false;

            // If the extension requires updating before enabling, then update it
        } elseif (($about = self::about($name)) && ($previousVersion = self::__requiresUpdate($name, $about['version'])) !== false) {
            $obj->update($previousVersion);
        }

        if (!isset($about)) {
            $about = self::about($name);
        }

        $id = self::fetchExtensionID($name);

        $fields = array(
            'name' => $name,
            'status' => 'enabled',
            'version' => $about['version']
        );

        // If there's no $id, the extension needs to be installed
        if (is_null($id)) {
            Symphony::Database()->insert($fields, 'tbl_extensions');
            self::__buildExtensionList(true);

            // Extension is installed, so update!
        } else {
            Symphony::Database()->update($fields, 'tbl_extensions', sprintf(" `id` = %d ", $id));
        }

        self::registerDelegates($name);

        // Now enable the extension
        $obj->enable();

        return true;
    }
public static function enable($name)
    {
        $obj = self::getInstance($name);

        // If not installed, install it
        if (self::__requiresInstallation($name) && $obj->install() === false) {
            // If the installation failed, run the uninstall method which
            // should rollback the install method. #1326
            $obj->uninstall();
            return false;

            // If the extension requires updating before enabling, then update it
        } elseif (($about = self::about($name)) && ($previousVersion = self::__requiresUpdate($name, $about['version'])) !== false) {
            $obj->update($previousVersion);
        }

        if (!isset($about)) {
            $about = self::about($name);
        }

        $id = self::fetchExtensionID($name);

        $fields = array(
            'name' => $name,
            'status' => 'enabled',
            'version' => $about['version']
        );

        // If there's no $id, the extension needs to be installed
        if (is_null($id)) {
            Symphony::Database()->insert($fields, 'tbl_extensions');
            self::__buildExtensionList(true);

            // Extension is installed, so update!
        } else {
            Symphony::Database()->update($fields, 'tbl_extensions', sprintf(" `id` = %d ", $id));
        }

        self::registerDelegates($name);

        // Now enable the extension
        $obj->enable();

        return true;
    }
public static function enable ( $ name ) { $ obj = self :: getInstance ( $ name ) ; // If not installed, install it if ( self :: __requiresInstallation ( $ name ) && $ obj -> install ( ) === false ) { // If the installation failed, run the uninstall method which // should rollback the install method. #1326 $ obj -> uninstall ( ) ; return false ; // If the extension requires updating before enabling, then update it } elseif ( ( $ about = self :: about ( $ name ) ) && ( $ previousVersion = self :: __requiresUpdate ( $ name , $ about [ 'version' ] ) ) !== false ) { $ obj -> update ( $ previousVersion ) ; } if ( ! isset ( $ about ) ) { $ about = self :: about ( $ name ) ; } $ id = self :: fetchExtensionID ( $ name ) ; $ fields = array ( 'name' => $ name , 'status' => 'enabled' , 'version' => $ about [ 'version' ] ) ; // If there's no $id, the extension needs to be installed if ( is_null ( $ id ) ) { Symphony :: Database ( ) -> insert ( $ fields , 'tbl_extensions' ) ; self :: __buildExtensionList ( true ) ; // Extension is installed, so update! } else { Symphony :: Database ( ) -> update ( $ fields , 'tbl_extensions' , sprintf ( " `id` = %d " , $ id ) ) ; } self :: registerDelegates ( $ name ) ; // Now enable the extension $ obj -> enable ( ) ; return true ; }
Enabling an extension will re-register all it's delegates with Symphony.
It will also install or update the extension if needs be by calling the
extensions respective install and update methods. The enable method is
of the extension object is finally called.

@see toolkit.ExtensionManager#registerDelegates()
@see toolkit.ExtensionManager#__canUninstallOrDisable()
@param string $name
The name of the Extension Class minus the extension prefix.
@throws SymphonyErrorPage
@throws Exception
@return boolean
Enabling an extension will re - register all it s delegates with Symphony . It will also install or update the extension if needs be by calling the extensions respective install and update methods . The enable method is of the extension object is finally called .