Adding Migration Package to CakePHP 3 - cakephp

I'm trying to add migration package to CakePHP 3.3 using the command
composer require cakephp/migration:~1.0
but I'm receiving the following result:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cakephp/migration could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
Any suggestions to solve this?

As #ndm said its "migrations", also it should be allready installed by default if you created your app with composer or such. To activate it you just need to load it in the bootstrap.php as specified here Plugin::load('Migrations');

Related

Julia: How can I update my published julia package?

I'm trying to develop my first Julia package, FeatureEng.jl but I'm having trouble updating the package on the registry.
I've set up the GitHub actions TagBot and Register and tried updating the package version via the Project.toml file and via git tags, but I still only have one release on GitHub ("v1.0.1") and I get the following output from TagBot:
Tag v1.0.1 already exists
When I run my package in its own environment and check the version I get...
julia> using Pkg
julia> Pkg.activate(".")
Activating environment at `~/Desktop/code/julia/FeatureEng/Project.toml`
julia> using FeatureEng, PkgVersion
julia> PkgVersion.Version(FeatureEng)
v"1.2.7"
but when I install my package in a separate environment, from the general registry, and run the same check I get...
julia> PkgVersion.Version(FeatureEng)
v"1.0.1"
Am I missing something? What is the right way to publish a new Julia package version?
Thanks in advance!
Be sure you have the tagbot file on your repository
Upgrade the version number in your local Project.toml file
Commit and push to GitHub
In GitHub, add a comment to the commit with the text #JuliaRegistrator register
That's all. Tagbot will automatically create the same tag on GitHub.
Fore more details, you can have a look on my tutorial on modules and packages: https://syl1.gitbook.io/julia-language-a-concise-tutorial/language-core/11-developing-julia-packages

configuration composer.json Symfony3 and sonataAdmin

I want to start a project with Symfony3 and SonataAdmin
I was trying a lot of versions of symfony and sonataAdminBundle
But I always get errors when updating composer
What's the correct composer.json to start my project
thanks
According to packagist the current v3.3.1 of SonataAdminBundle should be compatible with Symfony ^3.0.
You can just run composer require sonata-project/admin-bundle and it will automatically look for the newest compatible version. If that fails you could try allowing development-versions as well.
composer require sonata-project/admin-bundle:dev-master
That should be your last resort though as it pulls in an unstable dependency. Feel free to add composer's error to your question and maybe I or someone else can give a more precise answer.

Is there an official nuget package for Angular 2?

I'm currently working in a work environment where I do not have access to npm / node. The npm download location is actually blocked so I can't get any packages.
I want to build an Angular 2 site. As I can't access npm, I want to use Nuget to get the files. Although I can see the Angular 1 packages, I cannot seem to see any Angular 2 packages. Is there one for Nuget?
Also, is populating the node_module folder and compiling the Typescript the only thing that npm does for Angular? If I can just get a copy of the node_module folder (from outside work) and get TypeScript working in my solution, can I basically bypass the need for npm?
In short; No.
You can see a list of all available NuGet package versions here, with the most recent being 1.5.3.
Even performing a generic search shows most recent versions as 1.5.3.
Sometimes they'll have beta versions of packages available that you can install with a command similar to: Install-Package EntityFramework -Version 6.1.3-beta1 -Pre, but it doesn't appear as if they have created any pre-release packages.
So, as #Michal Dymel mentioned, you could get it from a CDN or some other location.

PHPUnit intallation for CakePHP 2.4

Error that I'm getting when trying to run tests:
Fatal error: Class 'PHPUnit_Util_Diff' not found in Cake/TestSuite/Reporter/CakeHtmlReporter.php on line 267
As per this question, and the answers there, I need to install PHPUnit 3.6.x to avoid the missing Class error. How can I install this, now deprecated, version?
I've tried using composer like this:
composer global require "phpunit/phpunit=3.6.*"
But I get the following error
Problem 1
- The requested package phpunit/phpunit could not be found in any version, there may be a typo in the package name.
I've tried PEAR with this command:
sudo pear install phpunit/PHPUnit-3.6.12
but I get this error:
Attempting to discover channel "phpunit"...
Attempting fallback to https instead of http on channel "phpunit"...
unknown channel "phpunit" in "phpunit/phpunit-3.6.12"
invalid package name/package file "phpunit/phpunit-3.6.12"
install failed
I have found an answer here which points me to dereuromark's plugin, which is deprecated and suggests that I use composer since the pear channel for PHPUnit has been shutdown. Not to mention that it's version 3.7.x, which is missing the Class I need. So, I've come full circle.
tl;dr How do install PHPUnit 3.6.x for the CakePHP 2.4.x?
UPDATE: I checked that the same class is used in the latest CakePHP 2.x version. Also, I should mention that test ran correctly on a similar, but older VM that had the older PHPUnit installed.
TL;DR: PHPUnit 3.6 is no longer available for installation.
PHPUnit 3.6 was only ever available as a PEAR package. The PEAR Channel that hosted PHPUnit, pear.phpunit.de, was shut down on December 31, 2014.
I managed to workaround the issue. Since I wasn't able to install the deprecated PHPUnit version, I took the missing functions from the Diff class(diff, diffToArray and longestCommonSubsequence) and put them into the CakeHtmlReporter Class, since that was the only one referencing them.
After that I changed PHPUnit_Util_Diff::diff to self::diff and it's working now, even though it's missing the old CSS styles, but I can live with that.
It's not the answer to the question I asked, but maybe it can help someone else, until a better answer comes along.

bower packages update crashed the app - how to roll back

I've installed another additional module for my app with bower. As project dependencies in bower.json were not very strict, and a lot of time passed since last update, bower updated a lot of packages to newer ones. There were a lot of changes, and incompatibility between packages was the reason for major app crash.
I never asked for this, not a good moment for total upgrade&debug. How can I just roll back to previous packages?
Original package sources are in .gitignore and built with grunt into one file (so I can't just revert the commit - as packages renewed by bower will be the same in the next build)
I couldn't find out the old package set which was OK for my app (as package sources with specific version numbers are in .gitignore) UPD: found versions in built file, see my answer
I couldn't find any information about sort of "bower package history" or "bower undo".
UPD: I solved the issue for myself and described the solution in the answer. But I'm really not sure it's a good way, and would be grateful for any kind of mentorship about the subject.
I solved the problem for myself by digging into incompatiblities showed by bower, and finding compromise package set. Main issues were between newest angular asked by some packages and angular-ui-bootsrap working with older versions only for that moment. Also there were some issues with other newest packages, which I downgraded and will solve later on. So I used bower install [PackageName]#=[SpecificPackageVersion] (can use --save here to save it to bower.json) for manually setting compromise packages.
At the moment I realized, that there were old package versions in license comment blocks in the previous commits of built file, so in order to have old working set of packages I could:
git checkout HEAD~1 to have old file, which was built with previous package set
grep (search) package names or license comments in it
bower install [PackageName]#=[OldWorkingPackageVersion] (can use --save to save it to bower.json)
git checkout [BranchName] to make HEAD back
Make build (with previous packages installed again)
However, I'm not sure it's a good solution, and would be grateful for any kind of clarification about the subject.

Resources