WordPress 측면에서 Basic WordPress Vagrant Environment 는 약간의 도움으로 모든 WordPress 버전과 함께 사용할 수 있습니다. 여전히 PHP를 구성하는 방법을 찾아야하지만에 힌트가 https://github.com/ideasonpurpose/basic-wordpress-box/blob/master/ansible/roles/php/tasks/php.yml
있습니다.
즉시 사용하십시오. 프로젝트를 다운로드하거나 복제하여 wplatest-php55.dev/
실행vagrant up
Vagrant Host Manager 를 설치 하면 IP가 자동으로 폴더에 연결됩니다http://wplatest-php55.dev/
install-wp.sh를 통해 WP 버전에서 여러 환경 생성
아카이브에서 가능한 WordPress 버전을 확인하십시오. https://wordpress.org/download/release-archive/
# PWD (script directory)
# ├── common_folder
# ├── wp39-php55.dev
# │ └── site/common_folder
# ├── wp42-php55.dev
# │ └── site/common_folder
# └── wp431-php55.dev
# └── site/common_folder
다음은 Vagrant 환경 마스터를 bash 스크립트 디렉토리로 가져오고, 배열의 각 버전에 대한 사이트를 복제하고, 해당 WP 버전을 사용하도록 설치 태스크를 구성하며, 모든 사이트에 복사 할 파일 / 폴더를 지정할 수있는 스크립트입니다. 당신은 vagrant up
.
이것을 파일에 install-wp.sh
넣은 다음 실행 chmod +x install-wp.sh
하여 실행하십시오. 이 상자를 모두 만들고 실행하려는 폴더를 찾으십시오 ./install-wp.sh
. 위의 구조를 생성합니다.
모든 버전에서 플러그인을 테스트하려면 스크립트와 동일한 디렉토리에 폴더를 wp-content/plugins/your-plugin
만든 다음 실행하십시오 install-wp.sh wp-content
. 파일 / 폴더는 각 사이트의 루트에 복사되므로 제안 wp-content
합니다.
install-wp.sh
#!/bin/bash
#
# Author: Jesse Graupmann @jgraup - http://www.justgooddesign.com - 2015
#
# Create multiple WordPress sites based on version numbers in array.
#
# ( OPTIONAL )
# Copy common file/folder to all sites - Pass as parameter $1
#
# Each site runs in a Vagrant Environment:
# https://github.com/ideasonpurpose/basic-wordpress-vagrant
#
# Best if used with:
# https://github.com/smdahlen/vagrant-hostmanager
#
# PWD (script directory)
# ├── common_folder
# ├── wp39-php55.dev
# │ └── site/common_folder
# ├── wp42-php55.dev
# │ └── site/common_folder
# └── wp431-php55.dev
# └── site/common_folder
# WordPress Versions
versions=( 3.9 4.2 4.3.1 )
# Move to the current directory
base=$(pwd); cd $base
# Vagrant Environment
remote_master="https://github.com/ideasonpurpose/basic-wordpress-vagrant/archive/master.zip"
vagrant_master_zip=$base/basic-wordpress-vagrant.zip
# Download Latest Environment - overwrite file for latest
wget -v -O $vagrant_master_zip $remote_master
# Loop through version #s
for VERSION in "${versions[@]}" ; do
flatv="${VERSION//.}"
dirname=wp$flatv-php55.dev
# Clone Environment
echo -e "\nCloning to: $base/$dirname\n"
mkdir -p $base/$dirname
tar -zxvf $vagrant_master_zip -C $base/$dirname --strip-components=1
# WordPress Versions
# Archives: https://wordpress.org/download/release-archive/
# Version: https://wordpress.org/wordpress-{{ wp-version }}.tar.gz
# Latest: https://wordpress.org/latest.tar.gz
# Path to Ansible task
yml=$(cat $base/$dirname/ansible/roles/wordpress/tasks/install.yml)
### REPLACE THE ANSIBLE WP VERSION w/OUR VERSION
wp_url_latest="https:\/\/wordpress.org\/latest.tar.gz"
wp_url_version="https://wordpress.org/wordpress-$VERSION.tar.gz"
echo "${yml/$wp_url_latest/$wp_url_version}" > $base/$dirname/ansible/roles/wordpress/tasks/install.yml
# (OPTIONAL) Copy common file/folder to all sites!
# pass as argument to .sh
#
# Example Folder:
# Make a common wp-content folder, then run install with
#
# ./install-wp.sh wp-content
#
# Example File:
# Make a text file, then run install with
#
# ./install-wp.sh my_file.txt
#
common_dest=$base/$dirname/site/
# Copy Folder
if [ -d "$1" ]; then
echo "Copying $1 --> $common"
# Directory must exist
if [ -d "$1" ]; then
folder_name=$(basename $1)
mkdir -p $common_dest/$folder_name;
fi
cp -r $1 $common_dest
# or File
elif [ -f "$1" ]; then
echo "Copying $1 --> $common_dest"
file_name=$(basename $1)
cp $1 $common_dest/$file_name
fi
## Create doc for quick glance at version number
dest="$base/$dirname"
remotewpzip="https://wordpress.org/wordpress-$VERSION.tar.gz"
txt=$dest/download-wp-$VERSION.txt
touch $txt
printf "WordPress Version: $VERSION - https://wordpress.org/download/release-archive/\n\nDownload Zip: $remotewpzip\n" > $txt
done
# The rest is just for show
echo -e "\nDone!\n\nNow just run 'vagrant up' in any of these:\n"
for VERSION in "${versions[@]}" ; do
flatv="${VERSION//.}"
dirname=wp$flatv-php55.dev
echo -e "\t"$base/$dirname "\thttp://"$dirname
done
echo -e "\nMore Vagrant env info @ https://github.com/ideasonpurpose/basic-wordpress-vagrant"
echo -e "Best if used with https://github.com/smdahlen/vagrant-hostmanager\n\nENJOY!"
최신 정보:
그것은 밝혀 기본 워드 프레스 방랑 환경을 여러 PHP 버전 만 처리하도록 설정 정말 아닌 기본 워드 프레스 박스는 당신이 조정하면 될 수 PHP 작업이 . 여러 PHP 버전을 처리 할 스크립트 쉘을 남길 것이라고 생각했습니다.
#!/bin/bash
############################################
#
# PWD (script directory)
# ├── wp39-php55.dev
# ├── wp42-php55.dev
# └── wp431-php55.dev
#
############################################
# WordPress Versions
versions=( 3.9 4.2 4.3.1 )
# PHP Versions
pversions=( 5.4 5.5 5.6 )
############################################
# Move to the current directory
base=$(pwd); cd $base
############################################
# PHP Loop
for PVERSION in "${pversions[@]}" ; do
pflatv="${PVERSION//.}"
echo -e "==> PHP: $PVERSION\n"
# WordPress loop
for VERSION in "${versions[@]}" ; do
flatv="${VERSION//.}"
############################################
dirname=wp$flatv-php$pflatv.dev
############################################
# Environment
echo -e "\t"$base/$dirname "\thttp://"$dirname
mkdir -p $base/$dirname
############################################
# WordPress Versions
# Archives: https://wordpress.org/download/release-archive/
# Version: https://wordpress.org/wordpress-{{ wp-version }}.tar.gz
# Latest: https://wordpress.org/latest.tar.gz
############################################
wp_url_latest="https:\/\/wordpress.org\/latest.tar.gz"
wp_url_version="https://wordpress.org/wordpress-$VERSION.tar.gz"
# Download WP
echo -e "\tDownload WP: $wp_url_version"
############################################
# PHP Packages at https://launchpad.net/~ondrej
# You can get more information about the packages at https://deb.sury.org
# For PHP 5.6 use: ppa:ondrej/php5-5.6
# For PHP 5.5 use: ppa:ondrej/php5
# For PHP 5.4 use: ppa:ondrej/php5-oldstable
############################################
# Config PHP
echo -e "\tConfigure PHP: $PVERSION\n"
done # WordPress version
done # PHP version
exit 1
phpenv
다른 PHP 버전을 관리하는 데 사용한다는 것을 알고 있습니다. 어쩌면 전체 WordPress 리포지토리 (아래의 모든 버전을 포함)의 SVN 체크 아웃과 시작의 조합이/tags
시작 되었습니까?