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

CRM-17789 free result fixes #149

Closed
wants to merge 3 commits into from

Conversation

mollux
Copy link
Contributor

@mollux mollux commented May 18, 2016

These fixes make it possible to for CRM_Core_DAO->freeResult() to be mysql(i) extension independent, and also fixes the DB_mysqli->freeResult to actually clear it.

This is needed for supporting PHP7 without php_mysql extension, so it doesn't break (existing) installations.


@mollux
Copy link
Contributor Author

mollux commented May 18, 2016

After some testing, this PR seems to make no difference in memory usage or functionality (despite the fact that mysql_free_result is never called when using a mysqli:// dsn, it doesn't make any difference in memory usage when running the tests). I will do some more testing to be sure this PR is obsolete

if (isset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTFIELDS'][$this->_DB_resultid]);
}
if (isset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid])) {
unset($_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]);
$_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]->free();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this just unset in the line before?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Thus it won't build stating "Error: Call to a member function free() on a non-object"

@JoeMurray
Copy link

@nielosz would you be interested in reviewing this PR?

@niels-heinemann
Copy link

niels-heinemann commented Jun 20, 2016

Does civi's core team provide a php 7 civicrm playground? Any chance to ssh onto it?

@JoeMurray
Copy link

A variety of issues remain before master branch for 4.7 will work on PHP7. But I take it you are asking whether buildkit or some other infrastructure more along the lines of a Docker container or a Vagrant image has been setup for testing of PHP7. @nganivet @totten any suggesions here? See dm-coding/civibuildkit-docker#1

@nganivet
Copy link
Collaborator

@JoeMurray I imagine it would be quite easy to modify the Vagrant buildkit to include PHP7. Here the most obvious places where a change would be needed (change php5 package name to php7):
https://github.com/civicrm/civicrm-buildkit-vagrant/blob/master/provision/provision.sh#L34
https://github.com/civicrm/civicrm-buildkit-vagrant/blob/master/provision/provision.sh#L281
https://github.com/civicrm/civicrm-buildkit-vagrant/blob/master/provision/provision.sh#L349

Then you would have to check if any changes/patches are needed for composer, PHPUnit, mailcatcher and all other PHP-based utilities used by buildkit (and buildkit itself BTW). There also are PHPMyAdmin, PHPMemchachedAdmin, OpcacheStatus, PHP_CodeSniffer and a few others, but these are not needed for running buildkit or CiviCRM so less critical.

That's all I see so far. So probably 1/2 day of work to get this done.

@JoeMurray
Copy link

This seems like a useful version to build since we will be moving to support PHP7 in the next few months. Let's see if djcf is interested in creating an appropriate Docker container for us. If not, might you have the time this week?

@nganivet
Copy link
Collaborator

Sorry Joe, I am not interested in PHP 7 anytime soon so will have to
pass.

------ Original Message ------
From: "Joe Murray" notifications@github.com
To: "civicrm/civicrm-packages" civicrm-packages@noreply.github.com
Cc: "nganivet" nicolas@cividesk.com; "Mention"
mention@noreply.github.com
Sent: 6/21/2016 12:10:03 AM
Subject: Re: [civicrm/civicrm-packages] CRM-17789 free result fixes
(#149)

This seems like a useful version to build since we will be moving to
support PHP7 in the next few months. Let's see if djcf is interested in
creating an appropriate Docker container for us. If not, might you have
the time this week?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@totten
Copy link
Member

totten commented Sep 13, 2016

This has been resubmitted by Seamus in #169 to address the reported error.

@totten totten closed this Sep 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants