Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install CakePHP via Composer #744

Closed
wants to merge 7 commits into from

Conversation

devinellis
Copy link

Rather than checking in the whole CakePHP library, we should be installing it via PHP's package manager, Composer. This PR includes:

  • Remove CakePHP library (900+ files)
  • Update composer.json to require CakePHP
  • Update some config within CakePHP to get it to load properly

This PR does not include:

  • Installation of Composer itself (see https://getcomposer.org/download/)
  • Automatic installation of Composer packages (CakePHP, but the list could grow)
  • Documentation updates

Composer install instructions:

cd web/api
curl -sS https://getcomposer.org/installer | php
sudo php composer.phar install

@kylejohnson
Copy link
Member

I've thought about using Composer a few times, but it was too much for me to tackle, along with everything else. So Composer sounds good.

That said, this PR would need to hand installation of composer - or at least address in documentation that Composer is now a requirement. We'd also need to fit installation of composer packages into the make / cmake build process.

@devinellis
Copy link
Author

@kylejohnson I added some documentation to the API page.

I've never used cmake and poking around at what I see is not helping much. I found a file that configures core.php and default.php. I agree that downloading composer and then installing the packages should be done automatically but I'm not familiar with ZM's build process, I installed it via a PPA I believe, and I hacked the API to get it to work. Is it possible to do these steps within cmake?

@devinellis
Copy link
Author

ping

@kylejohnson
Copy link
Member

Hi @devinellis - yes, this can all be done within cmake. I haven't had the time to figure out the steps required, but I imagine it won't be too much work.

I'm having trouble seeing where composer actually pulls in the zoneminder API code. commit 8e9e04f is the only changes that I see which might do this. Could you point me in the right path?

Could you also list the steps required to install cakephp and zm api via composer?

@devinellis
Copy link
Author

I've added the composer install steps to the PR's description

@onlyjob
Copy link
Contributor

onlyjob commented Apr 17, 2015

My concern is that in Debian we build packages in clean environment without internet access (offline). This means that source tarball must be comprehensive as it will not be possible to download components on build-time. I'd strongly suggest to avoid incorporating any downloadable stuff into build process... Besides downloading may pose a security risk...

@davidsainty
Copy link

Me too. Downloading at build time is a huge no-no.

I'm not sure if that is really the suggestion, but ZoneMinder is not a PHP package, it's a system that happens to use PHP for part of the system. Coupling it too tightly to annoying PHP processes is going to be a hassle for package maintainers.

In Pkgsrc we have neither composer nor cakephp as a package, but we do have a number of other packages that seem to bundle cakephp files in their distribution. Perhaps that's the way it should be?

@knight-of-ni
Copy link
Member

Just catching up on all the open pull requests. Looks like this one still has some on going discussion so I'm going to label it "not ready for merge". If the discussion reaches a resolution let me know and I can change the status.

@onlyjob
Copy link
Contributor

onlyjob commented May 9, 2015

I think we should reject this distro unfriendly suggestion... Moreover it has potential to produce unexpected results on upstream changes...

@devinellis
Copy link
Author

I assume your builds pull from Github at some point? Composer does the same. If it is that important, you might want to consider splitting ZM into two repositories, that way the PHP code can live on its own. Without investing in modernizing the PHP infrastructure, you will have a hard time finding people to contribute to it.

Running a directory analyzer shows that well over half of the entire project is the checked in CakePHP source code. Smells funny to me.

@onlyjob
Copy link
Contributor

onlyjob commented May 10, 2015

May be git submodules could be the answer to this problem...

@knight-of-ni
Copy link
Member

Going to close this one out since we've chosen not to go this route.

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

Successfully merging this pull request may close these issues.

None yet

5 participants