本文整理汇总了PHP中gcms::install方法的典型用法代码示例。如果您正苦于以下问题:PHP gcms::install方法的具体用法?PHP gcms::install怎么用?PHP gcms::install使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcms
的用法示例。
在下文中一共展示了gcms::install方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
// widgets/marquee/admin_install.php
if (MAIN_INIT == 'installing') {
// install sql
gcms::install(ROOT_PATH . 'widgets/marquee/sql.php');
// บันทึกภาษา
gcms::saveLanguage();
$content[] = '<li class=valid>Add <strong>Language</strong> complete.</li>';
}
示例2: array
<?php
// modules/edocument/admin_install.php
if (MAIN_INIT == 'installing') {
if ($ftp->mkdir(DATA_PATH . 'edocument/', 0755)) {
$content[] = '<li class=valid>โฟลเดอร์ <strong>' . DATA_FOLDER . 'edocument/</strong> สามารถใช้งานได้</li>';
} else {
$content[] = '<li class=invalid>โฟลเดอร์ <strong>' . DATA_FOLDER . 'edocument/</strong> <em>ไม่สามารถเขียนหรือสร้างได้</em> กรุณาสร้างโฟลเดอร์นี้และปรับ chmod ให้เป็น 755 ด้วยตัวเอง</li>';
}
// install module
gcms::installModule('edocument', 'edocument', 'E-Document');
$content[] = '<li class=valid>ติดตั้งโมดูล <strong>E-Document</strong> เรียบร้อย</li>';
// install sql
gcms::install(ROOT_PATH . 'modules/edocument/sql.php');
// โหลด config ใหม่
$config = array();
if (is_file(CONFIG)) {
include CONFIG;
}
// โหลด config ของโมดูล
include ROOT_PATH . 'modules/edocument/default.config.php';
$config = array_merge($config, $newconfig['edocument']);
// save config
if (gcms::saveconfig(CONFIG, $config)) {
$content[] = '<li class=valid>Add <strong>configs</strong> complete.</li>';
} else {
$content[] = '<li class=invalid>' . sprintf($lng['ERROR_FILE_READ_ONLY'], 'bin/config.php') . '</li>';
}
// add vars
if (sizeof($defines) > 0) {
if ($ftp->fwrite(ROOT_PATH . 'bin/vars.php', 'ab', "\n\t// Module E-Document\n\t" . implode("\n\t", $defines))) {
示例3: sprintf
<?php
// widgets/tags/admin_install.php
if (MAIN_INIT == 'installing') {
// install sql
gcms::install(ROOT_PATH . 'widgets/tags/sql.php');
if (sizeof($defines) > 0) {
// add vars
if ($ftp->fwrite(ROOT_PATH . 'bin/vars.php', 'ab', "\n\t// Widget Tags\n\t" . implode("\n\t", $defines))) {
$content[] = '<li class=valid>Add <strong>vars</strong> complete.</li>';
} else {
$content[] = '<li class=invalid>' . sprintf($lng['ERROR_FILE_READ_ONLY'], 'bin/vars.php') . '</li>';
}
}
// บันทึกภาษา
gcms::saveLanguage();
$content[] = '<li class=valid>Add <strong>Language</strong> complete.</li>';
}
示例4: elseif
<?php
if (INSTALL_INIT == 'upgrade') {
if (version_compare($current_version, '5.0.0') == -1) {
// upgrade to 5.0.0
include ROOT_PATH . 'admin/install/500.php';
} elseif (version_compare($current_version, '5.1.0') == -1) {
// upgrade to 5.1.0
$current_version = '5.1.0';
// install sql 5.1.0
gcms::install(ROOT_PATH . 'admin/install/510.php');
} elseif (version_compare($current_version, '5.2.1') == -1) {
// upgrade to 5.2.1
include ROOT_PATH . 'admin/install/521.php';
} elseif (version_compare($current_version, '6.0.0') == -1) {
// upgrade to 6.0.0
include ROOT_PATH . 'admin/install/600.php';
} elseif (version_compare($current_version, '6.0.1') == -1) {
// upgrade to 6.0.1
include ROOT_PATH . 'admin/install/601.php';
} elseif (version_compare($current_version, '7.1.0') == -1) {
// upgrade to 7.1.0
include ROOT_PATH . 'admin/install/710.php';
} elseif (version_compare($current_version, '8.2.0') == -1) {
// upgrade to 8.2.0
include ROOT_PATH . 'admin/install/820.php';
} elseif (version_compare($current_version, '9.0.0') == -1) {
// upgrade to 9.0.0
include ROOT_PATH . 'admin/install/900.php';
} elseif (version_compare($current_version, '9.3.0') == -1) {
// upgrade to 9.3.0
示例5: array
<?php
// widgets/chat/admin_install.php
if (MAIN_INIT == 'installing') {
// install sql
gcms::install(ROOT_PATH . 'widgets/chat/sql.php');
// โหลด config ใหม่
$config = array();
if (is_file(CONFIG)) {
include CONFIG;
}
// โหลด config ของโมดูล
include ROOT_PATH . 'widgets/chat/default.config.php';
$config = array_merge($config, $newconfig['chat']);
// save config
if (gcms::saveconfig(CONFIG, $config)) {
$content[] = '<li class=valid>Add <strong>configs</strong> complete.</li>';
} else {
$content[] = '<li class=invalid>' . sprintf($lng['ERROR_FILE_READ_ONLY'], 'bin/config.php') . '</li>';
}
// add vars
if (sizeof($defines) > 0) {
if ($ftp->fwrite(ROOT_PATH . 'bin/vars.php', 'ab', "\n\t// Widget Chat Room\n\t" . implode("\n\t", $defines))) {
$content[] = '<li class=valid>Add <strong>vars</strong> complete.</li>';
} else {
$content[] = '<li class=invalid>' . sprintf($lng['ERROR_FILE_READ_ONLY'], 'bin/vars.php') . '</li>';
}
}
// บันทึกภาษา
gcms::saveLanguage();
$content[] = '<li class=valid>Add <strong>Language</strong> complete.</li>';