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


PHP CRM_Utils_File::sourceSQLFile方法代码示例

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


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

示例1: loadSavedSearches

 /**
  * Load saved search sql files into the DB.
  */
 public function loadSavedSearches()
 {
     $dsn = CRM_Core_Config::singleton()->dsn;
     foreach (glob(dirname(__FILE__) . "/SavedSearchDataSets/*.sql") as $file) {
         CRM_Utils_File::sourceSQLFile($dsn, $file);
     }
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:10,代码来源:GroupTest.php

示例2: civicrm_api3_speakcivi_update_stats

function civicrm_api3_speakcivi_update_stats($params)
{
    $config = CRM_Core_Config::singleton();
    $sql = file_get_contents(dirname(__FILE__) . '/../../sql/update.sql', true);
    CRM_Utils_File::sourceSQLFile($config->dsn, $sql, NULL, true);
    return civicrm_api3_create_success(array("query" => $sql), $params);
}
开发者ID:WeMoveEU,项目名称:speakcivi,代码行数:7,代码来源:Speakcivi.php

示例3: offlinerecurringcontributions_civicrm_install

/**
 * Implements hook_civicrm_install().
 *
 * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_install
 */
function offlinerecurringcontributions_civicrm_install()
{
    $extensionDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $sqlName = $extensionDir . 'sql' . DIRECTORY_SEPARATOR . 'update.sql';
    CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $sqlName);
    _offlinerecurringcontributions_civix_civicrm_install();
}
开发者ID:veda-consulting,项目名称:caat-4.7-recurring,代码行数:12,代码来源:offlinerecurringcontributions.php

示例4: testReportOutput

 /**
  * @dataProvider dataProvider
  */
 public function testReportOutput($reportClass, $inputParams, $dataSet, $expectedOutputCsvFile)
 {
     $config = CRM_Core_Config::singleton();
     CRM_Utils_File::sourceSQLFile($config->dsn, dirname(__FILE__) . "/{$dataSet}");
     $reportCsvFile = $this->getReportOutputAsCsv($reportClass, $inputParams);
     $reportCsvArray = $this->getArrayFromCsv($reportCsvFile);
     $expectedOutputCsvArray = $this->getArrayFromCsv(dirname(__FILE__) . "/{$expectedOutputCsvFile}");
     $this->assertCsvArraysEqual($expectedOutputCsvArray, $reportCsvArray);
 }
开发者ID:JoeMurray,项目名称:civihr,代码行数:12,代码来源:HRAbsenceTest.php

示例5: eventcalendar_civicrm_uninstall

/**
 * Implementation of hook_civicrm_uninstall
 */
function eventcalendar_civicrm_uninstall()
{
    $cividiscountRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR;
    $cividiscountSQL = $cividiscountRoot . DIRECTORY_SEPARATOR . 'uninstall.sql';
    CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $cividiscountSQL);
    // rebuild the menu so our path is picked up
    CRM_Core_Invoke::rebuildMenuAndCaches();
    //return _eventcalendar_civix_civicrm_uninstall();
}
开发者ID:teamsinger,项目名称:com.osseed.eventcalendar,代码行数:12,代码来源:eventcalendar.php

示例6: banking_civicrm_enable

/**
 * Implementation of hook_civicrm_enable
 */
function banking_civicrm_enable()
{
    //add the required option groups
    banking_civicrm_install_options(_banking_options());
    // run the update script
    $config = CRM_Core_Config::singleton();
    $sql = file_get_contents(dirname(__FILE__) . '/sql/upgrade.sql', true);
    CRM_Utils_File::sourceSQLFile($config->dsn, $sql, NULL, true);
    return _banking_civix_civicrm_enable();
}
开发者ID:VangelisP,项目名称:org.project60.banking,代码行数:13,代码来源:banking.php

示例7: postProcess

 function postProcess()
 {
     $config = CRM_Core_Config::singleton();
     $extenDr = $config->extensionsDir;
     $sDbScriptsDir = $extenDr . DIRECTORY_SEPARATOR . 'uk.co.vedaconsulting.recurdatafix' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR;
     CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, sprintf("%supdate.sql", $sDbScriptsDir));
     //CRM_Core_Session::setStatus('Updated table civicrm_recur table with membership id', 'Success', 'info');
     CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/recurdatafix/create', 'reset=1'));
     CRM_Utils_System::civiExit();
 }
开发者ID:Kajakaran,项目名称:uk.co.vedaconsulting.recurdatafix,代码行数:10,代码来源:Update.php

示例8: _civicrm_load_navigation

/**
 * Load the navigation sql for the domain with the given name.
 *
 * @param string $domainName
 * @param int $domainID
 */
function _civicrm_load_navigation($domainName, $domainID)
{
    global $civicrm_root;
    $sqlPath = $civicrm_root . DIRECTORY_SEPARATOR . 'sql';
    $config = CRM_Core_Config::singleton();
    $generatedFile = $config->uploadDir . DIRECTORY_SEPARATOR . str_replace(' ', '_', $domainName) . uniqid() . 'nav.mysql';
    //read the entire string
    $str = file_get_contents($sqlPath . DIRECTORY_SEPARATOR . 'civicrm_navigation.mysql');
    $str = str_replace('SELECT @domainID := id FROM civicrm_domain where name = \'Default Domain Name\'', "SELECT @domainID := {$domainID}", $str);
    file_put_contents($generatedFile, $str);
    CRM_Utils_File::sourceSQLFile($config->dsn, $generatedFile, NULL, FALSE);
    CRM_Core_DAO::executeQuery("UPDATE civicrm_navigation SET label = name WHERE label = ''");
}
开发者ID:seamuslee001,项目名称:org.civicrm.multisite,代码行数:19,代码来源:Create.php

示例9: findCreateTable

 /**
  * Ensure that the required SQL table exists
  *
  * @return bool TRUE if table now exists
  */
 static function findCreateTable()
 {
     $checkTableSql = "show tables like 'civicrm_queue_item'";
     $foundName = CRM_Core_DAO::singleValueQuery($checkTableSql);
     if ($foundName == 'civicrm_queue_item') {
         return TRUE;
     }
     // civicrm/sql/civicrm_queue_item.mysql
     $fileName = dirname(__FILE__) . '/../../../sql/civicrm_queue_item.mysql';
     $config = CRM_Core_Config::singleton();
     CRM_Utils_File::sourceSQLFile($config->dsn, $fileName);
     // Make sure it succeeded
     $foundName = CRM_Core_DAO::singleValueQuery($checkTableSql);
     return $foundName == 'civicrm_queue_item';
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:20,代码来源:QueueItem.php

示例10: onUninstall

 public function onUninstall()
 {
     if (is_callable(array($this, 'uninstall'))) {
         $this->uninstall();
     }
     $files = glob($this->extensionDir . '/sql/*_uninstall.sql');
     if (is_array($files)) {
         foreach ($files as $file) {
             CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, $file);
         }
     }
     $this->setCurrentRevision(NULL);
 }
开发者ID:aghstrategies,项目名称:com.aghstrategies.petitionemail,代码行数:13,代码来源:Base.php

示例11: source

 function source($fileName, $isQueryString = false)
 {
     require_once 'CRM/Utils/File.php';
     CRM_Utils_File::sourceSQLFile($this->_config->dsn, $fileName, null, $isQueryString);
 }
开发者ID:ksecor,项目名称:civicrm,代码行数:5,代码来源:Form.php

示例12: dropAllTables

 public static function dropAllTables()
 {
     // first drop all the custom tables we've created
     CRM_Core_BAO_CustomGroup::dropAllTables();
     // drop all multilingual views
     CRM_Core_I18n_Schema::dropAllViews();
     CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'civicrm_drop.mysql');
 }
开发者ID:konadave,项目名称:civicrm-core,代码行数:8,代码来源:DAO.php

示例13: dropAllTables

 static function dropAllTables()
 {
     // first drop all the custom tables we've created
     require_once 'CRM/Core/BAO/CustomGroup.php';
     CRM_Core_BAO_CustomGroup::dropAllTables();
     // drop all multilingual views
     require_once 'CRM/Core/I18n/Schema.php';
     CRM_Core_I18n_Schema::dropAllViews();
     require_once 'CRM/Utils/File.php';
     CRM_Utils_File::sourceSQLFile(CIVICRM_DSN, dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . 'civicrm_drop.mysql');
 }
开发者ID:bhirsch,项目名称:voipdev,代码行数:11,代码来源:DAO.php

示例14: sepa_civicrm_install

/**
 * Implementation of hook_civicrm_install
 */
function sepa_civicrm_install()
{
    $config = CRM_Core_Config::singleton();
    //create the tables
    $sql = file_get_contents(dirname(__FILE__) . '/sql/sepa.sql', true);
    CRM_Utils_File::sourceSQLFile($config->dsn, $sql, NULL, true);
    return _sepa_civix_civicrm_install();
}
开发者ID:FundingWorks,项目名称:org.project60.sepa,代码行数:11,代码来源:sepa.php

示例15: source

 /**
  * @param string $fileName
  * @param bool $isQueryString
  */
 public function source($fileName, $isQueryString = FALSE)
 {
     CRM_Utils_File::sourceSQLFile($this->_config->dsn, $fileName, NULL, $isQueryString);
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:8,代码来源:Form.php


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