Skip to content

Instantly share code, notes, and snippets.

@mehrshaddarzi
Last active May 21, 2020 04:44
Show Gist options
  • Save mehrshaddarzi/5c02271b99019707928b7cb2efb1363f to your computer and use it in GitHub Desktop.
Save mehrshaddarzi/5c02271b99019707928b7cb2efb1363f to your computer and use it in GitHub Desktop.
wp-cli start

install in windows

Download wp-cli.phar

create foler wp-cli in drive c

create file wp.bat an push this data

@ECHO OFF
php "c:/wp-cli/wp-cli.phar" %*

create a file with name 'wp' for cygwin and push this data

#!/bin/sh

dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)

if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
   # We are in Cgywin using Windows php, so the path must be translated
   dir=$(cygpath -m "$dir");
fi

php "${dir}/wp-cli.phar" "$@"

Config Cygwin in windows

at the end file : C:\cygwin64\etc/profile

# export PROFILEREAD PATH ORIGINAL_PATH MANPATH INFOPATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL tmp temp
export PROFILEREAD PATH ORIGINAL_PATH INFOPATH USER TMP TEMP PRINTER HOSTNAME PS1 SHELL
export PATH="/cygdrive/f/Server/linuxphp7/php:/cygdrive/f/Server/linuxphp7/mysql/bin:/cygdrive/c/composer:/cygdrive/c/wp-cli/vendor/bin:$PATH"
export WP_CLI_PACKAGES_DIR="C:\Users\AvvalStock/.wp-cli/packages/"
#https://make.wordpress.org/cli/handbook/config/

//phpstorm -> [ctrl+ shift + x] console terminal tools

/* List Of Function */ //WP_CLI::success( $args[0] ); //WP_CLI::error( $args[1] ); //WP_CLI::warning( $message ) //WP_CLI::log("[{$key}] No meta, skipped"); //WP_CLI::line(""); //$locale = \WP_CLI\Utils\get_flag_value( $assoc_args, 'locale', 'en_US' );

  1. download

wp core download [--locale=fa_IR]

  1. wp config create --dbname=testing --dbuser=wp --dbpass=securepswd --dbprefix=

  2. del "filename" | ren "wp-config-sample.php" "wp-config.php"

  3. wp core install --url=localhost/razmayesh96.ir --title=Example --admin_user=admin --admin_password=admin --admin_email=[email protected]

/***************************************************** 6)if change prefix wp package install iandunn/wp-cli-rename-db-prefix wp rename-db-prefix se_ /*****************************************************

  1. wp core language install fa_IR --activate

  2. wp plugin install wp-parsidate --activate

  3. wp plugin update --all || wp plugin wp-parsidate

$url_framework = 'http://localhost/buymarketing.ir'; define ('WP_CONTENT_FOLDERNAME', 'asset'); define ('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME) ; define ('WP_CONTENT_URL', $url_framework.'/'.WP_CONTENT_FOLDERNAME); define ('WP_PLUGIN_DIR', ABSPATH . 'addone'); define ('WP_PLUGIN_URL', $url_framework.'/addone'); define( 'PLUGINDIR', ABSPATH . 'addone' ); define( 'UPLOADS', ''.'image' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment