/** * Get an array containing all the photos for this public key * * @return array */ public function getPhotos(){ if($this->_photos === null){ $this->_photos = []; // By specifying these options, the contents are extracted automatically and the filename is rendered. $gpg = new GPG(); $o = $gpg->_exec('--list-keys --list-options show-photos --photo-viewer "echo %I >&2" ' . $this->fingerprint . ' 1>/dev/null '); if($o['return'] === 0){ // In this case, stderr should contain the output. $files = explode("\n", $o['error']); foreach($files as $f){ if($f){ $this->_photos[] = \Core\Filestore\Factory::File($f); } } } } return $this->_photos; }