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


PHP utility类代码示例

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


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

示例1: _initialize

 protected function _initialize()
 {
     global $lC_Vqmod;
     $lC_DirectoryListing = new lC_DirectoryListing(DIR_FS_CATALOG . 'addons');
     $lC_DirectoryListing->setRecursive(true);
     $lC_DirectoryListing->setIncludeDirectories(false);
     $lC_DirectoryListing->setCheckExtension('php');
     $lC_DirectoryListing->setStats(true);
     $enabled = '';
     $lC_Addons_data = array();
     foreach ($lC_DirectoryListing->getFiles() as $addon) {
         $ao = utility::cleanArr($addon);
         if ($ao['name'] != 'controller.php') {
             continue;
         }
         $nameArr = explode('/', $ao['path']);
         $class = $nameArr[count($nameArr) - 2];
         if (file_exists($ao['path'])) {
             include_once $lC_Vqmod->modCheck($ao['path']);
             $aoData = new $class();
             $_SESSION['lC_Addons_data'][$class] = array('type' => $aoData->getAddonType(), 'title' => $aoData->getAddonTitle(), 'description' => $aoData->getAddonDescription(), 'rating' => $aoData->getAddonRating(), 'author' => $aoData->getAddonAuthor(), 'authorWWW' => $aoData->getAddonAuthorWWW(), 'thumbnail' => $aoData->getAddonThumbnail(), 'version' => $aoData->getAddonVersion(), 'compatibility' => $aoData->getCompatibility(), 'installed' => $aoData->isInstalled(), 'mobile' => $aoData->isMobileEnabled(), 'enabled' => $aoData->isEnabled());
             if ($aoData->isEnabled()) {
                 $enabled .= $addon['path'] . ';';
             }
         }
     }
     if ($enabled != '') {
         $enabled = substr($enabled, 0, -1);
     }
     if (!file_exists(DIR_FS_WORK . 'cache/addons.cache')) {
         file_put_contents(DIR_FS_WORK . 'cache/addons.cache', serialize($enabled));
     }
     $this->_data = $_SESSION['lC_Addons_data'];
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:34,代码来源:addons.php

示例2: logEvent

 private function logEvent($eventCatagory, $loanID, $itemID)
 {
     $timeNow = date('Y-m-d H:i:s');
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         echo "Error connecting to database";
         exit;
     }
     $sql = "\n\t\t\t\tINSERT INTO eventLog \n\t\t\t\t\t   ( \n\t\t\t\t\t\t  FK_ITEM_ID,\n\t\t\t\t\t\t  FK_LOAN_ID,\n\t\t\t\t\t\t  event,\n\t\t\t\t\t\t  eventDate\n\t\t\t\t\t   )\n\t\t\t\t    VALUES\n\t\t\t\t\t   (\n\t\t\t\t\t\t  :id,\n\t\t\t\t\t\t  :loanID,\n\t\t\t\t\t\t  :event,\n\t\t\t\t\t\t  :eventDate\n\t\t\t\t\t   )\n\t\t\t\t";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $itemID);
         $STH->bindParam(':loanID', $loanID);
         $STH->bindParam(':event', $eventCatagory);
         $STH->bindParam(':eventDate', $timeNow);
         $DBH->beginTransaction();
         $sqlError = $STH->execute();
         if (!$sqlError) {
             echo 'Error: updating event log data';
             print_r($DBH->errorInfo());
             echo "<p>";
             print_r($STH->errorInfo());
             exit;
         }
         $DBH->commit();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \FALSE;
     }
     $DBH = \NULL;
     return \TRUE;
 }
开发者ID:JLBR,项目名称:School-Projects,代码行数:33,代码来源:eventlog.class.php

示例3: getByOwner

 public function getByOwner($ownerID)
 {
     $DBH = utility::connectToDB();
     if ($DBH == \NULL) {
         return \NULL;
     }
     $sql = "\n\t\t\t\t  SELECT \n\t\t\t\t\t     * \n\t\t\t\t  FROM \n\t\t\t\t      items\n\t\t\t\t  WHERE \n\t\t\t\t\t  owner = :id\n\t\t\t\t  ";
     try {
         $STH = $DBH->prepare($sql);
         $STH->bindParam(':id', $ownerID);
         if ($STH->execute()) {
             $results = $STH->fetchAll();
         } else {
             echo 'Error: retreaving data\\n';
             print_r($DBH->errorInfo());
             print_r($STH->errorInfo());
             return \NULL;
         }
         $count = $STH->rowCount();
     } catch (PDOException $e) {
         echo 'Error: ' . $e->getMessage();
         $DBH = \NULL;
         return \NULL;
     }
     $DBH = \NULL;
     return Items::newCollection($results, $count);
 }
开发者ID:JLBR,项目名称:School-Projects,代码行数:27,代码来源:items.class.php

示例4: _doRegister

 /**
  * Register the new install with the LC API
  *  
  * @access private      
  * @return string
  */
 private function _doRegister($data)
 {
     global $lC_Database, $lC_Cache;
     if (isset($data['activation_email']) && $data['activation_email'] != NULL) {
         $storeEmail = $data['activation_email'];
     } else {
         $storeEmail = STORE_OWNER_EMAIL_ADDRESS;
     }
     if (isset($data['activation_serial']) && $data['activation_serial'] != NULL) {
         $storeSerial = $data['activation_serial'];
     } else {
         $storeSerial = '';
     }
     // register the install with LC API
     $registerArr = array('serial' => $storeSerial, 'storeName' => STORE_NAME, 'storeEmail' => $storeEmail, 'storeWWW' => HTTP_SERVER . DIR_WS_HTTP_CATALOG, 'storeSSL' => HTTPS_SERVER . DIR_WS_HTTPS_CATALOG, 'systemMetaData' => base64_encode(json_encode(lc_get_system_information())), 'serverMetaData' => isset($_SERVER) && is_array($_SERVER) ? base64_encode(json_encode($_SERVER)) : NULL, 'envMetaData' => isset($_ENV) && is_array($_ENV) ? base64_encode(json_encode($_ENV)) : NULL);
     $checksum = hash('sha256', json_encode($registerArr));
     $registerArr['checksum'] = $checksum;
     $api_version = defined('API_VERSION') && API_VERSION != NULL ? API_VERSION : '1_0';
     $registerArr['ver'] = utility::getVersion();
     $request_type = getRequestType();
     $resultXML = transport::getResponse(array('url' => $request_type . '://api.loadedcommerce.com/' . $api_version . '/register/install/', 'method' => 'post', 'parameters' => $registerArr, 'timeout' => 10));
     $newInstallationID = preg_match("'<installationID[^>]*?>(.*?)</installationID>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     $products = preg_match("'<products[^>]*?>(.*?)</products>'i", $resultXML, $regs) == 1 ? $regs[1] : NULL;
     if (lC_Server_info_Admin::updateInstallID($newInstallationID)) {
         return utility::arr2xml(array('error' => FALSE, 'installationID' => $newInstallationID, 'products' => $products));
     } else {
         return utility::arr2xml(array('error' => TRUE, 'message' => 'error processing the request'));
     }
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:35,代码来源:api.php

示例5: isInstalled

 public function isInstalled()
 {
     if (utility::isB2B() === false) {
         return false;
     }
     return (bool) defined('MODULE_ORDER_TOTAL_TERMS_HANDLING_STATUS');
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:7,代码来源:terms_handling.php

示例6: setFunction

 public function setFunction($value, $value2 = null)
 {
     global $lC_Language;
     if (utility::isPro() === false) {
         $string = '<span class="input large-margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative disabled date-available-ends margin-bottom">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong upsellwrapper" style="position:absolute;top:-29px;left:0px;">
                  <span class="upsellinfo" upselltitle="' . $lC_Language->get('text_availability_ends') . '" upselldesc="' . $lC_Language->get('text_availability_ends_desc') . '">Ends</span> ' . lc_go_pro() . '
                </div>
                ' . lc_draw_input_field('availability_ends_go_pro', null, 'id="availability_ends_go_pro" class="input-unstyled" disabled') . '
              </span>
              ';
     } else {
         $string = '<div class="no-wrap"><span class="input large-margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                ' . lc_draw_input_field('attributes[' . self::getID() . ']', $value, 'id="attributes_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span>
              <span class="input relative date-available-ends margin-bottom" style="width:46%;">
                <span class="icon-calendar mid-margin-right"></span>
                <div class="strong" style="position:absolute;top:-29px;left:0px;">
                  <span>Ends</span>
                </div>
                ' . lc_draw_input_field('attributes2[' . self::getID() . ']', $value2, 'id="attributes2_' . self::getID() . '" class="input-unstyled datepicker"') . '
              </span></div>
              ';
     }
     return $string;
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:32,代码来源:date_available.php

示例7: Ret

 public static function Ret()
 {
     if (!self::$SINGLETON) {
         self::$SINGLETON = new utility();
     }
     return self::$SINGLETON;
 }
开发者ID:kydreth,项目名称:BreathePHP,代码行数:7,代码来源:utility.php

示例8: setMediaType

 public static function setMediaType()
 {
     $_SESSION['mediaType'] = $_GET['type'];
     $_SESSION['mediaSize'] = $_GET['size'];
     $browserArr = utility::detectBrowser();
     $_SESSION['browserName'] = $browserArr['name'];
     $_SESSION['browserVersion'] = $browserArr['version'];
     $result['rpcStatus'] = '1';
     echo json_encode($result);
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:10,代码来源:rpc.php

示例9: __construct

 public function __construct()
 {
     global $lC_Language, $lC_Api, $ioncube_check;
     $this->_page_title = $lC_Language->get('heading_title');
     $this->_has_wrapper = false;
     $this->_has_header = false;
     $this->_has_footer = false;
     // added for ioncube check
     $ioncube_check = utility::ioncubeCheck();
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:10,代码来源:login.php

示例10: process

 function process()
 {
     global $lC_ShoppingCart, $lC_Currencies;
     // restrict to payment and confirmation pages
     if (strstr($_SERVER['REQUEST_URI'], 'shipping=process') || strstr($_SERVER['REQUEST_URI'], 'confirmation')) {
         if (utility::isB2B() === true) {
             $value = isset($_SESSION['this_handling']) && $_SESSION['this_handling'] > 0 ? $_SESSION['this_handling'] : 0;
             $this->output[] = array('title' => $this->_title . ':', 'text' => $lC_Currencies->getSessionSymbolLeft() . number_format($value, DECIMAL_PLACES) . $lC_Currencies->getSessionSymbolRight(), 'value' => $value);
         }
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:11,代码来源:terms_handling.php

示例11: getMaxOfArray

 public static function getMaxOfArray($ArrayToCheck)
 {
     $maxValue = 0;
     foreach ($ArrayToCheck as $temp) {
         if (is_array($temp)) {
             $maxValue = max($maxValue, utility::getMaxOfArray($temp));
         } else {
             $maxValue = max($maxValue, $temp);
         }
     }
     return $maxValue;
 }
开发者ID:Adrielpin,项目名称:gchartphp,代码行数:12,代码来源:utility.php

示例12: resize

 public function resize($image, $group_id)
 {
     if (lc_empty(CFG_APP_IMAGEMAGICK_CONVERT) || !@file_exists(CFG_APP_IMAGEMAGICK_CONVERT) || utility::execEnabled() === false) {
         return $this->resizeWithGD($image, $group_id);
     }
     if (!file_exists(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'])) {
         mkdir(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code']);
         @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'], 0777);
     }
     exec(escapeshellarg(CFG_APP_IMAGEMAGICK_CONVERT) . ' -resize ' . (int) $this->_groups[$group_id]['size_width'] . 'x' . (int) $this->_groups[$group_id]['size_height'] . ($this->_groups[$group_id]['force_size'] == '1' ? '!' : '') . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[1]['code'] . '/' . $image) . ' ' . escapeshellarg(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image));
     @chmod(DIR_FS_CATALOG . DIR_WS_IMAGES . 'products/' . $this->_groups[$group_id]['code'] . '/' . $image, 0777);
 }
开发者ID:rajeshb001,项目名称:itpl_loaded7,代码行数:12,代码来源:image.php

示例13: __construct

 /**
  * Constructor; load the category structure relationship data from the database
  *
  * @access public
  */
 public function __construct()
 {
     global $lC_Database, $lC_Cache, $lC_Language, $lC_Customer;
     if (SERVICES_CATEGORY_PATH_CALCULATE_PRODUCT_COUNT == '1') {
         $this->_show_total_products = true;
     }
     if ($lC_Cache->isEnabled() && $lC_Cache->read('category_tree-' . $lC_Language->getCode(), 720)) {
         $this->_data = $lC_Cache->getCache();
     } else {
         $Qcategories = $lC_Database->query('select c.categories_id, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url, c.categories_status, c.categories_visibility_nav, c.categories_visibility_box, c.access_levels, cd.categories_name, cd.categories_menu_name from :table_categories c, :table_categories_description cd where c.categories_status = 1 and c.categories_id = cd.categories_id and cd.language_id = :language_id');
         $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);
         $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);
         $Qcategories->bindInt(':language_id', $lC_Language->getID());
         $Qcategories->appendQuery('order by c.parent_id, c.sort_order, cd.categories_name, cd.categories_menu_name');
         $Qcategories->execute();
         while ($Qcategories->next()) {
             // added to grab permalink if exists
             $Qpermalink = $lC_Database->query('select item_id, query, permalink from :table_permalinks where item_id = :item_id and language_id = :language_id and type = 1 limit 1');
             $Qpermalink->bindTable(':table_permalinks', TABLE_PERMALINKS);
             $Qpermalink->bindInt(':item_id', $Qcategories->valueInt('categories_id'));
             $Qpermalink->bindInt(':language_id', $lC_Language->getID());
             $Qpermalink->execute();
             $this->_data[$Qcategories->valueInt('parent_id')][$Qcategories->valueInt('categories_id')] = array('item_id' => $Qpermalink->valueInt('item_id'), 'name' => $Qcategories->value('categories_name'), 'menu_name' => $Qcategories->value('categories_menu_name'), 'query' => $Qpermalink->value('query'), 'permalink' => $Qpermalink->value('permalink'), 'image' => $Qcategories->value('categories_image'), 'count' => 0, 'mode' => $Qcategories->value('categories_mode'), 'link_target' => $Qcategories->valueInt('categories_link_target'), 'custom_url' => $Qcategories->value('categories_custom_url'), 'status' => $Qcategories->valueInt('categories_status'), 'nav' => $Qcategories->valueInt('categories_visibility_nav'), 'box' => $Qcategories->valueInt('categories_visibility_box'), 'access_levels' => $Qcategories->value('access_levels'));
         }
         if ($this->_show_total_products === true) {
             $this->_calculateProductTotals();
         }
         if (utility::isB2B() && !isset($_SESSION['admin'])) {
             $catArr = array();
             $gAccess = explode(';', $lC_Customer->getCustomerGroupAccess());
             foreach ($this->_data as $parent_id => $data) {
                 foreach ($data as $categories_id => $cData) {
                     $cAccess = explode(';', $cData['access_levels']);
                     foreach ($gAccess as $key => $gLevel) {
                         if (in_array($gLevel, $cAccess)) {
                             $catArr[$parent_id][$categories_id] = $cData;
                             break;
                         }
                     }
                 }
             }
             $this->_data = $catArr;
         }
         if ($lC_Cache->isEnabled()) {
             $lC_Cache->write($this->_data);
         }
     }
 }
开发者ID:abhiesa-tolexo,项目名称:loaded7,代码行数:53,代码来源:category_tree.php

示例14: visitOnLoan

function visitOnLoan($member_id)
{
    global $dbs;
    $now = date('Y-m-d');
    // check if already checkin
    $query = $dbs->query('SELECT visitor_id FROM visitor_count WHERE member_id=\'' . $member_id . '\' AND checkin_date LIKE \'' . $now . '%\'');
    if ($query->num_rows < 1) {
        // get data
        $mquery = $dbs->query('SELECT member_name, inst_name FROM member WHERE member_id=\'' . $member_id . '\'');
        $mdata = $mquery->fetch_row();
        $member_name = $mdata[0];
        $institution = $mdata[1];
        // insert visit
        $checkin_date = date('Y-m-d H:i:s');
        $insert = $dbs->query("INSERT INTO visitor_count (member_id, member_name, institution, checkin_date) VALUES ('{$member_id}', '{$member_name}', '{$institution}', '{$checkin_date}')");
        if (!$insert) {
            utility::jsAlert(__('ERROR! Can\'t insert visitor counter data'));
            return false;
        }
    }
    return true;
}
开发者ID:mucill,项目名称:slims8_akasia,代码行数:22,代码来源:circulation_action.php

示例15: define

 */
/* Reserve List */
// key to authenticate
define('INDEX_AUTH', '1');
// main system configuration
require '../../../../sysconfig.inc.php';
// IP based access limitation
require LIB_DIR . 'ip_based_access.inc.php';
do_checkIP('smc');
do_checkIP('smc-circulation');
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
// privileges checking
$can_read = utility::havePrivilege('circulation', 'r');
$can_write = utility::havePrivilege('circulation', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to access this area!') . '</div>');
}
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/form_maker/simbio_form_element.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
require MODULES_BASE_DIR . 'reporting/report_dbgrid.inc.php';
$page_title = 'Reservation List Report';
$reportView = false;
if (isset($_GET['reportView'])) {
    $reportView = true;
}
if (!$reportView) {
    ?>
开发者ID:indonesia,项目名称:slims5_meranti,代码行数:31,代码来源:reserve_list.php


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