本文整理汇总了PHP中sugar_mkdir函数的典型用法代码示例。如果您正苦于以下问题:PHP sugar_mkdir函数的具体用法?PHP sugar_mkdir怎么用?PHP sugar_mkdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sugar_mkdir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: saveDictionaryToStorage
/**
* Save a dictionary for a particular API to storage
* @internal
* @param string $apiType The api type for the dictionary you want to load ("Rest" or "Soap")
* @param array $storageData The data that the API needs to store for it's dictionary.
*/
protected function saveDictionaryToStorage($apiType, $storageData)
{
if (!is_dir($this->cacheDir)) {
sugar_mkdir($this->cacheDir, null, true);
}
sugar_file_put_contents($this->cacheDir . 'ServiceDictionary.' . $apiType . '.php', '<' . "?php\n\$apiDictionary['" . $apiType . "'] = " . var_export($storageData, true) . ";\n");
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:13,代码来源:ServiceDictionary.php
示例2: testGetMetaDataFile
public function testGetMetaDataFile()
{
// backup custom file if it already exists
if (file_exists('custom/modules/Contacts/metadata/listviewdefs.php')) {
copy('custom/modules/Contacts/metadata/listviewdefs.php', 'custom/modules/Contacts/metadata/listviewdefs.php.bak');
unlink('custom/modules/Contacts/metadata/listviewdefs.php');
}
$this->_view->module = 'Contacts';
$this->_view->type = 'list';
$metaDataFile = $this->_view->getMetaDataFile();
$this->assertEquals('modules/Contacts/metadata/listviewdefs.php', $metaDataFile, 'Did not load the correct metadata file');
//test custom file
if (!file_exists('custom/modules/Contacts/metadata/')) {
sugar_mkdir('custom/modules/Contacts/metadata/', null, true);
}
$customFile = 'custom/modules/Contacts/metadata/listviewdefs.php';
if (!file_exists($customFile)) {
sugar_file_put_contents($customFile, array());
$customMetaDataFile = $this->_view->getMetaDataFile();
$this->assertEquals($customFile, $customMetaDataFile, 'Did not load the correct custom metadata file');
unlink($customFile);
}
// Restore custom file if we backed it up
if (file_exists('custom/modules/Contacts/metadata/listviewdefs.php.bak')) {
rename('custom/modules/Contacts/metadata/listviewdefs.php.bak', 'custom/modules/Contacts/metadata/listviewdefs.php');
}
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:27,代码来源:SugarViewTest.php
示例3: post_install
function post_install()
{
// Include existing custom entry point registry array
@(include_once 'custom/include/MVC/Controller/entry_point_registry.php');
// Start building custom entry point PHP
$the_string = "<?php\n" . '// created: ' . date('Y-m-d H:i:s') . "\n\n";
// Define new entry point
$entry_point_registry['AsteriskController'] = array('file' => 'custom/modules/Asterisk/include/controller.php', 'auth' => true);
$entry_point_registry['AsteriskCallListener'] = array('file' => 'custom/modules/Asterisk/include/callListener.php', 'auth' => true);
$entry_point_registry['AsteriskCallCreate'] = array('file' => 'custom/modules/Asterisk/include/callCreate.php', 'auth' => true);
// For each custom entry point, add override value
foreach ($entry_point_registry as $key => $value) {
$the_string .= override_value_to_string('entry_point_registry', $key, $value) . "\n";
}
// Write the dir if needed
if (!is_dir('custom/include/MVC/Controller')) {
$result = sugar_mkdir('custom/include/MVC/Controller', NULL, true);
}
// Write the new custom entry point registry file
$result = @sugar_file_put_contents('custom/include/MVC/Controller/entry_point_registry.php', $the_string);
if ($_REQUEST['mode'] == 'Install') {
?>
<br /><br />
<span style="font-size: 2em;"><strong>Please review the documentation! There are several additional steps that must be taken.</strong></span>
<br /><span style="font-size: 1.3em;">The User Guide can be found on the Project website here: <a href="https://github.com/blak3r/yaai/wiki/User-Manual">https://github.com/blak3r/yaai/wiki/User-Manual</a></span>
<?php
}
}
开发者ID:netconstructor,项目名称:yaai,代码行数:29,代码来源:post_install.php
示例4: setUp
public function setUp()
{
$this->authclassname = 'TestAuthClass' . mt_rand();
sugar_mkdir("custom/modules/Users/authentication/{$this->authclassname}/", null, true);
sugar_file_put_contents("custom/modules/Users/authentication/{$this->authclassname}/{$this->authclassname}.php", "<?php\nrequire_once 'modules/Users/authentication/SugarAuthenticate/SugarAuthenticate.php';\nclass {$this->authclassname} extends SugarAuthenticate {\n public \$userAuthenticateClass = '{$this->authclassname}User';\n public \$authenticationDir = '{$this->authclassname}';\n\n public function _construct(){\n\t parent::SugarAuthenticate();\n\t}\n}");
sugar_file_put_contents("custom/modules/Users/authentication/{$this->authclassname}/{$this->authclassname}User.php", "<?php\nrequire_once 'modules/Users/authentication/SugarAuthenticate/SugarAuthenticateUser.php';\nclass {$this->authclassname}User extends SugarAuthenticateUser {\n}");
}
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:7,代码来源:Bug44503Test.php
示例5: create_module_lang_dir
/**
* @return bool
* @param module string
* @desc Creates the module's language directory under the custom directory.
*/
function create_module_lang_dir($module)
{
if (!is_dir("custom/modules/{$module}/language")) {
return sugar_mkdir("custom/modules/{$module}/language", null, true);
}
return true;
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:12,代码来源:Common.php
示例6: setUp
public function setUp()
{
sugar_mkdir('tests/include/utils/ziptest/testarchive', null, true);
sugar_touch('tests/include/utils/ziptest/testarchive/testfile1.txt');
sugar_touch('tests/include/utils/ziptest/testarchive/testfile2.txt');
sugar_touch('tests/include/utils/ziptest/testarchive/testfile3.txt');
sugar_mkdir('tests/include/utils/ziptest/testarchiveoutput', null, true);
}
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:8,代码来源:ZipTest.php
示例7: renameDisabled
public function renameDisabled($files)
{
foreach ($files as $fileFrom => $fileTo) {
sugar_mkdir(dirname($fileTo), null, true);
sugar_rename($fileFrom, $fileTo);
$this->log('Custom view ' . $fileFrom . ' should be disabled (moved to ' . $fileTo . ')');
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:8,代码来源:7_DisableViews.php
示例8: setUp
public function setUp()
{
$this->testdir = sugar_cached("tests/include/utils/ziptest");
sugar_mkdir($this->testdir . '/testarchive', null, true);
sugar_touch($this->testdir . '/testarchive/testfile1.txt');
sugar_touch($this->testdir . '/testarchive/testfile2.txt');
sugar_touch($this->testdir . '/testarchive/testfile3.txt');
sugar_mkdir($this->testdir . '/testarchiveoutput', null, true);
}
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:9,代码来源:ZipTest.php
示例9: mkdir_recursive
function mkdir_recursive($path, $check_is_parent_dir = false)
{
if (sugar_is_dir($path, 'instance')) {
return true;
}
if (sugar_is_file($path, 'instance')) {
if (!empty($GLOBALS['log'])) {
$GLOBALS['log']->fatal("ERROR: mkdir_recursive(): argument {$path} is already a file.");
}
return false;
}
//make variables with file paths
$pathcmp = $path = rtrim(clean_path($path), '/');
$basecmp = $base = rtrim(clean_path(getcwd()), '/');
if (is_windows()) {
//make path variable lower case for comparison in windows
$pathcmp = strtolower($path);
$basecmp = strtolower($base);
}
if ($basecmp == $pathcmp) {
return true;
}
$base .= "/";
if (strncmp($pathcmp, $basecmp, strlen($basecmp)) == 0) {
/* strip current path prefix */
$path = substr($path, strlen($base));
}
$thePath = '';
$dirStructure = explode("/", $path);
if ($dirStructure[0] == '') {
// absolute path
$base = '/';
array_shift($dirStructure);
}
if (is_windows()) {
if (strlen($dirStructure[0]) == 2 && $dirStructure[0][1] == ':') {
/* C: prefix */
$base = array_shift($dirStructure) . "\\";
} elseif ($dirStructure[0][0] . $dirStructure[0][1] == "\\\\") {
/* UNC absolute path */
$base = array_shift($dirStructure) . "\\" . array_shift($dirStructure) . "\\";
// we won't try to mkdir UNC share name
}
}
foreach ($dirStructure as $dirPath) {
$thePath .= $dirPath . "/";
$mkPath = $base . $thePath;
if (!is_dir($mkPath)) {
if (!sugar_mkdir($mkPath)) {
return false;
}
}
}
return true;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:55,代码来源:dir_inc.php
示例10: testDisplayWithClassicCustomView
public function testDisplayWithClassicCustomView()
{
$view = $this->getMock('ViewClassic', array('includeClassicFile'));
$view->module = 'testmodule' . mt_rand();
$view->action = 'testaction' . mt_rand();
sugar_mkdir("custom/modules/{$view->module}", null, true);
sugar_touch("custom/modules/{$view->module}/{$view->action}.php");
$return = $view->display();
rmdir_recursive("custom/modules/{$view->module}");
$this->assertTrue($return);
}
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:11,代码来源:ViewClassicTest.php
示例11: setUp
public function setUp()
{
if (!is_dir(dirname(Bug44896PackageManger::$location))) {
sugar_mkdir(dirname(Bug44896PackageManger::$location));
}
if (!is_dir(Bug44896PackageManger::$location)) {
sugar_mkdir(Bug44896PackageManger::$location);
}
$manage = new Bug44896PackageManger();
$manage->createTempModule();
}
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:11,代码来源:Bug44896Test.php
示例12: setUp
public function setUp()
{
if (!class_exists('ZipArchive')) {
$this->markTestSkipped('ZipArchive class not loaded');
}
$this->testdir = sugar_cached("tests/include/utils/ziptest");
sugar_mkdir($this->testdir . '/testarchive', null, true);
sugar_touch($this->testdir . '/testarchive/testfile1.txt');
sugar_touch($this->testdir . '/testarchive/testfile2.txt');
sugar_touch($this->testdir . '/testarchive/testfile3.txt');
sugar_mkdir($this->testdir . '/testarchiveoutput', null, true);
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:12,代码来源:ZipTest.php
示例13: run
public function run()
{
if (version_compare($this->from_version, 7, '<')) {
$path = 'custom/Extension/application/Ext/Include/';
sugar_mkdir($path . 'Disabled/', null, true);
foreach ($this->modules as $module) {
$file = $module . '.php';
if (file_exists($path . $file)) {
sugar_rename($path . $file, $path . "Disabled/" . $file);
$this->log("Unsupported module {$module} disabled");
}
}
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:8_RemoveModules.php
示例14: setUp
public function setUp()
{
$GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
$GLOBALS['app_list_strings'] = return_app_list_strings_language($GLOBALS['current_language']);
$GLOBALS['app_strings'] = return_application_language($GLOBALS['current_language']);
// Create a Custom editviewdefs.php
sugar_mkdir("custom/modules/Leads/metadata/", null, true);
if (is_dir("cache/modules/Leads")) {
rmdir_recursive("cache/modules/Leads");
}
if (file_exists("custom/modules/Leads/metadata/editviewdefs.php")) {
unlink("custom/modules/Leads/metadata/editviewdefs.php");
}
// Create a very simple custom EditView Layout
if ($fh = @fopen("custom/modules/Leads/metadata/editviewdefs.php", 'w+')) {
$string = <<<EOQ
<?php
\$viewdefs['Leads']['EditView'] = array('templateMeta' => array (
'form' => array('buttons' => array ('SAVE', 'CANCEL'),
'hidden' => array ('<a>HiddenPlaceHolder</a>',
),
),
'maxColumns' => '2',
'useTabs' => true,
'widths' => array( array ('label' => '10', 'field' => '30'),
array ('label' => '10', 'field' => '30'),
),
'javascript' => array( array ('file' => 'custom/modules/Leads/javascript/LeadJS1.js'),
array ('file' => 'custom/modules/Leads/javascript/LeadJS2.js'),
),
),
'panels' => array ('default' => array (0 => array (0 => array ('name' => 'first_name',
),
1 => array ('name' => 'last_name',
),
),
1 => array (0 => array ('name' => 'unknown_field',
'customCode' => '<a href="#">Unknown Field Link</a>',
),
),
),
),
);
?>
EOQ;
fputs($fh, $string);
fclose($fh);
}
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:49,代码来源:Bug44831Test.php
示例15: testGetMetaDataFile
public function testGetMetaDataFile()
{
$this->_view->module = 'Contacts';
$this->_view->type = 'list';
$metaDataFile = $this->_view->getMetaDataFile();
$this->assertEquals('modules/Contacts/metadata/listviewdefs.php', $metaDataFile, 'Did not load the correct metadata file');
//test custom file
sugar_mkdir('custom/modules/Contacts/metadata/', null, true);
$customFile = 'custom/modules/Contacts/metadata/listviewdefs.php';
if (!file_exists($customFile)) {
sugar_file_put_contents($customFile, array());
$customMetaDataFile = $this->_view->getMetaDataFile();
$this->assertEquals($customFile, $customMetaDataFile, 'Did not load the correct custom metadata file');
unlink($customFile);
}
}
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:16,代码来源:SugarViewTest.php
示例16: setUpBeforeClass
public static function setUpBeforeClass()
{
if (!file_exists(self::$directory)) {
sugar_mkdir(self::$directory, 0777, true);
}
if (file_exists(self::$customConfigFile)) {
rename(self::$customConfigFile, self::$customConfigFile . ".bak");
}
if (file_exists(self::$customDefaultConfigFile)) {
rename(self::$customDefaultConfigFile, self::$customDefaultConfigFile . ".bak");
}
file_put_contents(self::$customConfigFile, "<?php\n\t\t\t\$buttonConfigs = array('default' => array('buttonConfig' =>'testcase',\n\t\t\t\t\t\t\t\t\t'buttonConfig2' => 'cut,copy,paste,pastetext,pasteword,selectall,separator,search,replace,separator,bullist,numlist,separator,outdent,\n\t \t\t\t\t\tindent,separator,ltr,rtl,separator,undo,redo,separator, link,unlink,anchor,image,separator,sub,sup,separator,charmap,\n\t \t\t\t\t\tvisualaid', \n\t \t\t\t'buttonConfig3' => 'tablecontrols,separator,advhr,hr,removeformat,separator,insertdate,inserttime,separator,preview'),\n\t\t\t\t\t\t\t\t\t'badkey1' => 'bad data1');\n\t\t\t?>");
file_put_contents(self::$customDefaultConfigFile, "<?php\n\t\t\t\$defaultConfig = array('extended_valid_elements' => 'upload[testlength|ratio|initialtest|mintestsize|threads|maxchunksize|maxchunkcount],download[testlength|initialtest|mintestsize|threads|maximagesize]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'badkey2' => 'bad data2');\n\t\t\t?>");
$tinySugar = new SugarTinyMCE();
self::$MCE = $tinySugar->getInstance();
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:16,代码来源:SugarTinyMCETest.php
示例17: create_module_lang_dir
/**
* @return bool
* @param module string
* @desc Creates the module's language directory under the custom directory.
*/
function create_module_lang_dir($module)
{
$continue = true;
if (!is_dir('custom/modules')) {
$continue = sugar_mkdir('custom/modules');
}
if ($continue) {
if (!is_dir("custom/modules/{$module}")) {
$continue = sugar_mkdir("custom/modules/{$module}");
}
}
if ($continue) {
if (!is_dir("custom/modules/{$module}/language")) {
$continue = sugar_mkdir("custom/modules/{$module}/language");
}
}
return $continue;
}
开发者ID:klr2003,项目名称:sourceread,代码行数:23,代码来源:Common.php
示例18: setUp
public function setUp()
{
//back up users popup if it exists
if (is_file($this->customFilePath)) {
include $this->customFilePath;
$this->originalPopupMeta = $popupMeta;
$this->newPopupMeta = $popupMeta;
} else {
//lets create the directory if it does not exist
if (!is_dir($this->customFileDir)) {
sugar_mkdir($this->customFileDir);
}
}
//define and add the new elements
$this->newPopupMeta['addToReserve'] = array('whereStatement', 'templateMeta');
$this->newPopupMeta['whereStatement'] = 'select money from yourWallet where deposit = "myPocket"';
$this->newPopupMeta['templateMeta'] = array('one', 'two');
$this->newPopupMeta['disappear'] = 'this element was not defined and should be processed';
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:19,代码来源:Bug50308Test.php
示例19: setup
/**
* DetailView constructor
* This is the DetailView constructor responsible for processing the new
* Meta-Data framework
*
* @param $module String value of module this detail view is for
* @param $focus An empty sugarbean object of module
* @param $id The record id to retrieve and populate data for
* @param $metadataFile String value of file location to use in overriding default metadata file
* @param tpl String value of file location to use in overriding default Smarty template
*/
function setup($module, $focus, $metadataFile = null, $tpl = 'include/DetailView/DetailView.tpl')
{
global $sugar_config;
$this->th = new TemplateHandler();
$this->th->ss = $this->ss;
//Check if inline editing is enabled for detail view.
if ($sugar_config['enable_line_editing_detail']) {
$this->ss->assign('inline_edit', true);
}
$this->focus = $focus;
$this->tpl = $tpl;
$this->module = $module;
$this->metadataFile = $metadataFile;
if (isset($GLOBALS['sugar_config']['disable_vcr'])) {
$this->showVCRControl = !$GLOBALS['sugar_config']['disable_vcr'];
}
if (!empty($this->metadataFile) && file_exists($this->metadataFile)) {
require $this->metadataFile;
} else {
//If file doesn't exist we create a best guess
if (!file_exists("modules/{$this->module}/metadata/detailviewdefs.php") && file_exists("modules/{$this->module}/DetailView.html")) {
global $dictionary;
$htmlFile = "modules/" . $this->module . "/DetailView.html";
$parser = new DetailViewMetaParser();
if (!file_exists('modules/' . $this->module . '/metadata')) {
sugar_mkdir('modules/' . $this->module . '/metadata');
}
$fp = sugar_fopen('modules/' . $this->module . '/metadata/detailviewdefs.php', 'w');
fwrite($fp, $parser->parse($htmlFile, $dictionary[$focus->object_name]['fields'], $this->module));
fclose($fp);
}
//Flag an error... we couldn't create the best guess meta-data file
if (!file_exists("modules/{$this->module}/metadata/detailviewdefs.php")) {
global $app_strings;
$error = str_replace("[file]", "modules/{$this->module}/metadata/detailviewdefs.php", $app_strings['ERR_CANNOT_CREATE_METADATA_FILE']);
$GLOBALS['log']->fatal($error);
echo $error;
die;
}
require "modules/{$this->module}/metadata/detailviewdefs.php";
}
$this->defs = $viewdefs[$this->module][$this->view];
}
开发者ID:pikkoui,项目名称:suitecrm,代码行数:54,代码来源:DetailView2.php
示例20: post_install
function post_install()
{
// Include existing custom entry point registry array
@(include_once 'custom/include/MVC/Controller/entry_point_registry.php');
// Start building custom entry point PHP
$the_string = "<?php\n" . '// created: ' . date('Y-m-d H:i:s') . "\n\n";
// Define new entry point
$entry_point_registry['AsteriskController'] = array('file' => 'custom/modules/Asterisk/include/controller.php', 'auth' => true);
$entry_point_registry['AsteriskCallListener'] = array('file' => 'custom/modules/Asterisk/include/callListener.php', 'auth' => true);
$entry_point_registry['AsteriskCallCreate'] = array('file' => 'custom/modules/Asterisk/include/callCreate.php', 'auth' => true);
// For each custom entry point, add override value
foreach ($entry_point_registry as $key => $value) {
$the_string .= override_value_to_string('entry_point_registry', $key, $value) . "\n";
}
// Write the dir if needed
if (!is_dir('custom/include/MVC/Controller')) {
$result = sugar_mkdir('custom/include/MVC/Controller', NULL, true);
}
// Write the new custom entry point registry file
$result = @sugar_file_put_contents('custom/include/MVC/Controller/entry_point_registry.php', $the_string);
if ($_REQUEST['mode'] == 'Install') {
?>
<br /><br />
<span style="font-size: 1.6em;"><strong>Please review the documentation! There are several additional steps that must be taken.</strong></span>
<br /><span style="font-size: 1.3em;">The User Guide can be found on the Project website here: <a href="https://github.com/blak3r/yaai/wiki/User-Manual">https://github.com/blak3r/yaai/wiki/User-Manual</a>. Please note the fairly comprehensive troubleshooting section at the end of the manual.</span>
<br>
<BR>
<span style="font-size: 1.6em;"><strong>Donate to YAAI</strong></span>
<br /><span style="font-size:1.3em;">Please consider making a donation to the project. Your contribution allows me to spend more time improving/supporting.
We're also in great need of some help from developers. Please see: <a href="https://github.com/blak3r/yaai/wiki/Project-TODO-List">https://github.com/blak3r/yaai/wiki/Project-TODO-List</a> for ways you can help.</span>
<P>
<BR/>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="FA36DGSYQ3NE6">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</P>
<?php
}
}
开发者ID:randomf,项目名称:yaai,代码行数:43,代码来源:post_install.php
注:本文中的sugar_mkdir函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论