Lines Matching refs:file
113 * @param string $file file name to write to
119 public static function write($file, array $bytes) { argument
121 if (empty($file)) {
133 $fp = fopen($file, 'wb+');
136 throw new GTException("Unable to open file {$file} for writing");
140 throw new GTException("Unable to write to bytes to file {$file}");
144 throw new GTException("Unable to close file after writing {$file}");
157 public static function touch($file) { argument
159 if (empty($file)) {
163 touch($file);
171 * @param string $file file name to read from
176 public static function read($file) { argument
178 if (empty($file)) {
182 if (!is_file($file)) {
183 throw new GTException("file {$file} does not exist");
186 if (!is_readable($file)) {
187 throw new GTException("file {$file} is not readable");
190 $fp = fopen($file, 'rb');
193 throw new GTException("Unable to open file {$file} for reading");
196 $length = filesize($file);
207 throw new GTException("Unable to read from file {$file}");
219 * @param string $file file containing a valid ASN.1 DER object
222 public static function printAsn1($file) { argument
223 passthru("openssl asn1parse -i -inform DER -in {$file}");