本文整理汇总了PHP中osC_DirectoryListing类的典型用法代码示例。如果您正苦于以下问题:PHP osC_DirectoryListing类的具体用法?PHP osC_DirectoryListing怎么用?PHP osC_DirectoryListing使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了osC_DirectoryListing类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getAccesses
function getAccesses()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
$osC_DirectoryListing->setIncludeDirectories(false);
$access_modules_array = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
if (!class_exists('osC_Access_' . ucfirst($module))) {
$osC_Language->loadIniFile('modules/access/' . $file['name']);
include $osC_DirectoryListing->getDirectory() . '/' . $file['name'];
}
$module = 'osC_Access_' . ucfirst($module);
$module = new $module();
$title = osC_Access::getGroupTitle($module->getGroup());
$access_modules_array[$title][] = array('id' => $module->getModule(), 'text' => $module->getTitle(), 'leaf' => true);
}
ksort($access_modules_array);
$access_options = array();
$count = 1;
foreach ($access_modules_array as $group => $modules) {
$access_option['id'] = $count;
$access_option['text'] = $group;
$mod_arrs = array();
foreach ($modules as $module) {
$mod_arrs[] = $module;
}
$access_option['children'] = $mod_arrs;
$access_options[] = $access_option;
$count++;
}
echo $toC_Json->encode($access_options);
}
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:33,代码来源:administrators.php
示例2: listGeoipModules
function listGeoipModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/geoip');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include 'includes/modules/geoip/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists('osC_GeoIP_' . $class)) {
$osC_Language->loadIniFile('modules/geoip/' . $class . '.php');
$module = 'osC_GeoIP_' . $class;
$module = new $module();
$action = array();
if ($module->isInstalled()) {
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $class, 'title' => $module->getTitle(), 'description' => $module->getDescription(), 'author' => $module->getAuthorName(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:26,代码来源:modules_geoip.php
示例3: listCache
function listCache()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing(DIR_FS_WORK);
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('cache');
$response = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$last_modified = filemtime(DIR_FS_WORK . '/' . $file['name']);
if (strpos($file['name'], '-') !== false) {
$code = substr($file['name'], 0, strpos($file['name'], '-'));
} else {
$code = substr($file['name'], 0, strpos($file['name'], '.'));
}
if (isset($cached_files[$code])) {
$cached_files[$code]['total']++;
if ($last_modified > $cached_files[$code]['last_modified']) {
$cached_files[$code]['last_modified'] = $last_modified;
}
} else {
$cached_files[$code] = array('total' => 1, 'last_modified' => $last_modified);
}
$response[] = array('code' => $code, 'total' => $cached_files[$code]['total'], 'last_modified' => osC_DateTime::getShort(osC_DateTime::fromUnixTimestamp($cached_files[$code]['last_modified']), true));
}
$response = array(EXT_JSON_READER_ROOT => $response);
echo $toC_Json->encode($response);
}
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:27,代码来源:cache.php
示例4: listTemplates
function listTemplates()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('../templates');
$osC_DirectoryListing->setIncludeDirectories(true);
$osC_DirectoryListing->setIncludeFiles(false);
$osC_DirectoryListing->setExcludeEntries('system');
$files = $osC_DirectoryListing->getFiles(true);
foreach ($files as $file) {
include '../templates/' . $file['name'] . '/template.php';
$code = $file['name'];
$class = 'osC_Template_' . $code;
if (class_exists($class)) {
$module = new $class();
$module_title = $module->getTitle();
$action = array();
if ($module->isInstalled()) {
if ($module->getCode() == DEFAULT_TEMPLATE) {
$module_title .= ' (' . $osC_Language->get('default_entry') . ')';
$action[] = array('class' => 'icon-default-record', 'qtip' => $osC_Language->get('field_set_as_default'));
} else {
$action[] = array('class' => 'icon-default-gray-record', 'qtip' => $osC_Language->get('field_set_as_default'));
}
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-empty-record', 'qtip' => $osC_Language->get('field_set_as_default'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $module->getCode(), 'title' => $module_title, 'author' => $module->getAuthorName(), 'url' => $module->getAuthorAddress(), 'action' => $action);
}
}
$response = array(EXT_JSON_READER_ROOT => $modules);
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:34,代码来源:templates.php
示例5: getGadgets
function getGadgets()
{
global $toC_Json, $osC_Language;
$record = array();
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/gadgets');
if ($osC_DirectoryListing->getSize()) {
foreach ($osC_DirectoryListing->getFiles() as $file) {
$gadget = substr($file['name'], 0, strrpos($file['name'], '.'));
$class_path = 'includes/modules/gadgets/' . $gadget . '.php';
if (!empty($gadget) && file_exists($class_path)) {
include $class_path;
$osC_Language->loadIniFile('modules/gadgets/' . $gadget . '.php');
if (class_exists('toC_Gadget_' . $gadget)) {
$module_class = 'toC_Gadget_' . $gadget;
$module = new $module_class();
$records[] = array('code' => $module->getCode(), 'type' => $module->getType(), 'icon' => $module->getIcon(), 'title' => $module->getTitle(), 'file' => $module->getFile(), 'description' => $module->getDescription());
}
}
}
$response = array('success' => true, 'records' => $records);
} else {
$response = array('success' => false);
}
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:25,代码来源:desktop_settings.php
示例6: listServices
function listServices()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/services');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$installed = explode(';', MODULE_SERVICES_INSTALLED);
$modules = array();
foreach ($files as $file) {
include 'includes/modules/services/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
$module = 'osC_Services_' . $class . '_Admin';
$module = new $module();
$action = array();
if (in_array($class, $installed) && !osc_empty($module->keys())) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
}
if (!in_array($class, $installed)) {
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
} else {
if ($module->uninstallable == false) {
$action[] = array('class' => 'icon-uninstall-gray-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
}
}
$modules[] = array('code' => $class, 'title' => $module->title, 'action' => $action);
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:33,代码来源:services.php
示例7: listTemplatesModules
function listTemplatesModules()
{
global $toC_Json, $osC_Language;
$osC_Language->load('modules-' . $_REQUEST['set']);
$osC_DirectoryListing = new osC_DirectoryListing('../includes/modules/' . $_REQUEST['set']);
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include '../includes/modules/' . $_REQUEST['set'] . '/' . $file['name'];
$code = substr($file['name'], 0, strrpos($file['name'], '.'));
$class = 'osC_' . ucfirst($_REQUEST['set']) . '_' . $code;
if (class_exists($class)) {
if (call_user_func(array($class, 'isInstalled'), $code, $_GET['set']) === false) {
$osC_Language->injectDefinitions('modules/' . $_GET['set'] . '/' . $code . '.xml');
}
$module = new $class();
$action = array();
if ($module->isInstalled() && $module->isActive()) {
if ($module->hasKeys()) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
}
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $code, 'title' => $module->getTitle(), 'author' => $module->getAuthorName(), 'url' => $module->getAuthorAddress(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:35,代码来源:templates_modules.php
示例8: listDirectory
function listDirectory()
{
global $osC_Language, $toC_Json, $osC_MessageStack;
$directory = OSC_ADMIN_FILE_MANAGER_ROOT_PATH;
if (isset($_REQUEST['directory']) && !empty($_REQUEST['directory'])) {
$directory .= '/' . urldecode($_REQUEST['directory']);
} elseif (isset($_REQUEST['goto']) && !empty($_REQUEST['goto'])) {
$directory .= '/' . urldecode($_REQUEST['goto']);
}
$osC_DirectoryListing = new osC_DirectoryListing($directory);
$osC_DirectoryListing->setStats(true);
$records = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$file_owner = function_exists('posix_getpwuid') ? posix_getpwuid($file['user_id']) : '-?-';
$group_owner = function_exists('posix_getgrgid') ? posix_getgrgid($file['group_id']) : '-?-';
if ($file['is_directory'] === true) {
$entry_icon = osc_icon('folder_red.png');
$action = array(array('class' => 'icon-empty-record', 'qtip' => ''), array('class' => 'icon-empty-record', 'qtip' => ''), array('class' => 'icon-delete-record', 'qtip' => $osC_Language->get('icon_trash')));
} else {
$entry_icon = osc_icon('file.png');
$action = array(array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit')), array('class' => 'icon-download-record', 'qtip' => $osC_Language->get('icon_download')), array('class' => 'icon-delete-record', 'qtip' => $osC_Language->get('icon_trash')));
}
$records[] = array('icon' => $entry_icon, 'file_name' => $file['name'], 'is_directory' => $file['is_directory'], 'size' => number_format($file['size']), 'permission' => osc_get_file_permissions($file['permissions']), 'file_owner' => $file_owner, 'group_owner' => $group_owner, 'writeable' => osc_icon(is_writable($osC_DirectoryListing->getDirectory() . '/' . $file['name']) ? 'checkbox_ticked.gif' : 'checkbox_crossed.gif'), 'last_modified_date' => osC_DateTime::getShort(osC_DateTime::fromUnixTimestamp($file['last_modified']), true), 'action' => $action);
}
$response = array(EXT_JSON_READER_ROOT => $records);
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:27,代码来源:file_manager.php
示例9: listShippingModules
function listShippingModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/shipping');
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
$modules = array();
foreach ($files as $file) {
include 'includes/modules/shipping/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists('osC_Shipping_' . $class)) {
$osC_Language->injectDefinitions('modules/shipping/' . $class . '.xml');
$module = 'osC_Shipping_' . $class;
$module = new $module();
$action = array();
if ($module->isInstalled()) {
$action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-uninstall-record', 'qtip' => $osC_Language->get('icon_uninstall'));
} else {
$action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
$action[] = array('class' => 'icon-install-record', 'qtip' => $osC_Language->get('icon_install'));
}
$modules[] = array('code' => $module->getCode(), 'title' => $module->getTitle(), 'sort_order' => $module->getSortOrder(), 'action' => $action);
}
}
$response[EXT_JSON_READER_ROOT] = $modules;
echo $toC_Json->encode($response);
}
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:28,代码来源:modules_shipping.php
示例10: _getSocialBookmarks
function _getSocialBookmarks()
{
$osC_DirectoryListing = new osC_DirectoryListing(TOC_SOCIAL_BOOKMARKS_MODULES);
$social_bookmarks = array();
foreach ($osC_DirectoryListing->getFiles() as $social_bookmark) {
$social_bookmark_class = substr($social_bookmark['name'], 0, strrpos($social_bookmark['name'], '.'));
if (!class_exists($social_bookmark_class)) {
include TOC_SOCIAL_BOOKMARKS_MODULES . '/' . $social_bookmark_class . '.php';
}
$social_bookmarks[] = new $social_bookmark_class();
}
return $social_bookmarks;
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:13,代码来源:product_social_bookmarks.php
示例11: getOriginalLogo
function getOriginalLogo()
{
$osC_DirectoryListing = new osC_DirectoryListing('../' . DIR_WS_IMAGES);
$osC_DirectoryListing->setIncludeDirectories(false);
$files = $osC_DirectoryListing->getFiles();
foreach ($files as $file) {
$filename = explode(".", $file['name']);
if ($filename[0] == 'logo_originals') {
return '../' . DIR_WS_IMAGES . 'logo_originals.' . $filename[1];
}
}
return false;
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:13,代码来源:logo_upload.php
示例12: listBackup
function listBackup()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing(DIR_FS_BACKUP);
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setExcludeEntries('.htaccess');
$response = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$response[] = array('file' => $file['name'], 'date' => osC_DateTime::getDate(osC_DateTime::fromUnixTimestamp(filemtime(DIR_FS_BACKUP . $file['name'])), true), 'size' => number_format(filesize(DIR_FS_BACKUP . $file['name'])));
}
$response = array(EXT_JSON_READER_ROOT => $response);
echo $toC_Json->encode($response);
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:13,代码来源:backup.php
示例13: osC_LanguageInstall
function osC_LanguageInstall()
{
$osC_DirectoryListing = new osC_DirectoryListing('../includes/languages');
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('xml');
foreach ($osC_DirectoryListing->getFiles() as $file) {
$osC_XML = new osC_XML(file_get_contents('../includes/languages/' . $file['name']));
$lang = $osC_XML->toArray();
$this->_languages[$lang['language']['data']['code']] = array('name' => $lang['language']['data']['title'], 'code' => $lang['language']['data']['code'], 'charset' => $lang['language']['data']['character_set']);
}
unset($lang);
$language = isset($_GET['language']) && !empty($_GET['language']) ? $_GET['language'] : '';
$this->set($language);
$this->loadIniFile();
$this->loadIniFile(basename($_SERVER['SCRIPT_FILENAME']));
}
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:16,代码来源:language.php
示例14: getModules
function getModules()
{
global $toC_Json, $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/newsletters');
$osC_DirectoryListing->setIncludeDirectories(false);
$records = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$module = substr($file['name'], 0, strrpos($file['name'], '.'));
$osC_Language->loadIniFile('modules/newsletters/' . $file['name']);
include 'includes/modules/newsletters/' . $file['name'];
$newsletter_module_class = 'osC_Newsletter_' . $module;
$osC_NewsletterModule = new $newsletter_module_class();
$records[] = array('id' => $module, 'text' => $osC_NewsletterModule->getTitle());
}
$response = array(EXT_JSON_READER_ROOT => $records);
echo $toC_Json->encode($response);
}
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:17,代码来源:newsletters.php
示例15: listImages
function listImages()
{
global $toC_Json;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/image');
$osC_DirectoryListing->setIncludeDirectories(false);
$osC_DirectoryListing->setCheckExtension('php');
$record = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
$class = 'osC_Image_Admin_' . substr($file['name'], 0, strrpos($file['name'], '.'));
if (class_exists($class)) {
$module = new $class();
$record[] = array('module' => $module->getTitle(), 'run' => substr($file['name'], 0, strrpos($file['name'], '.')));
}
}
$response = array(EXT_JSON_READER_ROOT => $record);
echo $toC_Json->encode($response);
}
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:17,代码来源:images.php
示例16: getGadgets
function getGadgets()
{
global $osC_Language;
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/gadgets');
$osC_DirectoryListing->setIncludeDirectories(false);
$gadgets = array();
foreach ($osC_DirectoryListing->getFiles() as $file) {
require_once 'includes/modules/gadgets/' . $file['name'];
$class = substr($file['name'], 0, strrpos($file['name'], '.'));
$osC_Language->loadIniFile('modules/gadgets/' . $file['name']);
if (class_exists('toC_Gadget_' . $class)) {
$module_class = 'toC_Gadget_' . $class;
$module = new $module_class();
$gadgets[] = array('code' => $module->getCode(), 'title' => $module->getTitle());
}
}
return $gadgets;
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:18,代码来源:gadget.php
示例17: getUserLevels
/**
* Return the Administration Tool Application modules the administrator has access to
*
* @param int $id The ID of the administrator
* @access public
* @return array
*/
public static function getUserLevels($id)
{
global $osC_Database;
$modules = array();
$Qaccess = $osC_Database->query('select module from :table_administrators_access where administrators_id = :administrators_id');
$Qaccess->bindTable(':table_administrators_access', TABLE_ADMINISTRATORS_ACCESS);
$Qaccess->bindInt(':administrators_id', $id);
$Qaccess->execute();
while ($Qaccess->next()) {
$modules[] = $Qaccess->value('module');
}
if (in_array('*', $modules)) {
$modules = array();
$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/access');
$osC_DirectoryListing->setIncludeDirectories(false);
foreach ($osC_DirectoryListing->getFiles() as $file) {
$modules[] = substr($file['name'], 0, strrpos($file['name'], '.'));
}
}
return $modules;
}
开发者ID:Jon86,项目名称:oscommerce,代码行数:28,代码来源:access.php
示例18: getLocalImages
public static function getLocalImages()
{
$osC_DirectoryListing = new osC_DirectoryListing('../images/products/_upload', true);
$osC_DirectoryListing->setCheckExtension('gif');
$osC_DirectoryListing->setCheckExtension('jpg');
$osC_DirectoryListing->setCheckExtension('png');
$osC_DirectoryListing->setIncludeDirectories(false);
$result = array('entries' => array());
foreach ($osC_DirectoryListing->getFiles() as $file) {
$result['entries'][] = $file['name'];
}
$result['rpcStatus'] = RPC_STATUS_SUCCESS;
echo json_encode($result);
}
开发者ID:digitaldevelopers,项目名称:oscommerce,代码行数:14,代码来源:rpc.php
示例19: _createIndexSitemap
function _createIndexSitemap()
{
global $osC_Language;
$handle = fopen($this->_save_path . 'sitemapsIndex.xml', 'w');
$xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
$xml .= '<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
fwrite($handle, $xml);
$directory_listing = new osC_DirectoryListing($this->_save_path);
$directory_listing->setIncludeDirectories(false);
$directory_listing->setIncludeFiles(true);
$directory_listing->setCheckExtension('xml');
$xmls = $directory_listing->getFiles();
if (!empty($xmls)) {
foreach ($xmls as $xml) {
if ($xml['name'] !== $this->_file_name . 'Index.xml' && preg_match('/^sitemaps[A-Za-z_]+\\.xml$/', $xml['name'])) {
$content = "\t" . '<sitemap>' . "\n";
$content .= "\t\t" . '<loc>' . $this->_base_url . basename($xml['name']) . '</loc>' . "\n";
$content .= "\t\t" . '<lastmod>' . date("Y-m-d", filemtime($this->_save_path . basename($xml['name']))) . '</lastmod>' . "\n";
$content .= "\t" . '</sitemap>' . "\n";
fwrite($handle, $content);
}
}
}
fwrite($handle, '</sitemapindex>');
fclose($handle);
$osC_Language->set($this->_original_language_code);
return true;
}
开发者ID:ellipsonic,项目名称:tomato_app,代码行数:28,代码来源:google_sitemap.php
示例20: deleteAccount
function deleteAccount($account)
{
global $osC_Database;
$error = false;
$osC_Database->startTransaction();
$messages_path = DIR_FS_CACHE_ADMIN . 'emails/' . md5($account['accounts_id'] . $account['accounts_email']) . '/messages';
if (file_exists($messages_path)) {
$directory = new osC_DirectoryListing($messages_path);
foreach ($directory->getFiles() as $file) {
@unlink($messages_path . '/' . $file['name']);
}
rmdir($messages_path);
}
$attachments_path = DIR_FS_CACHE_ADMIN . 'emails/' . md5($account['accounts_id'] . $account['accounts_email']) . '/attachments';
if (file_exists($attachments_path)) {
$directory = new osC_DirectoryListing($attachments_path);
foreach ($directory->getFiles() as $file) {
@unlink($attachments_path . '/' . $file['name']);
}
rmdir($attachments_path);
}
$account_path = DIR_FS_CACHE_ADMIN . 'emails/' . md5($account['accounts_id'] . $account['accounts_email']);
if (file_exists($account_path)) {
rmdir($account_path);
}
$Qmessages = $osC_Database->query('delete from :table_email_messages where accounts_id = :accounts_id');
$Qmessages->bindTable(':table_email_messages', TABLE_EMAIL_MESSAGES);
$Qmessages->bindInt(':accounts_id', $account['accounts_id']);
$Qmessages->setLogging($_SESSION['module'], $account['accounts_id']);
$Qmessages->execute();
if ($osC_Database->isError()) {
$error = true;
}
if ($error == false) {
$Qfolders = $osC_Database->query('delete from :table_email_folders where accounts_id = :accounts_id');
$Qfolders->bindTable(':table_email_folders', TABLE_EMAIL_FOLDERS);
$Qfolders->bindInt(':accounts_id', $account['accounts_id']);
$Qfolders->setLogging($_SESSION['module'], $account['accounts_id']);
$Qfolders->execute();
if ($osC_Database->isError()) {
$error = true;
}
}
if ($error == false) {
$Qaccount = $osC_Database->query('delete from :table_email_accounts where accounts_id = :accounts_id');
$Qaccount->bindTable(':table_email_accounts', TABLE_EMAIL_ACCOUNTS);
$Qaccount->bindInt(':accounts_id', $account['accounts_id']);
$Qaccount->setLogging($_SESSION['module'], $account['accounts_id']);
$Qaccount->execute();
if ($osC_Database->isError()) {
$error = true;
}
}
if ($error === false) {
$osC_Database->commitTransaction();
return true;
}
$osC_Database->rollbackTransaction();
return false;
}
开发者ID:Doluci,项目名称:tomatocart,代码行数:60,代码来源:email_accounts.php
注:本文中的osC_DirectoryListing类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论