Is it possible to avoid updating drupal core with composer update? - docker

I'm trying to build a docker container where the dockerfile installs a specific version of drupal, I copy over custom copies of composer.json/composer.lock and then do a composer update to download the contributed modules specified in these composer files. I know that ideally composer would also control core, but for this project, I'm trying to avoid that.
The problem I'm having is that composer update seems to also reinstall drupal, where I want the dockerfile to be in control of this and I'd like composer to just manage the modules.
Is this something I could do by modifying the composer files (so far tests have not worked)? It seems you can't specify a package for composer to ignore and where I see you can specify specific packages to update, that's not really a viable solution for this.
Thanks

OK, it's looking like the issue was the composer.lock/json files I was adding to run composer update were initially created by using composer create-project drupal-composer/drupal-project, which installed core and thus added it to the composer.lock/json files.
It seems that by just reinstalling the contributed modules with composer in a fresh drupal site (so simplified composer files) might be the answer.

Related

Custom Craft CMS plug-in template changes issue

Somebody has developed a custom plug-in for a project of mine.
I now want to change some templates from this plug-in and no matter what changes I make to these templates, nothing changes! I don’t understand why. I’ve cleaned caches several times and the cache tag is not used. It’s my third craft cms project but I’ve never had much experience with custom plug-ins.
What might be happening?
Have you tried composer commands for the same?
composer update
For updating the composer
If it doesn't work try uninstalling the plugin then install it again with the following commands
composer remove vendor/plugin-handle
For uninstalling the Plugin
composer require vendor/plugin-handle
Install the plugin again then activate the same through CP
Hope this helps you in the same.

Installing an editable python package inside a docker container

I am trying to fix a bug in a python package for my project that runs inside a docker container.
The package I am talking about is django-allauth and I found a small with one of the providers.
I know that I need to copy the edited package into the container and install it like this:
COPY folder/with/package /somefolder_inside_container/
RUN pip install -e /somefolder_inside_container/
The root folder of this project on github contains a lot of files and I am not sure if I should include them for copying to make sure the package installs. Do i need to copy anything besides the 'allauth' folder that contains all the models/views/etc. ?

Is it possible to create a custom cdk init template to leverage pipenv for my python project?

I would like to utilize pipenv as my virtual environment manager and for my dependency management for my Python cdk projects, upon running 'cdk init'. I read that you can specify a 'custom' application template but could not find documentation on creating one. Is it possible and can the virtual environment/dependency manager be controlled using this feature?
I would like to be able to run 'cdk init hello-world --language python' and have the scaffolding for the project be generated BUT using pipenv.
It's not possible to do that without modifying the source code for the CDK package itself. You likely won't want to manage your own divergent version of the standard package.
I've shoe-horned CDK to work with PipEnv a couple of times, and it's more work than it's worth at this point. The problem is that PipEnv forces the . delimiter in the package name to a -; pipenv install aws-cdk.aws-rds is listed as aws-cdk-aws-rds in the Pipfile, and the package installations don't actually work.
There's an open issue on the repo for this though (https://github.com/aws/aws-cdk/issues/3671), so you could +1 there in hopes that they can address it. It really is an issue with Pipenv though.
Following the link from Scott for the open issue, it looks like this works now, provided the package name is in quotes.

ZEND2 project not working after cloned to separate machine

I have cloned my office colleague's zend2 project from our server. He used zfcuser, zfcbase, and zfcadmin. But when I tried to run the project in my local machine its giving
<b>Fatal error</b>: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException'
with message 'Module (ZfcBase) could not be initialized.' in C:\xampp\htdocs\coolshop
\vendor\ZF2\library\Zend\ModuleManager\ModuleManager.php:140
Everything is fine to me as the same project 100% working in my colleague's machine. I tried the composer as well. But no luck
This is a result of loading the ZfcBase module as a git submodule. If you fix this module you'll receive the same error for other modules or dependencies you're using in that manner. I've encountered this problem when someone tries to clone the project on a new machine or you delete the project locally and try to re-clone it.
The simple answer here is to use composer as your dependency manager, you'll have a better day. Head over to ZfcBase on Packagist and copy the require statement into your composer.json file (You'll need to run the composer script after saving your .json file). Most modules should have instructions on using composer to grab them in the README.
I should note that if you're using other modules that depend on ZfcBase, you'll likely just need to have a require statement for those, and not their dependencies (like ZfcBase).
Someone had a similar question regarding the ZfcUser module. Using composer solved his issue.

How to install ZfcBase (Zend Framework 2) without Git?

I apologize if this is a trivial question.
The installation guide for ZfcBase only provides this much info;
"Simply clone this project into your ./vendor/ directory and enable it
in your ./config/application.config.php file."
I don't have git on my shared hosting solution, but I am using composer.
Could anyone give me a generic way in which I can install Zfc modules without git? (I'm new to Zend)
Edit: I'm guessing I can wget the zip to my /vendor folder and unzip it there? But this wouldn't be good, as I don't want to manually update it if a new version comes in.
If you're using composer, then add "zf-commons/zfc-base": "dev-master" to the require section of your composer.json. so that it looks something like:
"require": {
"php": ">=5.3.3",
"zendframework/zendframework": "2.*",
"zf-commons/zfc-base": "dev-master"
}
Now you run:
php composer.phar self-update
php composer.phar update
On the command line.
If you're doing shared hosting you should first consider developing on your own local computer.
Then, once you're satisfied, zip it all up and transfer it all to your server.
Developing ON the shared server is not a good idea because, as you can see, you won't have all the tools necessary to develop.
If 'zipping' it up all the time is difficult or tedious you can use a build tool for that. Phing or Ant will do.
If you're making small changes I don't see TOO much of a problem doing it on the shared server; but even then, it's still better to do it on your local machine so you can take advantage of an IDE, version control, quicker network, better tool set and probably some other things.

Resources