Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

3D

INTERN

ADOBE

ARDUINO

BITBUCKET

DOCKER

C4D

GIT

HTML

IPHONE

JAVASCRIPT

JTL-SHOP

LARAVEL

MAGENTO2

MYSQL

PHP

PLESK

PROCESSING

PYTHON

SUITECRM

SEO

TRYTON

THUNDERBIRD / ICEDOVE / FossaMail

TYPO3

TYPO3: BACKEND

TYPO3: TYPOSCRIPT

UNIX

VLC

VVVV

WINDOWS

WINDOWS 10

WORDPRESS

XAMPP

XT:C 4 (Veyton)

batch-script-to-start-new-wordpress-project

Dies ist eine alte Version des Dokuments!


batch Script to start new wordpress project

Prerequisits

  • wget for windows in path [1]
  • 7zip is installed [2]

script

@echo off

:: check if mysql is running
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld.exe">NUL
if "%ERRORLEVEL%"=="0" (
    goto continue
) else (
    goto sql_not_running
)
 
:continue
:: get data
set /p dbPassword= Please give mysql password (for user: root):
set /p projectName= Please give projectname (will be used to create database): 
set dbName= lokal_wp_%projectName%
set projectDir= %dbName%
echo database and projectDir will be: %dbName%

:: generate directory structure
mkdir %projectDir%\backups %projectDir%\clientdata %projectDir%\psd
mkdir %projectDir%\backups\sql

:: fetch wordpress (german)
wget --no-check-certificate https://de.wordpress.org/latest-de_DE.zip -O %projectDir%\latest-de_DE.zip
 
"C:\Program Files\7-Zip\7z.exe" x %projectDir%\latest-de_DE.zip -oC:\xampp\htdocs\%projectDir%\

:: create database for cli parameter (projectname)
set dbUser=root
 
set dbName= lokal_wp_%projectName%
 
mysqladmin -u%dbUser% -p%dbPassword% create %dbName%
 
 
 
Rename %projectDir%\wordpress %projectDir%\public_html
exit
 
:sql_not_running
echo -----------------------------
echo !!WARNING COULDN'T CONTINUE!!
echo -----------------------------
echo Message: mysqld.exe is not running, please start it (e.g. via xampp-control)
batch-script-to-start-new-wordpress-project.1421739953.txt.gz · Zuletzt geändert: 2015/01/20 07:45 von admin