當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GO::getLicenseFile方法代碼示例

本文整理匯總了PHP中GO::getLicenseFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP GO::getLicenseFile方法的具體用法?PHP GO::getLicenseFile怎麽用?PHP GO::getLicenseFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在GO的用法示例。


在下文中一共展示了GO::getLicenseFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * The code that needs to be called when the cron is running
  * 
  * If $this->enableUserAndGroupSupport() returns TRUE then the run function 
  * will be called for each $user. (The $user parameter will be given)
  * 
  * If $this->enableUserAndGroupSupport() returns FALSE then the 
  * $user parameter is null and the run function will be called only once.
  * 
  * @param CronJob $cronJob
  * @param User $user [OPTIONAL]
  */
 public function run(CronJob $cronJob, User $user = null)
 {
     GO::session()->runAsRoot();
     $licenseFile = \GO::getLicenseFile();
     $temporaryLicenseFile = new \GO\Base\Fs\File(GO::config()->file_storage_path . 'license/' . $licenseFile->name());
     if ($temporaryLicenseFile->exists()) {
         if (!$temporaryLicenseFile->move($licenseFile)) {
             throw new \Exception("Could not move license file to Group-Office root!");
         } else {
             if (!GO::scriptCanBeDecoded()) {
                 GO\Base\Mail\AdminNotifier::sendMail("Group-Office license invalid", "You attempted to install a license but the license file you provided didn't work. Please contant Intermesh about this error.");
             } else {
                 //add all users to the modules they have access too
                 \GO\Professional\License::autoConfigureModulePermissions();
                 GO\Base\Mail\AdminNotifier::sendMail("Group-Office license installed successfully!", "Your license was installed and the new users were automatically added to the App permissions if necessary.\n\nThank you for using Group-Office!");
             }
         }
     }
 }
開發者ID:ajaboa,項目名稱:crmpuan,代碼行數:31,代碼來源:LicenseInstaller.php

示例2: actionUpload

 protected function actionUpload()
 {
     if (!is_uploaded_file($_FILES['license_file']['tmp_name'][0])) {
         throw new Exception("No file received");
     }
     if (!extension_loaded('ionCube loader')) {
         throw new Exception("The required free ionCube loader is not installed. ");
     }
     $licenseFile = \GO::getLicenseFile();
     if ($_FILES['license_file']['name'][0] != $licenseFile->name()) {
         throw new Exception("File should be named " . $licenseFile->name());
     }
     if (!$licenseFile->exists() || !$licenseFile->isWritable()) {
         throw new Exception("Could not write file " . $licenseFile->name() . ". Please upload the file to the webserver and change the permissions so that the webserver can write to it.");
     }
     //		$destinationFolder = new GO\Base\Fs\Folder(GO::config()->file_storage_path.'license/');
     //		$destinationFolder->create();
     //
     $success = move_uploaded_file($_FILES['license_file']['tmp_name'][0], $licenseFile->path());
     //use cron to move the license as root.
     //		GO\Modules\Cron\LicenseInstaller::runOnce();
     echo json_encode(array('success' => $success));
 }
開發者ID:ajaboa,項目名稱:crmpuan,代碼行數:23,代碼來源:LicenseController.php


注:本文中的GO::getLicenseFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。