本文整理汇总了PHP中Version::retrieve_by_string_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP Version::retrieve_by_string_fields方法的具体用法?PHP Version::retrieve_by_string_fields怎么用?PHP Version::retrieve_by_string_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Version
的用法示例。
在下文中一共展示了Version::retrieve_by_string_fields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findAllFiles
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $sugar_config, $mod_strings;
print $mod_strings['LBL_CLEAR_CHART_DATA_CACHE_FINDING'] . "<br>";
$search_dir = 'cache/';
if (!empty($sugar_config['cache_dir'])) {
$search_dir = $sugar_config['cache_dir'];
}
$all_src_files = findAllFiles($search_dir . '/xml', array());
print $mod_strings['LBL_CLEAR_CHART_DATA_CACHE_DELETING1'] . "<br>";
foreach ($all_src_files as $src_file) {
if (preg_match('/\\.xml$/', $src_file)) {
print $mod_strings['LBL_CLEAR_CHART_DATA_CACHE_DELETING2'] . " {$src_file}<BR>";
unlink("{$src_file}");
}
}
include 'modules/Versions/ExpectedVersions.php';
global $expect_versions;
if (isset($expect_versions['Chart Data Cache'])) {
$version = new Version();
$version->retrieve_by_string_fields(array('name' => 'Chart Data Cache'));
$version->name = $expect_versions['Chart Data Cache']['name'];
$version->file_version = $expect_versions['Chart Data Cache']['file_version'];
$version->db_version = $expect_versions['Chart Data Cache']['db_version'];
$version->save();
}
echo "\n--- " . $mod_strings['LBL_DONE'] . "---<br />\n";
示例2: clearXMLfiles
public function clearXMLfiles()
{
global $mod_strings;
if ($this->show_output) {
echo "<h3>{$mod_strings['LBL_QR_XMLFILES']}</h3>";
}
$this->_clearCache(sugar_cached("xml"), '.xml');
include 'modules/Versions/ExpectedVersions.php';
global $expect_versions;
if (isset($expect_versions['Chart Data Cache'])) {
$version = new Version();
$version->retrieve_by_string_fields(array('name' => 'Chart Data Cache'));
$version->name = $expect_versions['Chart Data Cache']['name'];
$version->file_version = $expect_versions['Chart Data Cache']['file_version'];
$version->db_version = $expect_versions['Chart Data Cache']['db_version'];
$version->save();
}
}
示例3: Version
$oldHtaccess = file_get_contents($uploadHta);
// use a different regex boundary b/c .htaccess uses the typicals
if (strstr($oldHtaccess, $denyAll) === false) {
$oldHtaccess .= "\n";
$oldHtaccess .= $denyAll;
}
if (!file_put_contents($uploadHta, $oldHtaccess)) {
$htaccess_failed = true;
}
} else {
$htaccess_failed = true;
}
} else {
// no .htaccess yet, create a fill
if (!file_put_contents($uploadHta, $denyAll)) {
$htaccess_failed = true;
}
}
include 'modules/Versions/ExpectedVersions.php';
global $expect_versions;
if (isset($expect_versions['htaccess'])) {
$version = new Version();
$version->retrieve_by_string_fields(array('name' => 'htaccess'));
$version->name = $expect_versions['htaccess']['name'];
$version->file_version = $expect_versions['htaccess']['file_version'];
$version->db_version = $expect_versions['htaccess']['db_version'];
$version->save();
}
/* Commenting out as this shows on upgrade screen
* echo "\n" . $mod_strings['LBL_HT_DONE']. "<br />\n";
*/
示例4: foreach
foreach ($new_strings as $name => $value) {
if (!isset($strings[$name])) {
//only if they aren't the same do we write
echo "Adding Custom Array: {$name}<br>";
$keep = override_value_to_string($array_name, $name, $new_strings[$name]) . "\n";
$new_buffer .= $keep;
echo $keep . '<br><br>';
}
}
}
}
}
if (!empty($new_buffer)) {
echo 'Writing new custom file:<br>';
$fp = fopen($override, 'w');
fwrite($fp, "<?php\n" . $new_buffer . "?>");
}
}
if (isset($expect_versions['Custom Labels'])) {
echo $mod_strings['LBL_UPGRADE_VERSION'] . ': DB Version - ' . $expect_versions['Custom Labels']['db_version'] . '<br>';
$version = new Version();
$version->retrieve_by_string_fields(array('name' => $expect_versions['Custom Labels']['name']));
$version->name = $expect_versions['Custom Labels']['name'];
$version->db_version = $expect_versions['Custom Labels']['db_version'];
$version->file_version = $expect_versions['Custom Labels']['file_version'];
$version->save();
if (isset($_SESSION['invalid_versions']['Custom Labels'])) {
unset($_SESSION['invalid_versions']['Custom Labels']);
}
}
echo "\n--- DONE ---<br />\n";