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


PHP VQMod类代码示例

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


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

示例1: modelFromDirectory

 /**
  * Allows loading from a specified directory instead of DIR_APPLICATION
  *
  * @param $model
  * @param $directory
  * @throws Exception when file was not found
  */
 private function modelFromDirectory($model, $directory)
 {
     if (!$directory) {
         $directory = DIR_APPLICATION;
     }
     $file = $directory . '/model/' . $model . '.php';
     $class = 'Model' . preg_replace('/[^a-zA-Z0-9]/', '', $model);
     if (file_exists($file)) {
         if (class_exists('VQMod')) {
             include_once VQMod::modCheck(modification($file), $file);
         } else {
             include_once $file;
         }
         $this->registry->set('model_' . str_replace('/', '_', $model), new $class($this->registry));
     } else {
         throw new Exception('Model not found', 404);
     }
 }
开发者ID:projectwife,项目名称:tesitoo-opencart,代码行数:25,代码来源:loader.php

示例2: execute

 private function execute($action)
 {
     if (method_exists($action, 'getFile')) {
         if (file_exists($action->getFile())) {
             require_once VQMod::modCheck($action->getFile());
             $class = $action->getClass();
             $controller = new $class($this->registry);
             if (is_callable(array($controller, $action->getMethod()))) {
                 $action = call_user_func_array(array($controller, $action->getMethod()), $action->getArgs());
             } else {
                 $action = $this->error;
                 $this->error = '';
             }
         } else {
             $action = $this->error;
             $this->error = '';
         }
     } else {
         $result = $action->execute($this->registry);
         if (is_object($result)) {
             $action = $result;
         } elseif ($result === false) {
             $action = $this->error;
             $this->error = '';
         } else {
             $action = false;
         }
     }
     return $action;
 }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:30,代码来源:vq2-system_engine_front.php

示例3: vqmod_resolve

 public function vqmod_resolve($file)
 {
     if (class_exists('VQMod')) {
         $is_static = false;
         $folder = dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'vqmod' . DIRECTORY_SEPARATOR;
         $vqmod_file_contents = file_get_contents($folder . 'vqmod.php');
         $is_static = stripos($vqmod_file_contents, 'public static function modCheck') !== FALSE;
         if ($is_static) {
             $file = VQMod::modCheck($file);
         } else {
             $vqmod = new VQMod();
             $file = $vqmod->modCheck($file);
             unset($vqmod);
         }
     }
     return $file;
 }
开发者ID:artlabsdesign,项目名称:missbloom,代码行数:17,代码来源:nitro_db.php

示例4: autoload

function autoload($class)
{
    $file = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (is_file($file)) {
        include_once VQMod::modCheck(modification($file), $file);
        return true;
    }
    return false;
}
开发者ID:rootcave,项目名称:9livesprints-web,代码行数:9,代码来源:vq2-system_startup.php

示例5: __construct

 public function __construct($driver, $hostname, $username, $password, $database)
 {
     if (file_exists(DIR_DATABASE . $driver . '.php')) {
         require_once VQMod::modCheck(DIR_DATABASE . $driver . '.php');
     } else {
         exit('Error: Could not load database file ' . $driver . '!');
     }
     $this->driver = new $driver($hostname, $username, $password, $database);
 }
开发者ID:ngogiangthanh,项目名称:choloncantho-final,代码行数:9,代码来源:vq2-system_library_db.php

示例6: query

 public function query($sql)
 {
     require_once VQMod::modCheck(DIR_SYSTEM . 'nitro/config.php');
     require_once VQMod::modCheck(DIR_SYSTEM . 'nitro/core/core.php');
     $nitroPersistence = getNitroPersistence();
     if (!empty($nitroPersistence['Nitro']['Enabled']) && $nitroPersistence['Nitro']['Enabled'] == 'yes' && !empty($nitroPersistence['Nitro']['DBCache']['Enabled']) && $nitroPersistence['Nitro']['DBCache']['Enabled'] == 'yes') {
         $nitro_matches = array();
         $nitro_match = false;
         // Product COUNT Queries
         if (!empty($nitroPersistence['Nitro']['DBCache']['ProductCountQueries']) && $nitroPersistence['Nitro']['DBCache']['ProductCountQueries'] == 'yes') {
             $nitro_match = preg_match('~SELECT.*COUNT\\(.*FROM.*[^0-9a-zA-Z_]' . DB_PREFIX . '(product)([\\s]|$)~i', $sql, $nitro_matches);
         }
         // Category COUNT Queries
         if (!$nitro_match && !empty($nitroPersistence['Nitro']['DBCache']['CategoryCountQueries']) && $nitroPersistence['Nitro']['DBCache']['CategoryCountQueries'] == 'yes') {
             $nitro_match = preg_match('~SELECT.*COUNT\\(.*FROM.*[^0-9a-zA-Z_]' . DB_PREFIX . '(category)([\\s]|$)~i', $sql, $nitro_matches);
         }
         // Category Queries
         if (!$nitro_match && !empty($nitroPersistence['Nitro']['DBCache']['CategoryQueries']) && $nitroPersistence['Nitro']['DBCache']['CategoryQueries'] == 'yes') {
             $nitro_match = preg_match('~SELECT.*FROM.*[^0-9a-zA-Z_]' . DB_PREFIX . '(category)([\\s]|$)~i', $sql, $nitro_matches);
         }
         // SEO URLs Queries
         if (!$nitro_match && !empty($nitroPersistence['Nitro']['DBCache']['SeoUrls']) && $nitroPersistence['Nitro']['DBCache']['SeoUrls'] == 'yes') {
             $nitro_match = preg_match('~SELECT.*FROM.*[^0-9a-zA-Z_]' . DB_PREFIX . '(url_alias)([\\s]|$)~i', $sql, $nitro_matches);
         }
         // Search Queries
         if (!$nitro_match && !empty($nitroPersistence['Nitro']['DBCache']['Search']) && $nitroPersistence['Nitro']['DBCache']['Search'] == 'yes') {
             $nitro_match = preg_match('~SELECT.*WHERE.*(LIKE|MATCH)~i', $sql, $nitro_matches);
             if ($nitro_match) {
                 $nitro_match = false;
                 if (!empty($nitroPersistence['Nitro']['DBCache']['SearchKeywords'])) {
                     $nitro_keywords = explode(",", $nitroPersistence['Nitro']['DBCache']['SearchKeywords']);
                     foreach ($nitro_keywords as $nitro_keyword) {
                         if (stripos(trim($nitro_keyword), $sql) !== FALSE) {
                             $nitro_match = true;
                             break;
                         }
                     }
                 }
             }
         }
         if ($nitro_match) {
             require_once VQMod::modCheck(DIR_SYSTEM . 'nitro/core/dbcache.php');
             $nitro_cache_selector = strtolower($nitro_matches[1]) . '.' . md5($sql);
             // category.6ef5cee93ce985fe9de730a1d837455d
             $nitro_result = getNitroDBCache($nitro_cache_selector);
             if ($nitro_result !== FALSE) {
                 return $nitro_result;
             }
         }
     }
     if (!empty($nitro_cache_selector)) {
         $nitro_db_result = $this->driver->query($sql);
         setNitroDBCache($nitro_cache_selector, $nitro_db_result);
         return $nitro_db_result;
     }
     return $this->driver->query($sql);
 }
开发者ID:BulatSa,项目名称:Ctex,代码行数:57,代码来源:vq2-system_library_db.php

示例7: _autoloadController

 private static function _autoloadController($class)
 {
     preg_match_all('/((?:^|[A-Z])[a-z]+)/', $class, $matches);
     if (isset($matches[0][1]) && isset($matches[0][2])) {
         $file = DIR_APPLICATION . 'controller/' . strtolower($matches[0][1]) . '/' . strtolower($matches[0][2]) . '.php';
         if (file_exists($file)) {
             require_once VQMod::modCheck(VQMod::modCheck($file));
         }
     }
 }
开发者ID:ngogiangthanh,项目名称:choloncantho-final,代码行数:10,代码来源:vq2-system_library_msloader.php

示例8: helper

 public function helper($helper)
 {
     $file = DIR_SYSTEM . 'helper/' . str_replace('../', '', (string) $helper) . '.php';
     if (file_exists($file)) {
         include_once VQMod::modCheck(modification($file), $file);
     } else {
         trigger_error('Error: Could not load helper ' . $file . '!');
         exit;
     }
 }
开发者ID:phucsystem,项目名称:sannhaonline,代码行数:10,代码来源:vq2-system_storage_modification_system_engine_loader.php

示例9: helper

 public function helper($helper)
 {
     $file = DIR_SYSTEM . 'helper/' . $helper . '.php';
     if (file_exists($file)) {
         include_once VQMod::modCheck($file);
     } else {
         trigger_error('Error: Could not load helper ' . $file . '!');
         exit;
     }
 }
开发者ID:mirzavu,项目名称:clothfarm,代码行数:10,代码来源:vq2-system_engine_loader.php

示例10: autoload

function autoload($class)
{
    $file = DIR_SYSTEM . 'library/' . str_replace('\\', '/', strtolower($class)) . '.php';
    if (file_exists($file)) {
        include VQMod::modCheck(modification($file));
        return true;
    } else {
        return false;
    }
}
开发者ID:nguyendev,项目名称:Opencart,代码行数:10,代码来源:vq2-system_startup.php

示例11: __construct

 public function __construct($driver, $hostname, $username, $password, $database)
 {
     $file = DIR_DATABASE . $driver . '.php';
     if (file_exists($file)) {
         require_once VQMod::modCheck($file);
         $class = 'DB' . $driver;
         $this->driver = new $class($hostname, $username, $password, $database);
     } else {
         exit('Error: Could not load database driver type ' . $driver . '!');
     }
 }
开发者ID:deepakdesai,项目名称:CressoyoWebApp,代码行数:11,代码来源:vq2-system_library_db.php

示例12: load

 public function load($filename)
 {
     $file = DIR_CONFIG . $filename . '.php';
     if (file_exists($file)) {
         $_ = array();
         require VQMod::modCheck($file);
         $this->data = array_merge($this->data, $_);
     } else {
         trigger_error('Error: Could not load config ' . $filename . '!');
         exit;
     }
 }
开发者ID:ngogiangthanh,项目名称:choloncantho-final,代码行数:12,代码来源:vq2-system_library_config.php

示例13: database

 public function database($driver, $hostname, $username, $password, $database)
 {
     $file = DIR_SYSTEM . 'database/' . $driver . '.php';
     $class = 'Database' . preg_replace('/[^a-zA-Z0-9]/', '', $driver);
     if (file_exists($file)) {
         include_once VQMod::modCheck($file);
         $this->registry->set(str_replace('/', '_', $driver), new $class($hostname, $username, $password, $database));
     } else {
         trigger_error('Error: Could not load database ' . $driver . '!');
         exit;
     }
 }
开发者ID:blogfor,项目名称:pci,代码行数:12,代码来源:vq2-system_engine_loader.php

示例14: modCheck

 public static function modCheck($file)
 {
     global $vqmod;
     if (class_exists('VQMod')) {
         if (isset($vqmod) && is_object($vqmod)) {
             return $vqmod->modCheck($file);
         }
         if (isset(VQMod::$_vqversion)) {
             return VQMod::modCheck($file);
         }
     }
     return $file;
 }
开发者ID:blogfor,项目名称:pcu,代码行数:13,代码来源:ka_vqmod.php

示例15: load

 public function load($filename)
 {
     $_ = array();
     $file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';
     if (file_exists($file)) {
         require VQMod::modCheck($file);
     }
     $file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';
     if (file_exists($file)) {
         require VQMod::modCheck($file);
     }
     $this->data = array_merge($this->data, $_);
     return $this->data;
 }
开发者ID:honeynatividad,项目名称:mircatu,代码行数:14,代码来源:vq2-system_library_language.php


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