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


PHP modX::quote方法代码示例

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


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

示例1: previousVersionInstalled

 /**
  * Indicates if a previous version of the package is installed.
  *
  * @return boolean True if a previous version of the package is installed.
  */
 public function previousVersionInstalled()
 {
     $this->parseSignature();
     $count = $this->xpdo->getCount('transport.modTransportPackage', array(array("UCASE({$this->xpdo->escape('package_name')}) LIKE UCASE({$this->xpdo->quote($this->identifier)})"), 'installed:IS NOT' => null, 'signature:!=' => $this->get('signature')));
     return $count > 0;
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:11,代码来源:modtransportpackage.class.php

示例2: foreach

             break;
     }
     /** @var xPDOObject $object */
     foreach ($modx->getIterator($class, $classCriteria) as $object) {
         if ($package->put($object, $classAttributes)) {
             $instances++;
         } else {
             $modx->log(modX::LOG_LEVEL_WARN, "Could not package {$class} instance with pk: " . print_r($object->getPrimaryKey()));
         }
     }
     $modx->log(modX::LOG_LEVEL_INFO, "Packaged {$instances} of {$class}");
 }
 /* collect table names from classes and grab any additional tables/data not listed */
 $coreTables = array();
 foreach ($classes as $class) {
     $coreTables[$class] = $modx->quote($modx->literal($modx->getTableName($class)));
 }
 $stmt = $modx->query("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (" . implode(',', $coreTables) . ")");
 $extraTables = $stmt->fetchAll(PDO::FETCH_COLUMN);
 if (is_array($extraTables) && !empty($extraTables)) {
     $modx->loadClass('vapor.vaporVehicle', VAPOR_DIR . 'model/', true, true);
     $excludeExtraTablePrefix = isset($vaporOptions['excludeExtraTablePrefix']) && is_array($vaporOptions['excludeExtraTablePrefix']) ? $vaporOptions['excludeExtraTablePrefix'] : array();
     $excludeExtraTables = isset($vaporOptions['excludeExtraTables']) && is_array($vaporOptions['excludeExtraTables']) ? $vaporOptions['excludeExtraTables'] : array();
     foreach ($extraTables as $extraTable) {
         if (in_array($extraTable, $excludeExtraTables)) {
             continue;
         }
         if (!XPDO_CLI_MODE && !ini_get('safe_mode')) {
             set_time_limit(0);
         }
         $instances = 0;
开发者ID:Tramp1357,项目名称:atlasorg,代码行数:31,代码来源:vapor.php

示例3: process


//.........这里部分代码省略.........
                                         $sourceBasePath = str_replace('\\', '/', substr($source, strpos($source, ':') + 1));
                                     }
                                     $target = 'dirname(MODX_BASE_PATH) . "/sources/' . ltrim(dirname($sourceBasePath), '/') . '/"';
                                     $classAttributes['resolve'][] = array('type' => 'file', 'source' => $source, 'target' => "return {$target};");
                                     $classAttributes['resolve'][] = array('type' => 'php', 'source' => VAPOR_DIR . 'scripts/resolve.media_source.php', 'target' => $sourceBasePath, 'targetRelative' => false, 'targetPrepend' => "return dirname(MODX_BASE_PATH) . '/sources/';");
                                 }
                             }
                         }
                         if ($package->put($object, $classAttributes)) {
                             $instances++;
                         } else {
                             $modx->log(modX::LOG_LEVEL_WARN, "Could not package {$class} instance with pk: " . print_r($object->getPrimaryKey(), true));
                         }
                     }
                     $modx->log(modX::LOG_LEVEL_INFO, "Packaged {$instances} of {$class}");
                     continue 2;
                 default:
                     break;
             }
             /** @var xPDOObject $object */
             foreach ($modx->getIterator($class, $classCriteria) as $object) {
                 if ($package->put($object, $classAttributes)) {
                     $instances++;
                 } else {
                     $modx->log(modX::LOG_LEVEL_WARN, "Could not package {$class} instance with pk: " . print_r($object->getPrimaryKey(), true));
                 }
             }
             $modx->log(modX::LOG_LEVEL_INFO, "Packaged {$instances} of {$class}");
         }
         /* collect table names from classes and grab any additional tables/data not listed */
         $coreTables = array();
         $extraTables = array();
         foreach ($classes as $class) {
             $coreTables[$class] = $modx->quote($modx->literal($modx->getTableName($class)));
         }
         if ($coreTables) {
             $stmt = $modx->query("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (" . implode(',', $coreTables) . ")");
             $extraTables = $stmt->fetchAll(PDO::FETCH_COLUMN);
         }
         if (is_array($extraTables) && !empty($extraTables)) {
             //$modx->loadClass('vapor.vaporVehicle', VAPOR_DIR . 'model/', true, true);
             $modx->loadClass('vapor.vaporVehicle', VAPOR_DIR, true, true);
             $excludeExtraTablePrefix = isset($vaporOptions['excludeExtraTablePrefix']) && is_array($vaporOptions['excludeExtraTablePrefix']) ? $vaporOptions['excludeExtraTablePrefix'] : array();
             $excludeExtraTables = isset($vaporOptions['excludeExtraTables']) && is_array($vaporOptions['excludeExtraTables']) ? $vaporOptions['excludeExtraTables'] : array();
             foreach ($extraTables as $extraTable) {
                 if (in_array($extraTable, $excludeExtraTables)) {
                     continue;
                 }
                 if (!XPDO_CLI_MODE && !ini_get('safe_mode')) {
                     set_time_limit(0);
                 }
                 $instances = 0;
                 $object = array();
                 $attributes = array('vehicle_package' => 'vapor', 'vehicle_class' => 'vaporVehicle');
                 /* remove modx table_prefix if table starts with it */
                 $extraTableName = $extraTable;
                 if (!empty($modxTablePrefix) && strpos($extraTableName, $modxTablePrefix) === 0) {
                     $extraTableName = substr($extraTableName, strlen($modxTablePrefix));
                     $addTablePrefix = true;
                 } elseif (!empty($modxTablePrefix) || in_array($extraTableName, $excludeExtraTablePrefix)) {
                     $addTablePrefix = false;
                 } else {
                     $addTablePrefix = true;
                 }
                 $object['tableName'] = $extraTableName;
                 $modx->log(modX::LOG_LEVEL_INFO, "Extracting non-core table {$extraTableName}");
开发者ID:Tramp1357,项目名称:atlasorg,代码行数:67,代码来源:create.class.php


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