I’ve ready some mentions that ACF Pro will have support for Composer, but I don’t see any documentation on implementation of it.
Is Composer support available?
I also would like to know if there has been any progress made in ACF Pro supporting Composer.
Thanks!
+1 for this as well. Having a Composer package for ACF PRO would be great!
Hi guys.
Until the dev adds native support/instructions to install ACF PRO with composer you can use this configuration.
https://gist.github.com/dmalatesta/4fae4490caef712a51bf
Replace “yourkeyhere” with your license key in the url parameter.
Then run:
$ composer require advanced-custom-fields/advanced-custom-fields-pro
NOTE: this is based on roots/bedrock composer.json configuration file. You may want to adjust it based on your project.
Cheers!
Diego
Awesome! I changed it to define and point to a specific version. Otherwise it would always pull the latest version with the package version number still stuck at 5.0.
https://gist.github.com/fThues/705da4c6574a4441b488
EDIT: Looks like the latest version is not available for download with the the t parameter, only the previous ones. Ah well.
Thanks ๐
Hopefully Elliot will introduce the official support to composer, in the mean time we can fix the version with your configuration or use the latest with the wrong version number and live with it ๐
Anyone else run into an issue (using Bedrock, ACF and Custom Post Types UI) when deploying to my staging server.
1. Added Custom Post Types + ACF to my composer.json
2. Created a custom post type and custom field
3. Deployed code (cap staging deploy)
4. cap staging wpcli:db:push
5. SSH’d in to staging server and ran composer update
6. Logged into staging admin and get “Invalid post type” when trying to view ACF. Get “You are not allowed to edit this post.” when I try to create a new custom field group on staging.
Any ideas how to fix this?
Hey Tommy, I’ve got a similar approach with Bedrock but I’m running composer and wpcli tasks automatically in my deploy.rb. Kinda think having to SSH manually goes against the reason for using automated deploys.
You need gem 'capistrano-composer'
in your gemfile (+ run bundle install). Looks like you’re already using the capistrano-wpcli one though?
So I assume you’ve set the remote url in your stage rb files:
e.g. set :wpcli_remote_url, 'http://staging.yoursite.com'
for staging.rb
Then you need the WP-cli config in your deploy.rb, e.g:
# WPCLI config
set :wpcli_local_url, 'http://local.yoursite.com'
set :wpcli_local_uploads_dir, 'web/app/uploads/'
set :wpcli_remote_uploads_dir, -> { shared_path.join('web/app/uploads') }
set :wpcli_rsync_options, '-rlvz -e "ssh -p4444" --stats --delete --delete-after'
Note, I also push uploads and I need a custom port for ssh, not everyone would need that.
THEN add a task to run sync in your namespace :deploy do
desc 'Keep WP synced'
task :wp_sync do
on roles(:db) do
info "Push local database and uploads"
within release_path do
invoke 'wpcli:db:push'
invoke 'wpcli:rewrite:flush'
invoke 'wpcli:uploads:rsync:push'
end
end
end
Then (usually) at the end of your deploy namespace, you need to attach the tasks to the Capistrano flow, with after :updated, 'deploy:wp_sync'
As for your โInvalid post typeโ error, I can’t help you though. Just tried the same process and mine works. :/
Just noticed I’ve got the wpcli rsync running on the DB role, which works only because I’ve got everything on the same server. If I had a dedicated DB server that was different to my app role, that wouldn’t work. I’m gonna break those tasks up now.
Hey folks, we have just released native support for installing ACF PRO with Composer, without the need for another package or installer ๐
๐ https://www.advancedcustomfields.com/resources/installing-acf-pro-with-composer/
The topic ‘Composer Support’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.