コード例 #1
0
ファイル: TongjiModel.php プロジェクト: lilhorse/cocoa
 public function __construct()
 {
     parent::__construct();
     $this->callbackurl = 'http://tiny4cocoa.com/homeadmin/settongji/';
     $client = new Google_Client();
     $client->setClientId('70232315343-0nikjc44hcpfk5qt93pe0e21sc2u3ntm.apps.googleusercontent.com');
     $client->setClientSecret('8I4c4toq6hYE6i3BhHhjRrIc');
     $client->setRedirectUri($this->callbackurl);
     $client->setDeveloperKey('AIzaSyBE9EKeqtgJntWuNbDekaPSNvu9ZalXFpE');
     $client->setScopes(array('https://www.googleapis.com/auth/analytics.readonly'));
     $client->setUseObjects(true);
     $service = new Google_AnalyticsService($client);
     $this->client = $client;
     $this->service = $service;
 }
コード例 #2
0
ファイル: UploadModel.php プロジェクト: lilhorse/cocoa
 public function __construct()
 {
     parent::__construct();
     if (!isset($_FILES['ImageFile']) || !is_uploaded_file($_FILES['ImageFile']['tmp_name'])) {
         return;
     }
     $filename = NULL;
     $this->type = $_FILES['ImageFile']['type'];
     switch (strtolower($ImageType)) {
         case 'image/png':
             $this->ext = "png";
             break;
         case 'image/gif':
             $this->ext = "gif";
             break;
         case 'image/jpeg':
         case 'image/pjpeg':
         default:
             $this->ext = "jpg";
             break;
     }
     $seed = rand(0, 99999);
     $time = time();
     $this->filename = "{$time}-{$seed}";
     switch (strtolower($this->type)) {
         case 'image/png':
             $this->image = imagecreatefrompng($_FILES['ImageFile']['tmp_name']);
             break;
         case 'image/gif':
             $this->image = imagecreatefromgif($_FILES['ImageFile']['tmp_name']);
             break;
         case 'image/jpeg':
         case 'image/pjpeg':
             $this->image = imagecreatefromjpeg($_FILES['ImageFile']['tmp_name']);
             break;
         default:
             $this->image = NULL;
     }
     list($this->width, $this->height) = getimagesize($_FILES['ImageFile']['tmp_name']);
     $this->quality = 85;
 }
コード例 #3
0
ファイル: PlaygroundModel.php プロジェクト: lilhorse/cocoa
 public function __construct()
 {
     parent::__construct();
 }