コード例 #1
0
ファイル: Cookie.php プロジェクト: huxtable/cli
 /**
  * @param	Huxtable\Core\File\File		$fileCookies
  * @return	void
  */
 public function __construct(File\File $fileCookies)
 {
     if ($fileCookies->exists()) {
         $this->contents = parse_ini_file($fileCookies, true);
     }
     $this->fileCookies = $fileCookies;
 }
コード例 #2
0
ファイル: Config.php プロジェクト: huxtable/core
 /**
  * @param	Huxtable\Core\File\File		$source
  * @return	void
  */
 public function __construct(File\File $source)
 {
     if ($source->exists()) {
         $json = $source->getContents();
         $this->data = json_decode($json, true);
     }
     $this->source = $source;
 }
コード例 #3
0
ファイル: File.php プロジェクト: huxtable/core
 /**
  * Given an existing file or directory path, return a properly typed instance
  *
  * @param	string	$pathname
  * @return	mixed
  */
 public static final function getTypedInstance($pathname)
 {
     $file = new File($pathname);
     if (!$file->exists()) {
         return $file;
     }
     if (!$file->isDir()) {
         return $file;
     }
     $directory = new Directory($pathname);
     return $directory;
 }