本文整理汇总了PHP中SpoonFile类 的典型用法代码示例。如果您正苦于以下问题:PHP SpoonFile类的具体用法?PHP SpoonFile怎么用?PHP SpoonFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SpoonFile类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: buildCache
/**
* Build navigation cache file.
*
* @return void
*/
public function buildCache()
{
// init
$navigationTree = '';
// build tree starting with the root
$this->buildNavigation(0, $navigationTree);
// start generating PHP
$value = '<?php' . "\n";
$value .= '/**' . "\n";
$value .= ' *' . "\n";
$value .= ' * This file is generated by the Backend, it contains' . "\n";
$value .= ' * more information about the navigation in the backend. Do NOT edit.' . "\n";
$value .= ' * ' . "\n";
$value .= ' * @author Backend' . "\n";
$value .= ' * @generated ' . date('Y-m-d H:i:s') . "\n";
$value .= ' */' . "\n";
$value .= "\n";
$value .= "\$navigation = array(\n";
// add navigation tree
$value .= $navigationTree;
// close php
$value .= ");\n";
$value .= "\n";
$value .= '?>';
// store
SpoonFile::setContent(BACKEND_CACHE_PATH . '/navigation/navigation.php', $value);
}
开发者ID:netconstructor, 项目名称:forkcms, 代码行数:32, 代码来源:navigation.php
示例2: loadConfig
/**
* Load the config file for the requested module.
* In the config file we have to find disabled actions, the constructor will read the folder
* and set possible actions. Other configurations will also be stored in it.
*/
public function loadConfig()
{
// check if module path is not yet defined
if (!defined('BACKEND_MODULE_PATH')) {
// build path for core
if ($this->getModule() == 'core') {
define('BACKEND_MODULE_PATH', BACKEND_PATH . '/' . $this->getModule());
} else {
define('BACKEND_MODULE_PATH', BACKEND_MODULES_PATH . '/' . $this->getModule());
}
}
// check if the config is present? If it isn't present there is a huge problem, so we will stop our code by throwing an error
if (!SpoonFile::exists(BACKEND_MODULE_PATH . '/config.php')) {
throw new BackendException('The configfile for the module (' . $this->getModule() . ') can\'t be found.');
}
// build config-object-name
$configClassName = 'Backend' . SpoonFilter::toCamelCase($this->getModule() . '_config');
// require the config file, we validated before for existence.
require_once BACKEND_MODULE_PATH . '/config.php';
// validate if class exists (aka has correct name)
if (!class_exists($configClassName)) {
throw new BackendException('The config file is present, but the classname should be: ' . $configClassName . '.');
}
// create config-object, the constructor will do some magic
$this->config = new $configClassName($this->getModule());
}
开发者ID:nickmancol, 项目名称:forkcms-rhcloud, 代码行数:31, 代码来源:ajax_action.php
示例3: getWarnings
/**
* Get warnings for active modules
*
* @return array
*/
public static function getWarnings()
{
// init vars
$warnings = array();
$activeModules = BackendModel::getModules(true);
// add warnings
$warnings = array_merge($warnings, BackendModel::checkSettings());
// loop active modules
foreach ($activeModules as $module) {
// model class
$class = 'Backend' . SpoonFilter::toCamelCase($module) . 'Model';
// model file exists
if (SpoonFile::exists(BACKEND_MODULES_PATH . '/' . $module . '/engine/model.php')) {
// require class
require_once BACKEND_MODULES_PATH . '/' . $module . '/engine/model.php';
}
// method exists
if (is_callable(array($class, 'checkSettings'))) {
// add possible warnings
$warnings = array_merge($warnings, call_user_func(array($class, 'checkSettings')));
}
}
// return
return (array) $warnings;
}
开发者ID:netconstructor, 项目名称:forkcms, 代码行数:30, 代码来源:model.php
示例4: loadData
/**
* Load the data.
* This will also set some warnings if needed.
*/
private function loadData()
{
// inform that the module is not installed yet
if (!BackendExtensionsModel::isModuleInstalled($this->currentModule)) {
$this->warnings[] = array('message' => BL::getMessage('InformationModuleIsNotInstalled'));
}
// path to information file
$pathInfoXml = BACKEND_MODULES_PATH . '/' . $this->currentModule . '/info.xml';
// information needs to exists
if (SpoonFile::exists($pathInfoXml)) {
try {
// load info.xml
$infoXml = @new SimpleXMLElement($pathInfoXml, LIBXML_NOCDATA, true);
// convert xml to useful array
$this->information = BackendExtensionsModel::processModuleXml($infoXml);
// empty data (nothing useful)
if (empty($this->information)) {
$this->warnings[] = array('message' => BL::getMessage('InformationFileIsEmpty'));
}
// check if cronjobs are installed already
if (isset($this->information['cronjobs'])) {
foreach ($this->information['cronjobs'] as $cronjob) {
if (!$cronjob['active']) {
$this->warnings[] = array('message' => BL::getError('CronjobsNotSet'));
}
break;
}
}
} catch (Exception $e) {
$this->warnings[] = array('message' => BL::getMessage('InformationFileCouldNotBeLoaded'));
}
} else {
$this->warnings[] = array('message' => BL::getMessage('InformationFileIsMissing'));
}
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:39, 代码来源:detail_module.php
示例5: getCM
/**
* Returns the CampaignMonitor object
*
* @param int[optional] $listId The default list id to use.
* @return CampaignMonitor
*/
public static function getCM($listId = null)
{
// campaignmonitor reference exists
if (!Spoon::exists('campaignmonitor')) {
// check if the CampaignMonitor class exists
if (!SpoonFile::exists(PATH_LIBRARY . '/external/campaignmonitor.php')) {
// the class doesn't exist, so throw an exception
throw new SpoonFileException('The CampaignMonitor wrapper class is not found. Please locate and place it in /library/external');
}
// require CampaignMonitor class
require_once 'external/campaignmonitor.php';
// set login data
$url = FrontendModel::getModuleSetting('mailmotor', 'cm_url');
$username = FrontendModel::getModuleSetting('mailmotor', 'cm_username');
$password = FrontendModel::getModuleSetting('mailmotor', 'cm_password');
// init CampaignMonitor object
$cm = new CampaignMonitor($url, $username, $password, 5, self::getClientId());
// set CampaignMonitor object reference
Spoon::set('campaignmonitor', $cm);
// get the default list ID
$listId = !empty($listId) ? $listId : self::getDefaultListID();
// set the default list ID
$cm->setListId($listId);
}
// return the CampaignMonitor object
return Spoon::get('campaignmonitor');
}
开发者ID:nickmancol, 项目名称:forkcms-rhcloud, 代码行数:33, 代码来源:helper.php
示例6: getPath
/**
* Get the file path based on the theme.
* If it does not exist in the theme it will return $file.
*
* @return string Path to the (theme) file.
* @param string $file Path to the file.
*/
public static function getPath($file)
{
// redefine
$file = (string) $file;
// theme name
$theme = self::getTheme();
// theme in use
if (FrontendModel::getModuleSetting('core', 'theme', 'core') != 'core') {
// theme not yet specified
if (strpos($file, 'frontend/themes/' . $theme) === false) {
// add theme location
$themeTemplate = str_replace(array('frontend/'), array('frontend/themes/' . $theme . '/'), $file);
// check if this template exists
if (SpoonFile::exists(PATH_WWW . str_replace(PATH_WWW, '', $themeTemplate))) {
$file = $themeTemplate;
}
}
}
// check if the file exists
if (!SpoonFile::exists(PATH_WWW . str_replace(PATH_WWW, '', $file))) {
throw new FrontendException('The template (' . $file . ') doesn\'t exists.');
}
// return template path
return $file;
}
开发者ID:netconstructor, 项目名称:forkcms, 代码行数:32, 代码来源:theme.php
示例7: loadData
/**
* Load the data.
* This will also set some warnings if needed.
*/
private function loadData()
{
// inform that the theme is not installed yet
if (!BackendExtensionsModel::isThemeInstalled($this->currentTheme)) {
$this->warnings[] = array('message' => BL::getMessage('InformationThemeIsNotInstalled'));
}
// path to information file
$pathInfoXml = FRONTEND_PATH . '/themes/' . $this->currentTheme . '/info.xml';
// information needs to exists
if (SpoonFile::exists($pathInfoXml)) {
try {
// load info.xml
$infoXml = @new SimpleXMLElement($pathInfoXml, LIBXML_NOCDATA, true);
// convert xml to useful array
$this->information = BackendExtensionsModel::processThemeXml($infoXml);
// empty data (nothing useful)
if (empty($this->information)) {
$this->warnings[] = array('message' => BL::getMessage('InformationFileIsEmpty'));
}
} catch (Exception $e) {
$this->warnings[] = array('message' => BL::getMessage('InformationFileCouldNotBeLoaded'));
}
} else {
$this->warnings[] = array('message' => BL::getMessage('InformationFileIsMissing'));
}
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:30, 代码来源:detail_theme.php
示例8: parse
/**
* Parse the correct messages into the template
*/
protected function parse()
{
parent::parse();
// grab the error-type from the parameters
$errorType = $this->getParameter('type');
// set correct headers
switch ($errorType) {
case 'module-not-allowed':
case 'action-not-allowed':
SpoonHTTP::setHeadersByCode(403);
break;
case 'not-found':
SpoonHTTP::setHeadersByCode(404);
break;
}
// querystring provided?
if ($this->getParameter('querystring') !== null) {
// split into file and parameters
$chunks = explode('?', $this->getParameter('querystring'));
// get extension
$extension = SpoonFile::getExtension($chunks[0]);
// if the file has an extension it is a non-existing-file
if ($extension != '' && $extension != $chunks[0]) {
// set correct headers
SpoonHTTP::setHeadersByCode(404);
// give a nice error, so we can detect which file is missing
echo 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.';
// stop script execution
exit;
}
}
// assign the correct message into the template
$this->tpl->assign('message', BL::err(SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
}
开发者ID:nickmancol, 项目名称:forkcms-rhcloud, 代码行数:37, 代码来源:index.php
示例9: validateInstall
/**
* Validate if the module can be installed.
*/
private function validateInstall()
{
// already installed
if (BackendExtensionsModel::isModuleInstalled($this->currentModule)) {
$this->redirect(BackendModel::createURLForAction('modules') . '&error=already-installed&var=' . $this->currentModule);
}
// no installer class present
if (!SpoonFile::exists(BACKEND_MODULES_PATH . '/' . $this->currentModule . '/installer/installer.php')) {
$this->redirect(BackendModel::createURLForAction('modules') . '&error=no-installer-file&var=' . $this->currentModule);
}
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:14, 代码来源:install_module.php
示例10: validateInstall
/**
* Validate if the theme can be installed.
*/
private function validateInstall()
{
// already installed
if (BackendExtensionsModel::isThemeInstalled($this->currentTheme)) {
$this->redirect(BackendModel::createURLForAction('themes') . '&error=already-installed&var=' . $this->currentTheme);
}
// no information file present
if (!SpoonFile::exists(FRONTEND_PATH . '/themes/' . $this->currentTheme . '/info.xml')) {
$this->redirect(BackendModel::createURLForAction('themes') . '&error=no-information-file&var=' . $this->currentTheme);
}
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:14, 代码来源:install_theme.php
示例11: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
// get parameters
$url = SpoonFilter::getPostValue('url', null, '');
$username = SpoonFilter::getPostValue('username', null, '');
$password = SpoonFilter::getPostValue('password', null, '');
// filter out the 'http://' from the URL
if (strpos($url, 'http://') !== false) {
$url = str_replace('http://', '', $url);
}
if (strpos($url, 'https://') !== false) {
$url = str_replace('https://', '', $url);
}
// check input
if (empty($url)) {
$this->output(self::BAD_REQUEST, array('field' => 'url'), BL::err('NoCMAccountCredentials'));
}
if (empty($username)) {
$this->output(self::BAD_REQUEST, array('field' => 'username'), BL::err('NoCMAccountCredentials'));
}
if (empty($password)) {
$this->output(self::BAD_REQUEST, array('field' => 'password'), BL::err('NoCMAccountCredentials'));
}
try {
// check if the CampaignMonitor class exists
if (!SpoonFile::exists(PATH_LIBRARY . '/external/campaignmonitor.php')) {
// the class doesn't exist, so stop here
$this->output(self::BAD_REQUEST, null, BL::err('ClassDoesNotExist', $this->getModule()));
}
// require CampaignMonitor class
require_once 'external/campaignmonitor.php';
// init CampaignMonitor object
new CampaignMonitor($url, $username, $password, 10);
// save the new data
BackendModel::setModuleSetting($this->getModule(), 'cm_url', $url);
BackendModel::setModuleSetting($this->getModule(), 'cm_username', $username);
BackendModel::setModuleSetting($this->getModule(), 'cm_password', $password);
// account was linked
BackendModel::setModuleSetting($this->getModule(), 'cm_account', true);
} catch (Exception $e) {
// timeout occured
if ($e->getMessage() == 'Error Fetching http headers') {
$this->output(self::BAD_REQUEST, null, BL::err('CmTimeout', $this->getModule()));
}
// other error
$this->output(self::ERROR, array('field' => 'url'), sprintf(BL::err('CampaignMonitorError', $this->getModule()), $e->getMessage()));
}
// trigger event
BackendModel::triggerEvent($this->getModule(), 'after_account_linked');
// CM was successfully initialized
$this->output(self::OK, array('message' => 'account-linked'), BL::msg('AccountLinked', $this->getModule()));
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:56, 代码来源:link_account.php
示例12: addUser
/**
* Add a GOD-user
*/
private function addUser()
{
// no god user already exists
// @todo refactor this nasty if statement...
if (!(bool) $this->getDB()->getVar('SELECT 1
FROM users
WHERE is_god = ? AND deleted = ? AND active = ?
LIMIT 1', array('Y', 'N', 'Y'))) {
// secret files
$avatar124x124 = '/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHCAgICA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I0EUMkJRYjNxsf/EABkBAAMBAQEAAAAAAAAAAAAAAAMEBQIGAP/EACcRAAEDBAIBAgcAAAAAAAAAAAEAAgMEERIhMUEFIlETMkNhYqGx/9oADAMBAAIRAxEAPwBd1Bm1xmDzV+Svt+BUllsM/T6khrwGWIORsQC3j7HHNwRZWB1/U05yxbe5081Ll6S42pr8Mkm/x15mhiUH9qxpsoA4viBgFraS2S1Fye5jZXWOlMdmZ7rS5DDQvTyVLZfnn7BbMkh9wYxDwPvfhCqFiiN91eQx5OxkJQd54W96vI3tA3I6Ytu/b+3HqSLM5FYlJGlj7W/OPm1ee9pjJl8dFKHr28U9dRMVYbFXZ19TwPrbhmOnYPVz91oZHQU7hOXmTyVCC4sRaNmPXGp6JNlOzfqBA8cDkr2tdiqcPiHPYHXtfpNPK/HZ3GtJiNKYWrSW2yPYzF+zLO3WnYdEaxhSR32UrtvxhlQ2XraHW0PwBzdO2D6sLh5IL99rFwyrHJb+wG3YHuz+Bue7H/g4ZpiP2pkiMuYNXEZ2pm1BE+o5HEWIlkhTrgesAy2I32L+mxU9R+h54lxEg/imC/E3HKOMflreJ3qWBFHLY91doyWg3bb1CjDfdQd+FpI966XYRS5NBPe0kcrxaTHZC8bnVEfhrtGpQI0fySfqALbp+76/3wSL0hSfLG9gqGjmFs5RKNf5UqL+Shk3d36wAqEnzsfP3xuNxCiH2WcNYc58jdpCpg3kgntwSQ5O6B0hhZ2M0MCHqIDEDqlJ63/qO3FaOmtyg5KpwFFtQ6arXHhia56MT+kjArJ6a+mZFU90l9vu2Pu+u/lOuhsch2rfiq76b+BwqPR0WZ01pzJay3rtiJJoqn4lpmWKaMSrBMP4j7vv1n+O443Rw32UPzE+8Grsya+0lj9RVYI6k+IztpDUmh6W/wAtdDtH0AyKrk+xl7HurKWB4bkomO+XSiNkIX//2Q==';
// store files
SpoonFile::setContent(PATH_WWW . '/frontend/files/backend_users/avatars/source/god.jpg', base64_decode($avatar124x124));
SpoonFile::setContent(PATH_WWW . '/frontend/files/backend_users/avatars/128x128/god.jpg', base64_decode($avatar124x124));
SpoonFile::setContent(PATH_WWW . '/frontend/files/backend_users/avatars/64x64/god.jpg', base64_decode($avatar64x64));
SpoonFile::setContent(PATH_WWW . '/frontend/files/backend_users/avatars/32x32/god.jpg', base64_decode($avatar32x32));
// get the password strength
$passwordStrength = $this->checkPassword();
// build settings
$settings['nickname'] = serialize('Fork CMS');
$settings['name'] = serialize('Fork');
$settings['surname'] = serialize('CMS');
$settings['interface_language'] = serialize($this->getVariable('default_interface_language'));
$settings['date_format'] = serialize('j F Y');
$settings['time_format'] = serialize('H:i');
$settings['datetime_format'] = serialize(unserialize($settings['date_format']) . ' ' . unserialize($settings['time_format']));
$settings['number_format'] = serialize('dot_nothing');
$settings['password_key'] = serialize(uniqid());
$settings['password_strength'] = serialize($passwordStrength);
$settings['current_password_change'] = serialize(time());
$settings['avatar'] = serialize('god.jpg');
// build user
$user['email'] = $this->getVariable('email');
$user['password'] = sha1(md5(unserialize($settings['password_key'])) . md5($this->getVariable('password')));
$user['active'] = 'Y';
$user['deleted'] = 'N';
$user['is_god'] = 'Y';
// insert user
$user['id'] = $this->getDB()->insert('users', $user);
// build group
$group['group_id'] = $this->getSetting('users', 'default_group');
$group['user_id'] = $user['id'];
// insert group
$this->getDB()->insert('users_groups', $group);
// loop settings
foreach ($settings as $name => $value) {
// insert user settings
$this->getDB()->insert('users_settings', array('user_id' => $user['id'], 'name' => $name, 'value' => $value));
}
}
}
开发者ID:nickmancol, 项目名称:forkcms-rhcloud, 代码行数:55, 代码来源:installer.php
示例13: write
/**
* Write an error/custom message to the log.
*
* @return void
* @param string $message The messages that should be logged.
* @param string[optional] $type The type of message you want to log, possible values are: error, custom.
*/
public static function write($message, $type = 'error')
{
// milliseconds
list($milliseconds) = explode(' ', microtime());
$milliseconds = round($milliseconds * 1000, 0);
// redefine var
$message = date('Y-m-d H:i:s') . ' ' . $milliseconds . 'ms | ' . $message . "\n";
$type = SpoonFilter::getValue($type, array('error', 'custom'), 'error');
// file
$file = self::getPath() . '/' . $type . '.log';
// rename if needed
if ((int) @filesize($file) >= self::MAX_FILE_SIZE * 1024) {
// start new log file
SpoonDirectory::move($file, $file . '.' . date('Ymdhis'));
}
// write content
SpoonFile::setContent($file, $message, true, true);
}
开发者ID:JonckheereM, 项目名称:Public, 代码行数:25, 代码来源:log.php
示例14: execute
/**
* Execute the action
*/
public function execute()
{
$this->id = $this->getParameter('id', 'int');
// does the item exist
if ($this->id !== null && BackendAddressesModel::exists($this->id)) {
parent::execute();
$this->record = (array) BackendAddressesModel::get($this->id);
BackendAddressesModel::delete($this->id);
BackendAddressesModel::deleteGroupsFromAddress($this->id);
// delete the image
\SpoonFile::delete(FRONTEND_FILES_PATH . '/Addresses/Images/Source/' . $this->record['image']);
BackendSearchModel::removeIndex($this->getModule(), $this->id);
BackendModel::triggerEvent($this->getModule(), 'after_delete', array('id' => $this->id));
$this->redirect(BackendModel::createURLForAction('index') . '&report=deleted&var=' . urlencode($this->record['id']));
} else {
$this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
}
}
开发者ID:Comsa-Veurne, 项目名称:modules, 代码行数:21, 代码来源:Delete.php
示例15: processFile
/**
* Process the content of the file.
*
* @param string $file The file to process.
* @return boolean|array
*/
private function processFile($file)
{
// if the files doesn't exists we can stop here and just return an empty string
if (!SpoonFile::exists($file)) {
return array();
}
// fetch content from file
$content = SpoonFile::getContent($file);
$json = @json_decode($content, true);
// skip invalid JSON
if ($json === false || $json === null) {
return array();
}
$return = array();
// loop templates
foreach ($json as $template) {
// skip items without a title
if (!isset($template['title'])) {
continue;
}
if (isset($template['file'])) {
if (SpoonFile::exists(PATH_WWW . $template['file'])) {
$template['html'] = SpoonFile::getContent(PATH_WWW . $template['file']);
}
}
// skip items without HTML
if (!isset($template['html'])) {
continue;
}
$image = '';
if (isset($template['image'])) {
// we have to remove the first slash, because that is set in the wrapper. Otherwise the images don't work
$image = ltrim($template['image'], '/');
}
$temp['title'] = $template['title'];
$temp['description'] = isset($template['description']) ? $template['description'] : '';
$temp['image'] = $image;
$temp['html'] = $template['html'];
// add the template
$return[] = $temp;
}
return $return;
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:49, 代码来源:templates.php
示例16: loadDataGrid
/**
* Load the datagrid
*
* @return void
*/
private function loadDataGrid()
{
// init var
$items = array();
// get active modules
$modules = BackendModel::getModules();
// loop active modules
foreach ($modules as $module) {
// check if their is a model-file
if (SpoonFile::exists(BACKEND_MODULES_PATH . '/' . $module . '/engine/model.php')) {
// require the model-file
require_once BACKEND_MODULES_PATH . '/' . $module . '/engine/model.php';
// build class name
$className = SpoonFilter::toCamelCase('backend_' . $module . '_model');
// check if the getByTag-method is available
if (is_callable(array($className, 'getByTag'))) {
// make the call and get the item
$moduleItems = (array) call_user_func(array($className, 'getByTag'), $this->id);
// loop items
foreach ($moduleItems as $row) {
// check if needed fields are available
if (isset($row['url'], $row['name'], $row['module'])) {
// add
$items[] = array('module' => ucfirst(BL::lbl(SpoonFilter::toCamelCase($row['module']))), 'name' => $row['name'], 'url' => $row['url']);
}
}
}
}
}
// create datagrid
$this->dgUsage = new BackendDataGridArray($items);
// disable paging
$this->dgUsage->setPaging(false);
// hide columns
$this->dgUsage->setColumnsHidden(array('url'));
// set headers
$this->dgUsage->setHeaderLabels(array('name' => ucfirst(BL::lbl('Title')), 'url' => ''));
// set url
$this->dgUsage->setColumnURL('name', '[url]', ucfirst(BL::lbl('Edit')));
// add use column
$this->dgUsage->addColumn('edit', null, ucfirst(BL::lbl('Edit')), '[url]', BL::lbl('Edit'));
}
开发者ID:netconstructor, 项目名称:forkcms, 代码行数:47, 代码来源:edit.php
示例17: downloadCSV
/**
* Sets the headers so we may download the CSV file in question
*
* @param string $path The full path to the CSV file you wish to download.
* @return array
*/
private function downloadCSV($path)
{
// check if the file exists
if (!SpoonFile::exists($path)) {
throw new SpoonFileException('The file ' . $path . ' doesn\'t exist.');
}
// fetch the filename from the path string
$explodedFilename = explode('/', $path);
$filename = end($explodedFilename);
// set headers for download
$headers[] = 'Content-type: application/csv; charset=' . SPOON_CHARSET;
$headers[] = 'Content-Disposition: attachment; filename="' . $filename . '"';
$headers[] = 'Pragma: no-cache';
// overwrite the headers
SpoonHTTP::setHeaders($headers);
// get the file contents
$content = SpoonFile::getContent($path);
// output the file contents
echo $content;
exit;
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:27, 代码来源:addresses.php
示例18: execute
/**
* Execute the action
*/
public function execute()
{
parent::execute();
// add js
$this->header->addJS('jstree/jquery.tree.js', null, false, false, false);
$this->header->addJS('jstree/lib/jquery.cookie.js', null, false, false, false);
$this->header->addJS('jstree/plugins/jquery.tree.cookie.js', null, false, false, false);
// add css
$this->header->addCSS('/backend/modules/pages/js/jstree/themes/fork/style.css', null, true);
// check if the cached files exists
if (!SpoonFile::exists(PATH_WWW . '/frontend/cache/navigation/keys_' . BackendLanguage::getWorkingLanguage() . '.php')) {
BackendPagesModel::buildCache(BL::getWorkingLanguage());
}
if (!SpoonFile::exists(PATH_WWW . '/frontend/cache/navigation/navigation_' . BackendLanguage::getWorkingLanguage() . '.php')) {
BackendPagesModel::buildCache(BL::getWorkingLanguage());
}
// load the dgRecentlyEdited
$this->loadDataGrids();
// parse
$this->parse();
// display the page
$this->display();
}
开发者ID:naujasdizainas, 项目名称:forkcms, 代码行数:26, 代码来源:index.php
GitbookIO/gitbook:
阅读:956| 2022-08-17
juleswhite/mobile-cloud-asgn1
阅读:1032| 2022-08-30
Delphi的FireDAC连接管理与配置过程:使用FireDAC技术连接数据库,主要是使用 TFDCon
阅读:884| 2022-07-18
kyamagu/matlab-json: Use official API: https://mathworks.com/help/matlab/json-fo
阅读:926| 2022-08-17
书名:墙壁眼睛膝盖 作者:温柔一刀 类别:欲望丛林,饮食男女。 簡介:Wall(我)Eye(爱)Kn
阅读:656| 2022-11-06
Authenticated (admin or higher user role) Reflected Cross-Site Scripting (XSS) v
阅读:1037| 2022-07-29
sevenjay/cpp-markdown: Cpp-Markdown is a freely-available Markdown text-to-HTML
阅读:582| 2022-08-18
Karumi/MaxibonKataKotlin: Maxibon kata for Kotlin Developers. The main goal is t
阅读:623| 2022-08-13
mathjax/MathJax-i18n: MathJax localization
阅读:388| 2022-08-16
众所周知,我们的身份证号码里面包含的信息有很多,如出生日期、性别和识别码等,如果
阅读:252| 2022-11-06
请发表评论