Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc4289a1 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch 'cpu-memory-usage-issue' into 'master'

file_exists replaced with exec command to increase speed of execution

See merge request e/os/LineageOTA!25
parents 29ff26c5 3fd43f81
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -201,12 +201,13 @@
            if (empty($path)) {
                $path = $this->filePath;
            }
            // Pretty much faster if it is available

            if (file_exists($path . ".md5sum")) {
                $tmp = explode("  ", file_get_contents($path . '.md5sum'));
                $ret = $tmp[0];
            } elseif ($this->commandExists('md5sum')) {
                $tmp = explode("  ", exec('md5sum ' . $path));
                exec('md5sum ' . $path. ' > '.$path.'.md5sum');
                $tmp = explode("  ", file_get_contents($path . '.md5sum'));
                $ret = $tmp[0];
            } else {
                $ret = md5_file($path);
@@ -215,6 +216,7 @@
            return $ret;
        }


        /* Getters */

        /**