includes/class-freemius.php
private function get_install_diff_for_api( $site, $install, $override = array() ) {
            $diff             = array();
            $special          = array();
            $special_override = false;

            foreach ( $site as $p => $v ) {
                if ( property_exists( $install, $p ) ) {
                    if ( ( is_bool( $install->{$p} ) || ! empty( $install->{$p} ) ) &&
                         $install->{$p} != $v
                    ) {
                        $install->{$p} = $v;
                        $diff[ $p ]    = $v;
                    }
                } else {
                    $special[ $p ] = $v;

                    if ( isset( $override[ $p ] ) ||
                         'plugins' === $p ||
                         'themes' === $p
                    ) {
                        $special_override = true;
                    }
                }
            }

            if ( $special_override || 0 < count( $diff ) ) {
                // Add special params only if has at least one
                // standard param, or if explicitly requested to
                // override a special param or a param which is not exist
                // in the install object.
                $diff = array_merge( $diff, $special );
            }

            return $diff;
        }
private function get_install_diff_for_api( $site, $install, $override = array() ) {
            $diff             = array();
            $special          = array();
            $special_override = false;

            foreach ( $site as $p => $v ) {
                if ( property_exists( $install, $p ) ) {
                    if ( ( is_bool( $install->{$p} ) || ! empty( $install->{$p} ) ) &&
                         $install->{$p} != $v
                    ) {
                        $install->{$p} = $v;
                        $diff[ $p ]    = $v;
                    }
                } else {
                    $special[ $p ] = $v;

                    if ( isset( $override[ $p ] ) ||
                         'plugins' === $p ||
                         'themes' === $p
                    ) {
                        $special_override = true;
                    }
                }
            }

            if ( $special_override || 0 < count( $diff ) ) {
                // Add special params only if has at least one
                // standard param, or if explicitly requested to
                // override a special param or a param which is not exist
                // in the install object.
                $diff = array_merge( $diff, $special );
            }

            return $diff;
        }
private function get_install_diff_for_api ( $ site , $ install , $ override = array ( ) ) { $ diff = array ( ) ; $ special = array ( ) ; $ special_override = false ; foreach ( $ site as $ p => $ v ) { if ( property_exists ( $ install , $ p ) ) { if ( ( is_bool ( $ install -> { $ p } ) || ! empty ( $ install -> { $ p } ) ) && $ install -> { $ p } != $ v ) { $ install -> { $ p } = $ v ; $ diff [ $ p ] = $ v ; } } else { $ special [ $ p ] = $ v ; if ( isset ( $ override [ $ p ] ) || 'plugins' === $ p || 'themes' === $ p ) { $ special_override = true ; } } } if ( $ special_override || 0 < count ( $ diff ) ) { // Add special params only if has at least one
 // standard param, or if explicitly requested to
 // override a special param or a param which is not exist
 // in the install object.
 $ diff = array_merge ( $ diff , $ special ) ; } return $ diff ; }
Compare site actual data to the stored install data and return the differences for an API data sync.

@author Vova Feldman (@svovaf)
@since  2.0.0

@param array    $site
@param FS_Site  $install
@param string[] string $override

@return array
Compare site actual data to the stored install data and return the differences for an API data sync .