当前位置: 首页>>代码示例>>PHP>>正文


PHP License类代码示例

本文整理汇总了PHP中License的典型用法代码示例。如果您正苦于以下问题:PHP License类的具体用法?PHP License怎么用?PHP License使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了License类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveLicense

 public function saveLicense(License $license)
 {
     try {
         $license->save();
     } catch (Exception $e) {
         throw new DaoException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:8,代码来源:LicenseDao.php

示例2: testAddLicense

 public function testAddLicense()
 {
     $license = new License();
     $license->setName('Bicycle');
     $this->licenseDao->saveLicense($license);
     $savedLicense = TestDataService::fetchLastInsertedRecord('License', 'id');
     $this->assertTrue($savedLicense instanceof License);
     $this->assertEquals('Bicycle', $savedLicense->getName());
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:9,代码来源:LicenseDaoTest.php

示例3: license_get_by_id

function license_get_by_id($id)
{
    $result = sql_do('SELECT id_lic,name_lic,valid_lic FROM licenses WHERE id_lic=\'' . int($id) . '\'');
    if ($result->numRows() != 1) {
        return 0;
    }
    $row = $result->fetchRow();
    $lic = new License();
    $lic->set_id_lic($row[0]);
    $lic->set_name_lic($row[1]);
    $lic->set_valid_lic($row[2]);
    return $lic;
}
开发者ID:BackupTheBerlios,项目名称:igoan,代码行数:13,代码来源:License.class.php

示例4: search

 /**
  * Search Licenses
  */
 static function search($q = NULL, $param = NULL, $product_code = NULL)
 {
     $_tbl_licenses = License::getTableName();
     $_tbl_licensesUses = LicensesUses::getTableName();
     $_tbl_transactions = Transaction::getTableName();
     $_tbl_purchases = Purchase::getTableName();
     $_tbl_products = Product::getTableName();
     $_tbl_plans = Plan::getTableName();
     $_tbl_buyers = Buyer::getTableName();
     $fields = array("{$_tbl_licenses}.*", DB::raw("COUNT({$_tbl_licensesUses}.id) AS totalUsed"), "{$_tbl_buyers}.first_name", "{$_tbl_buyers}.last_name", "{$_tbl_buyers}.email", "{$_tbl_products}.code", "{$_tbl_plans}.code AS plan_code", "{$_tbl_products}.api_key");
     $licenses = DB::table($_tbl_licenses)->leftJoin($_tbl_licensesUses, "{$_tbl_licensesUses}.license_id", '=', "{$_tbl_licenses}.id")->join($_tbl_transactions, "{$_tbl_transactions}.id", '=', "{$_tbl_licenses}.transaction_id")->join($_tbl_plans, "{$_tbl_transactions}.plan_id", '=', "{$_tbl_plans}.id")->join($_tbl_purchases, "{$_tbl_purchases}.id", '=', "{$_tbl_transactions}.purchase_id")->join($_tbl_products, "{$_tbl_products}.id", '=', "{$_tbl_purchases}.product_id")->join($_tbl_buyers, "{$_tbl_buyers}.id", '=', "{$_tbl_purchases}.buyer_id")->select($fields)->groupBy("{$_tbl_licenses}.id");
     $q = $q ? $q : Input::get('q');
     $param = $param ? $param : Input::get('param');
     if ($q) {
         if ($param == "key") {
             $licenses = $licenses->where("license_key", '=', $q);
         }
         if ($param == "email") {
             $licenses = $licenses->where("email", '=', $q);
         }
         if ($product_code) {
             $licenses = $licenses->where($_tbl_licenses . ".license_key", 'LIKE', strtoupper($product_code) . '-%');
         }
     }
     return $licenses->orderBy($_tbl_licenses . '.created_at', 'DESC')->paginate(25);
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:29,代码来源:License.php

示例5: postGenerateLicense

 /**
  * Generate license
  */
 public function postGenerateLicense()
 {
     $rules = array('transaction_id' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         return Redirect::to('admin/utilities/generate-license')->withErrors($validator)->withInput();
     } else {
         $transaction_id = Input::get('transaction_id');
         if ($transaction = Transaction::where('id', '=', $transaction_id)->first()) {
             if ($license = License::where('transaction_id', '=', $transaction_id)->first()) {
                 Session::flash('alert_error', '<strong>Ooops!</strong> License for given transaction already exists.');
                 return Redirect::to('admin/licenses?q=' . $license->license_key . '&param=key');
             }
             $plan = Plan::where('id', '=', $transaction->plan_id)->first();
             if ($plan->has_license) {
                 $product = Product::where('id', '=', $plan->product_id)->first();
                 $license_key = License::generate($product->code);
                 // Save license
                 $license = new License();
                 $license->license_key = $license_key;
                 $license->transaction_id = $transaction_id;
                 $license->allowed_usage = $plan->license_allowed_usage;
                 $license->save();
                 Session::flash('alert_message', '<strong>Well done!</strong> You successfully have generated license key.');
                 return Redirect::to('admin/licenses?q=' . $license_key . '&param=key');
             } else {
                 Session::flash('alert_error', '<strong>Ooops!</strong> This plan does not allow to generate a license key.');
                 return Redirect::to('admin/utilities/generate-license');
             }
         } else {
             Session::flash('alert_error', '<strong>Ooops!</strong> Transaction was not found.');
             return Redirect::to('admin/utilities/generate-license');
         }
     }
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:38,代码来源:UtilitiesController.php

示例6: getDefaultLicense

 public static function getDefaultLicense()
 {
     if (License::$noDataLicense === null) {
         License::$noDataLicense = new License(null);
     }
     return License::$noDataLicense;
 }
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:7,代码来源:License.php

示例7: setLicensePlaceholders

 public function setLicensePlaceholders($template)
 {
     $date = $this->license->getValidToDate();
     if ($date) {
         $formattedValidityDate = date(ASCMS_DATE_FORMAT_DATE, $date);
     } else {
         $formattedValidityDate = '';
     }
     $date = $this->license->getCreatedAtDate();
     if ($date) {
         $formattedCreateDate = date(ASCMS_DATE_FORMAT_DATE, $date);
     } else {
         $formattedCreateDate = '';
     }
     $cdate = $this->license->getValidToDate();
     $today = time();
     $difference = $cdate - $today;
     if ($difference < 0) {
         $difference = 0;
     }
     $validDayCount = ceil($difference / 60 / 60 / 24) - 1;
     if ($validDayCount < 0) {
         $validDayCount = 0;
     }
     $template->setVariable(array('LICENSE_STATE' => $this->lang['TXT_LICENSE_STATE_' . $this->license->getState()], 'LICENSE_EDITION' => contrexx_raw2xhtml($this->license->getEditionName()), 'INSTALLATION_ID' => contrexx_raw2xhtml($this->license->getInstallationId()), 'LICENSE_KEY' => contrexx_raw2xhtml($this->license->getLicenseKey()), 'LICENSE_VALID_TO' => contrexx_raw2xhtml($formattedValidityDate), 'LICENSE_VALID_DAY_COUNT' => contrexx_raw2xhtml($validDayCount), 'LICENSE_CREATED_AT' => contrexx_raw2xhtml($formattedCreateDate), 'LICENSE_REQUEST_INTERVAL' => contrexx_raw2xhtml($this->license->getRequestInterval()), 'LICENSE_GRAYZONE_DAYS' => contrexx_raw2xhtml($this->license->getGrayzoneTime()), 'LICENSE_FRONTENT_OFFSET_DAYS' => contrexx_raw2xhtml($this->license->getFrontendLockTime()), 'LICENSE_UPGRADE_URL' => contrexx_raw2xhtml($this->license->getUpgradeUrl()), 'LICENSE_PARTNER_TITLE' => contrexx_raw2xhtml($this->license->getPartner()->getTitle()), 'LICENSE_PARTNER_LASTNAME' => contrexx_raw2xhtml($this->license->getPartner()->getLastname()), 'LICENSE_PARTNER_FIRSTNAME' => contrexx_raw2xhtml($this->license->getPartner()->getFirstname()), 'LICENSE_PARTNER_COMPANY' => contrexx_raw2xhtml($this->license->getPartner()->getCompanyName()), 'LICENSE_PARTNER_ADDRESS' => contrexx_raw2xhtml($this->license->getPartner()->getAddress()), 'LICENSE_PARTNER_ZIP' => contrexx_raw2xhtml($this->license->getPartner()->getZip()), 'LICENSE_PARTNER_CITY' => contrexx_raw2xhtml($this->license->getPartner()->getCity()), 'LICENSE_PARTNER_COUNTRY' => contrexx_raw2xhtml($this->license->getPartner()->getCountry()), 'LICENSE_PARTNER_PHONE' => contrexx_raw2xhtml($this->license->getPartner()->getPhone()), 'LICENSE_PARTNER_URL' => contrexx_raw2xhtml($this->license->getPartner()->getUrl()), 'LICENSE_PARTNER_MAIL' => contrexx_raw2xhtml($this->license->getPartner()->getMail()), 'LICENSE_CUSTOMER_TITLE' => contrexx_raw2xhtml($this->license->getCustomer()->getTitle()), 'LICENSE_CUSTOMER_LASTNAME' => contrexx_raw2xhtml($this->license->getCustomer()->getLastname()), 'LICENSE_CUSTOMER_FIRSTNAME' => contrexx_raw2xhtml($this->license->getCustomer()->getFirstname()), 'LICENSE_CUSTOMER_COMPANY' => contrexx_raw2xhtml($this->license->getCustomer()->getCompanyName()), 'LICENSE_CUSTOMER_ADDRESS' => contrexx_raw2xhtml($this->license->getCustomer()->getAddress()), 'LICENSE_CUSTOMER_ZIP' => contrexx_raw2xhtml($this->license->getCustomer()->getZip()), 'LICENSE_CUSTOMER_CITY' => contrexx_raw2xhtml($this->license->getCustomer()->getCity()), 'LICENSE_CUSTOMER_COUNTRY' => contrexx_raw2xhtml($this->license->getCustomer()->getCountry()), 'LICENSE_CUSTOMER_PHONE' => contrexx_raw2xhtml($this->license->getCustomer()->getPhone()), 'LICENSE_CUSTOMER_URL' => contrexx_raw2xhtml($this->license->getCustomer()->getUrl()), 'LICENSE_CUSTOMER_MAIL' => contrexx_raw2xhtml($this->license->getCustomer()->getMail()), 'VERSION_NUMBER' => contrexx_raw2xhtml($this->license->getVersion()->getNumber()), 'VERSION_NUMBER_INT' => contrexx_raw2xhtml($this->license->getVersion()->getNumber(true)), 'VERSION_NAME' => contrexx_raw2xhtml($this->license->getVersion()->getName()), 'VERSION_CODENAME' => contrexx_raw2xhtml($this->license->getVersion()->getCodeName()), 'VERSION_STATE' => contrexx_raw2xhtml($this->license->getVersion()->getState()), 'VERSION_RELEASE_DATE' => contrexx_raw2xhtml($this->license->getVersion()->getReleaseDate())));
     if ($template->blockExists('upgradable')) {
         if ($this->license->isUpgradable()) {
             $template->touchBlock('upgradable');
         } else {
             $template->hideBlock('upgradable');
         }
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:33,代码来源:LicenseManager.class.php

示例8: Status

 function Status()
 {
     require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Data.php";
     require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/License.class.php";
     $lic = new License();
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, "http://www.leoferrarezi.com/muweb/version.php");
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
     curl_setopt($ch, CURLOPT_HEADER, 0);
     $lastVersion = trim(curl_exec($ch));
     curl_close($ch);
     $version = explode(".", $lastVersion);
     $LastMainVersion = $version[0];
     $LastSubVersion = $version[1];
     $LastReviewVersion = $version[2];
     $localVersion = "{$SystemMainVersion}.{$SystemSubVersion}.{$SystemReviewVersion}";
     if ($lastVersion == $localVersion) {
         $upToDate = "ui-icon-check";
         $title = "Great! Files up to date!";
         $link = "javascript:;";
     } else {
         $upToDate = "ui-icon-alert";
         $title = "You should update your files! Current release is Version {$lastVersion}";
         $link = "Update()";
     }
     $return = "<p>&nbsp;</p>";
     $return .= "\n\t\t<fieldset>\n\t\t\t<legend>System Information</legend>\n\t\t\t<table class=\"SystemInformationTable\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th align=\"right\">Version:</th>\n\t\t\t\t\t<td><span style=\"float:left; margin-right:5px;\">{$localVersion}</span><span class=\"ui-widget ui-icon {$upToDate}\" title=\"{$title}\" style=\"cursor:help\" onclick=\"{$link}\"></span></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</fieldset>\n\t\t<p>&nbsp;</p>\n\t\t";
     $return .= "\n\t\t<fieldset>\n\t\t\t<legend>License Information</legend>\n\t\t\t<table class=\"SystemInformationTable\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th align=\"right\">Licensed domain:</th>\n\t\t\t\t\t<td>" . $lic->GetLicensedServer() . "</td>\n\t\t\t\t</tr>\n\t\t\t\t";
     switch ($lic->license['LicenseType']['value']) {
         case "1":
             $MyLicense = "STARTER";
             break;
         case "2":
             $MyLicense = "PREMIUM";
             break;
         case "3":
             $MyLicense = "FULL";
             break;
         default:
             $MyLicense = "undefinded";
             break;
     }
     $return .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<th align=\"right\">License type:</th>\n\t\t\t\t\t<td>{$MyLicense}</td>\n\t\t\t\t</tr>";
     $return .= "\n\t\t\t</table>\n\t\t</fieldset>\n\t\t";
     return $return;
 }
开发者ID:BieeeLC,项目名称:OpenWeb,代码行数:47,代码来源:System.class.php

示例9: getUsage

 static function getUsage($id)
 {
     $_tbl_licenses = License::getTableName();
     $_tbl_licensesUses = LicensesUses::getTableName();
     $fields = array("{$_tbl_licensesUses}.*", "{$_tbl_licenses}.license_key");
     $usage = DB::table($_tbl_licensesUses)->join($_tbl_licenses, "{$_tbl_licenses}.id", '=', "{$_tbl_licensesUses}.license_id")->select($fields)->where("{$_tbl_licensesUses}.id", '=', $id)->first();
     return $usage;
 }
开发者ID:michaelotto126,项目名称:dksolution,代码行数:8,代码来源:LicensesUses.php

示例10: run

 public function run()
 {
     // Initialize empty array
     $license = array();
     $date = new DateTime();
     $license[] = array('name' => 'Adobe Photoshop CS6', 'serial' => 'ZOMG-WtF-BBQ-SRSLY', 'purchase_date' => '2013-10-02', 'purchase_cost' => '2435.99', 'purchase_order' => '1', 'maintained' => '0', 'order_number' => '987698576946', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'seats' => 5, 'license_name' => '', 'license_email' => '', 'notes' => '', 'user_id' => 1, 'depreciation_id' => 2, 'deleted_at' => NULL, 'depreciate' => '0');
     $license[] = array('name' => 'Git Tower', 'serial' => '98049890394-340485934', 'purchase_date' => '2013-10-02', 'purchase_cost' => '2435.99', 'purchase_order' => '1', 'maintained' => '1', 'order_number' => '987698576946', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'), 'seats' => 2, 'license_name' => 'Alison Gianotto', 'license_email' => 'snipe@snipe.net', 'notes' => '', 'user_id' => 1, 'depreciation_id' => 2, 'deleted_at' => NULL, 'depreciate' => '0');
     // Delete all the old data
     DB::table('licenses')->truncate();
     // Insert the new posts
     License::insert($license);
 }
开发者ID:chromahoen,项目名称:snipe-it,代码行数:12,代码来源:LicensesSeeder.php

示例11: profile

 public function profile()
 {
     $neighbor_id = Auth::user()->id;
     $colonia = Session::get("colonia");
     $urbanismUsers = Urbanism::where('colony_id', '=', $colonia)->first();
     $neighbor = Neighbors::with('NeighborProperty')->where('user_id', '=', $neighbor_id)->first();
     $role = AssigmentRole::where('user_id', '=', $neighbor_id)->where('colony_id', '=', $colonia)->first();
     $neighbor_role = ucfirst($role->Role->name);
     $licencia = License::where('colony_id', '=', $colonia)->first();
     $expiration_license = LicenseExpiration::where('colony_id', '=', $colonia)->first();
     $photo_user = UserPhoto::where('user_id', '=', $neighbor_id)->where('colony_id', '=', $colonia)->pluck('filename');
     return View::make('dashboard.neighbors.profile', ['neighbor' => $neighbor, 'colonia_nombre' => $urbanismUsers->Colony->name, 'urbanism' => $urbanismUsers->Colony->name, 'role' => $neighbor_role, 'licencia' => $licencia, 'photo_user' => $photo_user, 'expiration_license' => $expiration_license]);
 }
开发者ID:prianticonsulting,项目名称:Habitaria,代码行数:13,代码来源:NeighborController.php

示例12: license_store

 public function license_store()
 {
     $data = Input::all();
     $colonia = Input::get('colony_id');
     $code = Input::get('code');
     $license_colonia = License::where('colony_id', '=', $colonia)->get();
     $code_exist = 0;
     foreach ($license_colonia as $lic) {
         if ($code == Crypt::decrypt($lic->code)) {
             $code_exist = 1;
             $code_id = $lic->id;
             $lic_status = $lic->status;
         }
     }
     if ($code_exist == 1) {
         if ($lic_status == 0) {
             $license = License::where('id', '=', $code_id)->first();
             $license->status = 1;
             if ($license->update(['id'])) {
                 $expiration = Expiration::where('colony_id', '=', $colonia)->first();
                 $expiration->status = 2;
                 $expiration->update(['id']);
                 Session::put('days_expiration', 0);
                 $expiration_lic = LicenseExpiration::where('colony_id', '=', $colonia)->first();
                 if ($expiration_lic->expiration == null) {
                     $expiration_old = date('Y-m-j');
                 } else {
                     $expiration_old = date('Y-m-j', strtotime($expiration_lic->expiration));
                 }
                 $newExpiration = strtotime('+' . $license->months . ' month', strtotime($expiration_old));
                 $newExpiration = date('Y-m-j', $newExpiration);
                 $expiration_lic->expiration = $newExpiration;
                 $expiration_lic->update(['id']);
                 $datetime2 = new DateTime($expiration_lic->expiration);
                 $datetime1 = new DateTime(date('Y-m-d'));
                 $interval = $datetime1->diff($datetime2);
                 $days_expiration = $interval->format('%a');
                 Session::put('lic_fecha_expiration', $expiration_lic->expiration);
                 Session::put('lic_expiration', $days_expiration);
                 $notice_msg = 'Código de la licencia activado';
                 return Redirect::route('home')->with('notice_modal', $notice_msg);
             }
         } else {
             $error_msg = 'Este Código de licencia ya se fue utilizado';
             return Redirect::back()->with('error_modal', $error_msg);
         }
     } else {
         $error_msg = 'Código de la licencia inválido';
         return Redirect::back()->with('error_modal', $error_msg);
     }
 }
开发者ID:prianticonsulting,项目名称:Habitaria,代码行数:51,代码来源:LicenseController.php

示例13: checkPermissionsWithLicense

 public function checkPermissionsWithLicense()
 {
     $users = License::moduleIsRestricted($this->id());
     //		GO::debug($users);
     if ($users === false) {
         return true;
     }
     $acl_id = GO::modules()->{$this->id()}->acl_id;
     $users = \GO\Base\Model\Acl::getAuthorizedUsers($acl_id);
     foreach ($users as $user) {
         if (!in_array($user->username, $users)) {
             return false;
         }
     }
     return true;
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:16,代码来源:Module.php

示例14: handler_admin

 function handler_admin($page)
 {
     $admin_groups = S::user()->castes(Rights::admin())->groups();
     $admin_groups->diff($admin_groups->filter('ns', Group::NS_USER));
     $page->assign('admin_groups', $admin_groups);
     $page->assign('validates', array());
     if ($admin_groups->count() > 0) {
         $validate_filter = new ValidateFilter(new VFC_Group($admin_groups));
         $validates = $validate_filter->get()->select(ValidateSelect::quick());
         $validates = $validates->split('group');
         $page->assign('validates', $validates);
     }
     $page->assign('licensesDisplay', License::hasRights(S::user()));
     $page->assign('title', "Administration");
     $page->addCssLink('admin.css');
     $page->changeTpl('admin/index.tpl');
 }
开发者ID:netixx,项目名称:frankiz,代码行数:17,代码来源:admin.php

示例15: seedLicenses

 /**
  * Seed the licenses
  *
  * @return void
  */
 private function seedLicenses()
 {
     // Fetch the licenses from the json file
     $this->command->info('---- DCAT Licenses ----');
     $this->command->info('Trying to fetch the licenses from a local json file.');
     $licenses = json_decode(file_get_contents(app_path() . '/database/seeds/data/licenses.json'));
     if (!empty($licenses)) {
         $this->command->info('Licenses have been found, deleting the current ones, and replacing them with the new ones.');
         // Empty the licenses table
         $this->command->info('Emptying the current licenses table.');
         \License::truncate();
         foreach ($licenses as $license) {
             \License::create(array('domain_content' => $license->domain_content, 'domain_data' => $license->domain_data, 'domain_software' => $license->domain_software, 'family' => $license->family, 'license_id' => $license->license_id, 'is_generic' => @$license->is_generic, 'is_okd_compliant' => $license->is_okd_compliant, 'is_osi_compliant' => $license->is_osi_compliant, 'maintainer' => $license->maintainer, 'status' => $license->status, 'title' => $license->title, 'url' => $license->url));
         }
         $this->command->info('Added the licenses from a local json file.');
     } else {
         $this->command->info('The licenses from the json file were empty, the old ones will not be replaced.');
     }
 }
开发者ID:netsensei,项目名称:core,代码行数:24,代码来源:DcatSeeder.php


注:本文中的License类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。