Domanda

Ho bisogno di installare i moduli in modo che le modifiche al database accadere. Non posso semplicemente lascia che sia una installazione la registrazione al tipo di amministrazione di approccio Ho uno script bash che sto usando a disposizione i miei server di test. Sembra che, come ho clonare i moduli dal mio git repo alcuni di loro non sono installati quindi ho bisogno di installarle con forza nello script php corro che aggiunge i miei negozi di test e cosa no. Ho osservato con ogni sorta di classe e la migliore che ho trovato è

isModuleOutputEnabled ()

Ma questo non sta per tagliarlo. Idee su come fare un energico installano?


possibile identificazione del problema

Sembra che semplice svuotare la cache e chiamando il Mage::app() e anche cercando di accedere a un utente admin non riesce ad innescare i moduli da installare. Ma se si cancella la cache a mano, proprio prima della prima volta che si va alla schermata di login / admin, allora installerà le cose come ci si aspetterebbe. Come ancora ottenere pagina (wget) prima di cancellare la cache non riesce anche per installare i moduli.


Update 1

Ho cercato di fare un po 'forzando qui, ma non ottengo quello che sta succedendo ... la multa estensioni carico quando io aspetto fino a dopo la nuova installazione e sufficiente posizionare i file nelle cartelle, ma quando ho clone in anticipo non vedo nella tabella core_resource o la tabella per i moduli. Esempio di prova per il posto script di installazione è

$resource = Mage::getSingleton('core/resource');
$modules = Mage::getConfig()->getNode('modules')->children();
$modulesArray = (array)$modules;
echo "Test modules";
if(isset($modulesArray['Aoe_AsyncCache'])) {
    echo "AsyncCache exists.";
    $tableName = $resource->getTableName('asynccache');

    /**
     * if prefix was 'mage_' then the below statement
     * would print out mage_catalog_product_entity
     */
    echo "known as ".$tableName;
} else {
    echo "AsyncCachedoesn't exist.";
}  

Quando imbattuto vedo AsyncCache exists. known as 'asynccache' Eppure non è nel database. Questo tavolo non è stato installato. Non di nuovo, il modulo non installare bene se aspetto ... Ma stranamente, se faccio questo git clone, non è mai installato. Sono davvero sicuro che cosa sta succedendo.


Update 2

I sembra che non viene installato alcun modulo che ha una base di dati legato ad esso. Quindi fondo su ciò che sta accadendo. Sto usando vagrant ed è su un URL di http://local.mage.dev come URL. Ora, quando uso la sceneggiatura provision.sh, l'ho installato Magento dal ssh. I non in stallo. Ma un grande esempio del problema è che quando ho quindi un semplice,

./mage config-set preferred_state alpha
./mage clear-cache
./mage sync
./mage download community BL_CustomGrid
./mage install community BL_CustomGrid

La tabella non è installato. Non capisco perché. Magento è installato. Se aspetto il primo registro nella posso usare connect per fare l'installazione. Ottengo avviso sulla riga di comando che ha installare il BL_CustomeGrid bene, ma non è ... i tavoli non ci sono.


Update3

Ho cercato di combinare tutti i suggerimenti per uno. Ho l'applicazione Mage essere richiamato dopo ogni clone GitHub, quindi la cache viene cancellata. Ho poi svuotare la cache per l'ultima volta prima di andare al login. Non riesco a vedere per ottenere il tavolo installato. Ho quasi chiedo se ha qualcosa a che fare con il vagabondo, ma sembra improbabile essere che Magento viene installato. Ma la prova di quello che ho fatto, qui è la sub domanda a chiamare lo script php che sta facendo nulla, ma invocando mago e svuotare la cache.


Update4

Nota importante:

Non ho solo fatto un test in cui mi ha ribadito che se faccio l'installazione dopo l'installazione del Magento. Il registro normale, caricare i file, cancellare la cache, log out, log indietro e viene installato il modulo. MA quando aggiungo un livello di codice di login dell'utente amministratore, mi associo che l'utente è loggate, e anche tu a cancellare la cache, non riesce ancora.

L'obiettivo è quello, ho bisogno di trovare la install('module_name') o qualcosa del genere, o due, essere in grado di fare al 100% quello che accade quando l'utente l'azzeramento dei cache e accede nuovamente fuori.

replica programmatico di come un modulo è installato sappiamo (logout, cancellare la cache, ecc ..) non



Gli script in gioco

Lo scriptche richiama install-Invoke-app.php E quindi non c'è contesto completo, ecco il function.sh che si chiama e dove si può vedere che l'invocazione di Mage è fatto

provision.sh Questo è quello che viene chiamato da vagrant che configura il mio banco di prova e installare un Magento installazione completa a livello di codice

start_seconds=`date +%s`
echo -en "\a" > /dev/tty5 | echo -e "\a"
cd /srv/www/
. scripts/install-functions.sh

if [[ has_network ]]
then
    apt-get install pv

    cd /srv/www/
    . scripts/install-prep.sh

    cd /srv/www/
    . scripts/main-install.sh

else
    echo -e "\nNo network connection available, skipping package installation"
fi

#double check the network
if [[ has_network ]]
then

    #check and install wp
    cd /srv/www/
    . scripts/db-install.sh   

    #check and install magento
    cd /srv/www/
    . scripts/mage-install.sh      

else
    echo -e "\nNo network available, skipping network installations"
fi
# Add any custom domains to the virtual machine's hosts file so that it
# is self-aware. Enter domains space delimited as shown with the default.
DOMAINS='local.mage.dev'
if ! grep -q "$DOMAINS" /etc/hosts
then echo "127.0.0.1 $DOMAINS" >> /etc/hosts
fi

end_seconds=`date +%s`
echo "-----------------------------"

install-functions.sh Questo è solo alcune delle funzioni di questo script bash. E 'solo quello che viene utilizzato in questa serie di server di installazione. Si noti che questo è dove stiamo chiamando php "/srv/www/scripts/mage/install-invoke-app.php", che è quello che dovrebbe essere richiamando il MAGE e l'installazione di tutti i moduli. Ora le estensioni dovrebbero essere stati installati a livello di codice. Questo non sta accadendo.

install_repo(){
    if [ $2 ]
    then
        echo "just 1"
        git clone $1 -q
    else
        echo "just 1 and 2"
        git clone $1 $2 -q
    fi
    success=$?
    if [[ $success -eq 0 ]];
    then
        echo "Repository successfully cloned."
        echo "cleaning"
        cd $r/
        rm -rf LICENSE.txt STATUS.txt README.md RELEASE_NOTES.txt modman
        cd ../
        cp -af $r/* .
        rm -rf $r/

        #eval $3
        php "/srv/www/scripts/mage/install-invoke-app.php"

        #if [ -z "$3" ]
        #then
        #    echo "no callback"
        #else
        #    eval $3
        #fi
    else
        echo "Something went wrong!"
    fi
    sleep 1 # slow it down to insure that we have the items put in place.
}

#declare -A list = ( [repo]=gitUser )
install_repolist(){
    gitRepos=$1
    for r in "${!gitRepos[@]}" #loop with key as the var
    do
        giturl="git://github.com/${gitRepos[$r]}/$r.git"
        echo "Adding $r From $giturl"
        if [ -z "$r" ];
        then
            echo
        else
            install_repo $giturl $2 $3
        fi
        echo
    done
    return 1
}

install-mage.sh Questo è chiamato dopo che lo script provision.sh ha installato tutti i principi fondamentali del server. Si dovrebbe già avere nginx e php5 / php-fpm e tutto il resto dei moduli necessari.

#!/bin/bash
cd /srv/www/mage/ #move to the root web folder


dbhost="localhost"
dbname="mage"
dbuser="devsqluser"
dbpass="devsqluser"
url="local.mage.dev"
adminuser="admin"
adminpass="admin2013"
adminfname="Mc"       
adminlname="Lovin"
adminemail="test.user@wsu.edu"

echo
echo "We will clear any past install"
echo
echo "--Clear old caches reports and sessions"
cd /srv/www/mage/ #move to the root web folder
rm -rf ./var/cache/* ./var/session/* ./var/report/* ./var/locks/*
rm -rf ./var/log/* ./app/code/core/Zend/Cache/* ./media/css/* ./media/js/*
echo
if [ -f /srv/www/scripts/mage/clean.sql ]
then
    mysql -u root -pblank $dbname < /srv/www/scripts/mage/clean.sql | echo -e "\n Initial custom mage cleaning MySQL scripting..."
else
    echo -e "\n COUNLDN'T FIND THE CLEANER SQL FILE"
fi



echo "Now installing Magento with sample data..."



#chack to see if there is already the files ready for instalation
if [ ! -f /srv/www/mage/app/Mage.php ]
then

    if [ ! -f /srv/www/mage/magento-1.7.0.2.tar.gz ]
    then

        echo
        echo "didn't find the packages, so now Downloading them..."
        echo

        wget http://www.magentocommerce.com/downloads/assets/1.7.0.2/magento-1.7.0.2.tar.gz
        wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    fi

    echo
    echo "Extracting data..."
    echo    
        pv -per magento-1.7.0.2.tar.gz | tar xzf - -C ./
        pv -per magento-sample-data-1.6.1.0.tar.gz | tar xzf - -C ./

    echo
    echo "Moving files..."
    echo        
        cp -af magento-sample-data-1.6.1.0/media/* media/
        cp -af magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql data.sql
        cp -af magento/* magento/.htaccess .

        cd /srv/www/mage/ #move to the root web folder
    echo
    echo "Setting permissions..."
    echo

    chmod o+w var var/.htaccess app/etc
    chmod -R o+w media

fi

echo
echo "Installing Adminer..."
if [ ! -f /srv/www/mage/adminer.php ]
then
    wget http://downloads.sourceforge.net/adminer/adminer-3.7.1-mysql-en.php > adminer.php
fi

echo
echo "Importing sample products..."
mysql -h $dbhost -u $dbuser -p$dbpass $dbname < data.sql




#pear mage-setup .
#pear install magento-core/Mage_All_Latest-stable

#./mage mage-setup .
#./mage config-set preferred_state stable

echo
echo "Initializing PEAR registry..."


pear mage-setup .

echo
echo "Downloading packages..."


pear install magento-core/Mage_All_Latest


echo
echo "Cleaning up files..."


rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -rf magento/ magento-sample-data-1.6.1.0/
#rm -rf magento-1.7.0.2.tar.gz magento-sample-data-1.6.1.0.tar.gz data.sql
rm -rf index.php.sample .htaccess.sample php.ini.sample LICENSE.txt
rm -rf STATUS.txt LICENSE.html LICENSE_AFL.txt  RELEASE_NOTES.txt

echo
echo "Installing Magento..."

    php -f install.php --\
    --license_agreement_accepted yes \
    --locale en_US \
    --timezone America/Los_Angeles \
    --default_currency USD \
    --db_host $dbhost \
    --db_name $dbname \
    --db_user $dbuser \
    --db_pass $dbpass \
    --url $url \
    --use_rewrites yes \
    --skip_url_validation yes \
    --use_secure no \
    --secure_base_url "" \
    --use_secure_admin no \
    --admin_firstname "$adminfname" \
    --admin_lastname "$adminlname" \
    --admin_email "$adminemail" \
    --admin_username "$adminuser" \
    --admin_password "$adminpass"

if [ ! -f /srv/www/mage/app/etc/local.xml ]
then
    echo "failed install try it again"
else


    if [ -f /srv/database/init-mage.sql ]
    then
        mysql -u root -pblank < /srv/database/init-mage.sql | echo -e "\nInitial custom mage MySQL scripting..."
    else
        echo -e "\nNo custom MySQL scripting found in database/init-mage.sql, skipping..."
    fi

    cd /srv/www/mage/
    echo "Starting to import base WSU modules from connect"
    #./mage install http://connect20.magentocommerce.com/community Flagbit_ChangeAttributeSet
    ./mage config-set preferred_state alpha
    ./mage clear-cache
    ./mage sync
    ./mage download community Flagbit_ChangeAttributeSet
    ./mage download community BL_CustomGrid
    ./mage install community Flagbit_ChangeAttributeSet
    #./mage install community BL_CustomGrid


    echo "Starting to import base WSU modules fro github"
    declare -A gitRepos
    #[repo]=gitUser
    gitRepos=(
        [wsu_admin_base]=jeremyBass
        [wsu_base_theme]=jeremyBass
        [Storeutilities]=jeremyBass
        [StructuredData]=jeremyBass
        #[Storeuser]=jeremyBass
        [sitemaps]=jeremyBass
        [webmastertools]=jeremyBass 
        [ldap]=jeremyBass 
        [Aoe_FilePicker]=jeremyBass         #https://github.com/fbrnc/Aoe_FilePicker.git
        [Aoe_ClassPathCache]=jeremyBass     #https://github.com/fbrnc/Aoe_ClassPathCache.git
        [Aoe_Profiler]=jeremyBass           #https://github.com/fbrnc/Aoe_Profiler.git
        [Aoe_ManageStores]=jeremyBass       #https://github.com/fbrnc/Aoe_ManageStores.git
        [Aoe_LayoutConditions]=jeremyBass   #https://github.com/fbrnc/Aoe_LayoutConditions.git
        [Aoe_AsyncCache]=jeremyBass         #https://github.com/fbrnc/Aoe_AsyncCache.git
        [Aoe_ApiLog]=jeremyBass             #https://github.com/fbrnc/Aoe_ApiLog.git
        #[mage-enhanced-admin-grids]=mage-eag
    )
    cd /srv/www/mage/
    install_repolist $gitRepos 0 "wget http://$url"
    unset gitRepos         #unset and re-declare to clear associative arrays
    declare -A gitRepos

    cd /srv/www/mage/

    echo "importing WSU favicon"
    wget -q http://images.dev.edu/favicon.ico -O favicon.ico

    #run actions that are hard to do direct sql quries on 

    php /srv/www/scripts/mage/install-post.php


    echo
    echo "doing the first index"
    echo
    cd shell && php -f indexer.php reindexall


    mysql -u root -pblank $dbname -e "DELETE FROM $dbname.adminnotification_inbox;" | echo -e "\n >> Removed admin notifications ..."

    # Enable developer mode
    #if [ $MAG_DEVELOPER_MODE == 1 ]; then
    #    sed -i -e '/Mage::run/i\
    #Mage::setIsDeveloperMode(true);
    #' -e '1,$s//Mage::run/' $WWW_PATH/index.php
    #fi


    echo
    echo "Finished installing Magento"
    echo

 fi

install-post.php Questo file avviene dopo che il file install-mage.sh ha completato l'installazione di Magento. Tutti i moduli sono stati scaricati e che cosa abbiamo bisogno è di aver avuto tutte le tabelle del modulo installato. IE: le installazioni SQL per i moduli avrebbe dovuto essere gestito da ormai

<?php
//just as a guide, no real purpose
echo getcwd() . " (working from)\n";

//set up the store instance
require_once "app/Mage.php";
umask(0);
Mage::app();
Mage::app()->getTranslator()->init('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));
Mage::registry('isSecureArea'); // acting is if we are in the admin
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getConfig()->init();
/**
 * Get the resource model
 */
$resource = Mage::getSingleton('core/resource');

/**
 * Retrieve the read connection
 */
$readConnection = $resource->getConnection('core_read');

/**
 * Retrieve the write connection
 */
$writeConnection = $resource->getConnection('core_write');

// switch off error reporting
error_reporting ( E_ALL & ~ E_NOTICE );

$changeData = new Mage_Core_Model_Config();

echo "applying default store settings\n";
//pattern
//\((.*?),  '(.*?)',    (.*?),  '(.*?)',    '?(.*?)'?\),
//$changeData->saveConfig('$4', "$5", 'default', 0);
echo " - applying design settings\n";
    $changeData->saveConfig('design/package/name', "wsu_base", 'default', 0);
    $changeData->saveConfig('design/theme/template', "default", 'default', 0);
    $changeData->saveConfig('design/theme/skin', "default", 'default', 0);
    $changeData->saveConfig('design/theme/layout', "default", 'default', 0);
    $changeData->saveConfig('design/theme/default', "default", 'default', 0);
    $changeData->saveConfig('design/theme/locale', "NULL", 'default', 0);

function make_store($categoryName,$site,$store,$view){
    //#adding a root cat for the new store we will create
    // Create category object
    $category = Mage::getModel('catalog/category');
    $category->setStoreId(0); // No store is assigned to this category

    $rootCategory['name'] = $categoryName;
    $rootCategory['path'] = "1"; // this is the catgeory path - 1 for root category
    $rootCategory['display_mode'] = "PRODUCTS";
    $rootCategory['is_active'] = 1;

    $category->addData($rootCategory);
    $rootCategoryId=0;
    try {
        $category->save();
        $rootCategoryId = $category->getId();
    }
        catch (Exception $e){
        echo $e->getMessage();
    }
    if($rootCategoryId>0){
    //#addWebsite
        /** @var $website Mage_Core_Model_Website */
        $website = Mage::getModel('core/website');
        $website->setCode($site['code'])
            ->setName($site['name'])
            ->save();

    //#addStoreGroup
        /** @var $storeGroup Mage_Core_Model_Store_Group */
        $storeGroup = Mage::getModel('core/store_group');
        $storeGroup->setWebsiteId($website->getId())
            ->setName($store['name'])
            ->setRootCategoryId($rootCategoryId)
            ->save();

    //#addStore
        /** @var $store Mage_Core_Model_Store */
        $store = Mage::getModel('core/store');
        $store->setCode($view['code'])
            ->setWebsiteId($storeGroup->getWebsiteId())
            ->setGroupId($storeGroup->getId())
            ->setName($view['name'])
            ->setIsActive(1)
            ->save();
    }
    return $rootCategoryId;
}
echo "Applying the default multi-store setup\n";
$installed_stores = array();
$installed_stores['studentstore'] = make_store("Student store root",
                array('code'=>'studentstore','name'=>'Student store'),
                array('name'=>'Student Store'),
                array('code'=>'studentstore','name'=>'base default veiw')
              );
$installed_stores['teststore'] = make_store("Test store root",
                array('code'=>'teststore','name'=>'Test store'),
                array('name'=>'Test Store'),
                array('code'=>'teststore','name'=>'base default veiw')
              );

// let us refresh the cache
try {
    $allTypes = Mage::app()->useCache();
    foreach($allTypes as $type => $blah) {
      Mage::app()->getCacheInstance()->cleanType($type);
    }
} catch (Exception $e) {
    // do something
    error_log($e->getMessage());
}

$types = Mage::app()->getCacheInstance()->getTypes();
try {
    echo "Cleaning data cache... \n";
    flush();
    foreach ($types as $type => $data) {
        echo "Removing $type ... ";
        echo Mage::app()->getCacheInstance()->clean($data["tags"]) ? "[OK]" : "[ERROR]";
        echo "\n";
    }
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}

echo "\n";

try {
    echo "Cleaning stored cache... ";
    flush();
    echo Mage::app()->getCacheInstance()->clean() ? "[OK]" : "[ERROR]";
    echo "\n\n";
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}

$modules = Mage::getConfig()->getNode('modules')->children();
$modulesArray = (array)$modules;
echo "Test modules";
if(isset($modulesArray['Aoe_AsyncCache'])) {
    echo "AsyncCache exists.";
    $tableName = $resource->getTableName('asynccache');

    /**
     * if prefix was 'mage_' then the below statement
     * would print out mage_catalog_product_entity
     */
    echo "known as ".$tableName;
} else {
    echo "AsyncCachedoesn't exist.";
}   

install-Invoke-app.php

<?php
//just as a guide, no real purpose
echo getcwd() . " (working from)\n";

//set up the store instance
require_once "app/Mage.php";
umask(0);
Mage::app();
Mage::app()->getTranslator()->init('frontend');
Mage::getSingleton('core/session', array('name' => 'frontend'));
Mage::registry('isSecureArea'); // acting is if we are in the admin
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getConfig()->init();

// switch off error reporting
error_reporting ( E_ALL & ~ E_NOTICE );

// let us refresh the cache
try {
    $allTypes = Mage::app()->useCache();
    foreach($allTypes as $type => $blah) {
      Mage::app()->getCacheInstance()->cleanType($type);
    }
} catch (Exception $e) {
    // do something
    error_log($e->getMessage());
}


$types = Mage::app()->getCacheInstance()->getTypes();
try {
    echo "Cleaning data cache... \n";
    flush();
    foreach ($types as $type => $data) {
        echo "Removing $type ... ";
        echo Mage::app()->getCacheInstance()->clean($data["tags"]) ? "[OK]" : "[ERROR]";
        echo "\n";
    }
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}

echo "\n";

try {
    echo "Cleaning stored cache... ";
    flush();
    echo Mage::app()->getCacheInstance()->clean() ? "[OK]" : "[ERROR]";
    echo "\n\n";
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}
echo "finish invoking the mage app.";

//time to login as admin
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getSingleton('core/session', array('name' => 'adminhtml'));

// supply username
$user = Mage::getModel('admin/user')->loadByUsername('admin'); // user your admin username

if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {
   Mage::getSingleton('adminhtml/url')->renewSecretUrls();
}

$session = Mage::getSingleton('admin/session');
$session->setIsFirstVisit(true);
$session->setUser($user);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());
Mage::dispatchEvent('admin_session_user_login_success',array('user'=>$user));
if ($session->isLoggedIn()) { echo "Logged in \n"; } else{ echo "Not Logged \n"; }
È stato utile?

Soluzione

Risposta

Si scopre che solo svuotare la cache e facendo un wget, o effettua il login di un utente a livello di codice, o addirittura entrambi non è stato sufficiente per far scattare il codice per l'installazione di un modulo.

Questo è ciò che funziona.

rm -rf var/cache/*
php "/srv/www/mage/index.php"

Dove /mage è la cartella radice negozio, ho solo bisogno di eseguire il file index.php e poi ha funzionato. Non posso dire il motivo per cui non sarebbe in wget, o perché chiamando MAGE:app() e tutte le combinazioni non ha funzionato, ma di compensazione la cartella della cache e chiamando il file è il biglietto per la ricostruzione in modo stabile la cache dalla riga di comando.

Spero che questo consente di risparmiare qualcuno un po 'di tempo. Acclamazioni

Altri suggerimenti

Non sono sicuro se ho ricevuto la tua domanda giusta, ma se si vuole script di installazione grilletto w / o l'apertura del sito nel proprio browser perché non basta creare lo script di shell che sarà solo wget home page della vostra installazione di Magento?

È possibile utilizzare il seguente script php per cancellare la cache dalla linea di comando dopo aver applicato tutti gli aggiornamenti attraverso git. Dopo questo è possibile utilizzare wget per ottenere la home page del tuo sito per ricostruire la cache ed eseguire tutte le modifiche apportate al database.

(codice http://www.yameveo.com/development/php/flush-every-magento-cache-from-the-command-line ):

<?php
date_default_timezone_set("Europe/Madrid");
echo "Start Cleaning all caches at ... " . date("Y-m-d H:i:s") . "\n\n";
ini_set("display_errors", 1);

require '../app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false);
Mage::getConfig()->init();

$types = Mage::app()->getCacheInstance()->getTypes();

try {
    echo "Cleaning data cache... \n";
    flush();
    foreach ($types as $type => $data) {
        echo "Removing $type ... ";
        echo Mage::app()->getCacheInstance()->clean($data["tags"]) ? "[OK]" : "[ERROR]";
        echo "\n";
    }
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}

echo "\n";

try {
    echo "Cleaning stored cache... ";
    flush();
    echo Mage::app()->getCacheInstance()->clean() ? "[OK]" : "[ERROR]";
    echo "\n\n";
} catch (exception $e) {
    die("[ERROR:" . $e->getMessage() . "]");
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange
scroll top