示例#1
0
 public static function getQuota($newUser)
 {
     // make sure that you are using correct region (where the bucket is) to get new Amazon S3 client
     //$client = \Aws\S3\S3Client::factory(array('region' => $region));
     //$path = \OC::$SERVERROOT;
     $path = \OC::getRootFolder();
     $str = file_get_contents($path . 'data/mount.json');
     $json = json_decode($str, true);
     $result = array();
     if ($newUser != '') {
         $newmountData = $json['user'][$newUser];
         return $this->getSize($newUser, $newmountData);
     } else {
         foreach ($json['user'] as $username => $mountData) {
             $this->getSize($username, $mountData);
             array_push($result, $node);
         }
         return $result;
     }
 }