本文整理汇总了PHP中Cx\Core\Core\Controller\Cx类的典型用法代码示例。如果您正苦于以下问题:PHP Cx类的具体用法?PHP Cx怎么用?PHP Cx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: loadThumbnails
public function loadThumbnails()
{
/**
* @var $cx \Cx\Core\Core\Controller\Cx
*/
$pdo = $this->cx->getDb()->getPdoConnection();
$sth = $pdo->query('SELECT id,name, size, 100 as quality, CONCAT(".thumb_",name) as value FROM `' . DBPREFIX . 'settings_thumbnail`');
self::$thumbnails = $sth->fetchAll();
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:9,代码来源:UploaderConfiguration.class.php
示例2: getComponent
/**
* Get a component controller object
*
* @param string $name component name
* @return \Cx\Core\Core\Model\Entity\SystemComponentController
* The requested component controller or null if no such component exists
*/
public function getComponent($name)
{
if (empty($name)) {
return null;
}
$componentRepo = $this->cx->getDb()->getEntityManager()->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
$component = $componentRepo->findOneBy(array('name' => $name));
if (!$component) {
return null;
}
return $component->getSystemComponentController();
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:19,代码来源:DefaultEventListener.class.php
示例3: preResolve
/**
* Do something before resolving is done
*
* @param \Cx\Core\Routing\Url $request The URL object for this request
*/
public function preResolve(\Cx\Core\Routing\Url $request)
{
if (\Cx\Core\Core\Controller\Cx::instanciate()->getMode() == \Cx\Core\Core\Controller\Cx::MODE_BACKEND) {
$sessionObj = $this->getSession();
$sessionObj->cmsSessionStatusUpdate('backend');
}
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:12,代码来源:ComponentController.class.php
示例4: initDefaultCategoryImage
protected function initDefaultCategoryImage()
{
$this->defaultCategoryImage['src'] = \Cx\Core\Core\Controller\Cx::instanciate()->getClassLoader()->getWebFilePath(\Cx\Core\Core\Controller\Cx::instanciate()->getModuleFolderName() . '/Downloads/View/Media/no_picture.gif');
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBasePath() . $this->defaultCategoryImage['src']);
$this->defaultCategoryImage['width'] = $imageSize[0];
$this->defaultCategoryImage['height'] = $imageSize[1];
}
开发者ID:hbdsklf,项目名称:LimeCMS,代码行数:7,代码来源:DownloadsLibrary.class.php
示例5: __construct
private function __construct()
{
global $objInit;
$backOrFrontend = $objInit->mode;
// TODO: Unused
// global $objFWUser;
// $langId;
if ($backOrFrontend == "frontend") {
$langId = $objInit->getFrontendLangId();
} else {
//backend
$langId = $objInit->getBackendLangId();
}
$langCode = FWLanguage::getLanguageCodeById($langId);
$this->setVariable(array('path' => ASCMS_PATH_OFFSET . '/' . $langCode . '/', 'basePath' => ASCMS_PATH_OFFSET . '/', 'cadminPath' => \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteBackendPath() . '/', 'mode' => $objInit->mode, 'language' => $langCode, 'csrf' => \Cx\Core\Csrf\Controller\Csrf::code()), 'contrexx');
//let i18n set it's variables
$i18n = new ContrexxJavascriptI18n($langCode);
$i18n->variablesTo($this);
//determine the correct jquery ui css' path.
//the user might have overridden the default css in the theme, so look out for this too.
$jQUiCssPath = 'themes/' . $objInit->getCurrentThemesPath() . '/jquery-ui.css';
//customized css would be here
if ($objInit->mode != 'frontend' || !file_exists(ASCMS_DOCUMENT_ROOT . '/' . $jQUiCssPath)) {
//use standard css
$jQUiCssPath = 'lib/javascript/jquery/ui/css/jquery-ui.css';
}
$this->setVariable(array('jQueryUiCss' => $jQUiCssPath), 'contrexx-ui');
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:28,代码来源:ContrexxJavascript.class.php
示例6: testSubdirectoryCheck
/**
* Test the subdirectory check in the filesystem class
*/
public function testSubdirectoryCheck()
{
$cx = Cx::instanciate();
$this->assertTrue(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/images', 'files/'));
$this->assertFalse(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/media', 'files/'));
$this->assertFalse(MediaSourceManager::isSubdirectory($cx->getWebsitePath() . '/images', 'media5/'));
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:10,代码来源:FileSystemTest.class.php
示例7: getPage
/**
* Get the requested Page.
*
* @access public
*/
public function getPage()
{
$_GET['act'] = empty($_GET['act']) ? '' : $_GET['act'];
switch ($_GET['act']) {
case 'lostpw':
$this->showPasswordLost();
break;
case 'resetpw':
$this->showPasswordReset();
break;
case 'verify':
$this->verifyUserAccount();
break;
case 'captcha':
$this->getCaptcha();
break;
default:
$this->showLogin();
break;
}
$this->objTemplate->setVariable('CONTREXX_CHARSET', CONTREXX_CHARSET);
$endcode = $this->objTemplate->get();
// replace links from before contrexx 3
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$ls = new \LinkSanitizer($cx, $cx->getCodeBaseOffsetPath() . $cx->getBackendFolderName() . '/', $endcode);
$endcode = $ls->replace();
echo $endcode;
exit;
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:34,代码来源:LoginManager.class.php
示例8: __construct
function __construct($path)
{
$this->cx = \Cx\Core\Core\Controller\Cx::instanciate();
if (!$path) {
throw new \InvalidArgumentException("Path shouldn't be empty: Given: " . $path);
}
$this->rootPath = rtrim($path, '/');
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:8,代码来源:LocalFileSystem.class.php
示例9: __construct
/**
* Constructor
*/
function __construct($name)
{
$this->imagePath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesMediaDirPath() . '/';
$this->imageWebPath = \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteImagesMediaDirWebPath() . '/';
parent::__construct('.', $name);
parent::getFrontendLanguages();
parent::getSettings();
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:11,代码来源:MediaDirectoryInputfieldDownloads.class.php
示例10: renderElement
protected function renderElement($title, $level, $hasChilds, $lang, $path, $current, $page)
{
$width = $level * 25;
$spacer = "<img src='" . ASCMS_CORE_MODULE_FOLDER . "/Sitemap/View/Media/spacer.gif' width='{$width}' height='12' alt='' />";
$linkTarget = $page->getLinkTarget();
$this->template->setVariable(array('STYLE' => self::cssPrefix . '_' . $level, 'SPACER' => $spacer, 'NAME' => $title, 'TARGET' => empty($linkTarget) ? '_self' : $linkTarget, 'URL' => \Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteOffsetPath() . $this->virtualLanguageDirectory . $path));
$this->template->parse('sitemap');
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:8,代码来源:SitemapPageTree.class.php
示例11: postInit
/**
* postInit
*
* @param \Cx\Core\Core\Controller\Cx $cx
*
* @return null
*/
public function postInit(\Cx\Core\Core\Controller\Cx $cx)
{
$componentController = $this->getComponent('MultiSite');
if (!$componentController) {
return;
}
\Cx\Core\Setting\Controller\Setting::init('MultiSite', 'config', 'FileSystem');
if (\Cx\Core\Setting\Controller\Setting::getValue('mode', 'MultiSite') != \Cx\Core_Modules\MultiSite\Controller\ComponentController::MODE_WEBSITE) {
return;
}
$updateFile = $cx->getWebsiteTempPath() . '/Update/' . \Cx\Core_Modules\Update\Model\Repository\DeltaRepository::PENDING_DB_UPDATES_YML;
if (!file_exists($updateFile)) {
return;
}
$componentController->setCustomerPanelDomainAsMainDomain();
$updateController = $this->getController('Update');
$updateController->applyDelta();
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:25,代码来源:ComponentController.class.php
示例12: __construct
/**
* Constructor
*/
function __construct($name)
{
global $_ARRAYLANG, $_CORELANG, $objTemplate, $_CONFIG;
$this->act = !empty($_GET['act']) ? $_GET['act'] : '';
$this->limit = $_CONFIG['corePagingLimit'];
$this->offset = !empty($_GET['pos']) ? $_GET['pos'] : 0;
parent::__construct(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseModulePath() . '/MediaDir/View/Template/Backend', $name);
parent::getFrontendLanguages();
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:12,代码来源:MediaDirectoryManager.class.php
示例13: preResolve
/**
* Do something before resolving is done
*
* @param \Cx\Core\Routing\Url $request The URL object for this request
*/
public function preResolve(\Cx\Core\Routing\Url $request)
{
global $sessionObj;
if (\Cx\Core\Core\Controller\Cx::instanciate()->getMode() == \Cx\Core\Core\Controller\Cx::MODE_BACKEND) {
if (empty($sessionObj)) {
$sessionObj = \cmsSession::getInstance();
}
$_SESSION->cmsSessionStatusUpdate('backend');
}
}
开发者ID:Niggu,项目名称:cloudrexx,代码行数:15,代码来源:ComponentController.class.php
示例14: __construct
/**
* PHP5 constructor
*
* @global array
* @global array
* @global HTML_Teplate_Sigma
*/
function __construct()
{
global $_ARRAYLANG, $_CORELANG, $objTemplate;
$this->_objTpl = new \Cx\Core\Html\Sigma(ASCMS_MODULE_PATH . '/Market/View/Template/Backend');
\Cx\Core\Csrf\Controller\Csrf::add_placeholder($this->_objTpl);
$this->_objTpl->setErrorHandling(PEAR_ERROR_DIE);
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$this->mediaPath = $cx->getWebsiteMediaMarketPath() . '/';
$this->mediaWebPath = $cx->getWebsiteMediaMarketWebPath() . '/';
$this->settings = $this->getSettings();
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:18,代码来源:MarketManager.class.php
示例15: initDefaultCategoryImage
protected function initDefaultCategoryImage()
{
$this->defaultCategoryImage['src'] = ASCMS_DOWNLOADS_IMAGES_WEB_PATH . '/no_picture.gif';
if (file_exists(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $this->defaultCategoryImage['src'])) {
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getWebsiteDocumentRootPath() . $this->defaultCategoryImage['src']);
} else {
$imageSize = getimagesize(\Cx\Core\Core\Controller\Cx::instanciate()->getCodeBaseDocumentRootPath() . $this->defaultCategoryImage['src']);
}
$this->defaultCategoryImage['width'] = $imageSize[0];
$this->defaultCategoryImage['height'] = $imageSize[1];
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:11,代码来源:DownloadsLibrary.class.php
示例16: getPath
/**
* Returns the created path by the given array.
*
* @param array $matches
* @return string created path
*/
private function getPath($matches)
{
// The Shop JS Cart escapes pathes because he loads it via JavaScript.
// For this reason, we replace escaped slashes by slashes.
$matches[\LinkSanitizer::FILE_PATH] = str_replace('\\/', '/', $matches[\LinkSanitizer::FILE_PATH]);
$testPath = explode('?', $matches[\LinkSanitizer::FILE_PATH], 2);
if ($testPath[0] == 'index.php' || $testPath[0] == '' || $testPath[0] == './') {
$ret = ASCMS_INSTANCE_OFFSET;
if (\Env::get('cx')->getMode() == \Cx\Core\Core\Controller\Cx::MODE_BACKEND) {
$ret .= \Cx\Core\Core\Controller\Cx::instanciate()->getBackendFolderName();
}
$ret .= '/';
if (isset($testPath[1])) {
$args = preg_split('/&(amp;)?/', $testPath[1]);
$params = array();
foreach ($args as $arg) {
$split = explode('=', $arg, 2);
$params[$split[0]] = $split[1];
}
// frontend case
if (isset($params['section'])) {
$cmd = '';
if (isset($params['cmd'])) {
$cmd = $params['cmd'];
unset($params['cmd']);
}
$ret = \Cx\Core\Routing\Url::fromModuleAndCmd($params['section'], $cmd);
unset($params['section']);
// backend case
} else {
if (isset($params['cmd'])) {
$ret .= $params['cmd'];
unset($params['cmd']);
if (isset($params['act'])) {
$ret .= '/' . $params['act'];
unset($params['act']);
}
}
}
if (count($params)) {
$ret .= '?' . http_build_query($params);
}
}
return $matches[\LinkSanitizer::ATTRIBUTE_AND_OPEN_QUOTE] . $ret . $matches[\LinkSanitizer::CLOSE_QUOTE];
} else {
if ($this->fileExists(ASCMS_DOCUMENT_ROOT . '/' . $matches[\LinkSanitizer::FILE_PATH])) {
// this is an existing file, do not add virtual language dir
return $matches[\LinkSanitizer::ATTRIBUTE_AND_OPEN_QUOTE] . ASCMS_INSTANCE_OFFSET . '/' . $matches[\LinkSanitizer::FILE_PATH] . $matches[\LinkSanitizer::CLOSE_QUOTE];
} else {
// this is a link to a page, add virtual language dir
return $matches[\LinkSanitizer::ATTRIBUTE_AND_OPEN_QUOTE] . $this->offset . $matches[\LinkSanitizer::FILE_PATH] . $matches[\LinkSanitizer::CLOSE_QUOTE];
}
}
}
开发者ID:hbdsklf,项目名称:LimeCMS,代码行数:60,代码来源:LinkSanitizer.class.php
示例17: __construct
/**
* Constructor
*/
public function __construct()
{
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$folderPath = $cx->getWebsiteTempPath() . '/Update';
if (!file_exists($folderPath)) {
\Cx\Lib\FileSystem\FileSystem::make_folder($folderPath);
}
if (!file_exists($folderPath . '/' . self::PENDING_DB_UPDATES_YML)) {
\Cx\Lib\FileSystem\FileSystem::copy_file($cx->getCodeBaseCoreModulePath() . '/Update/Data/' . self::PENDING_DB_UPDATES_YML, $folderPath . '/' . self::PENDING_DB_UPDATES_YML);
}
parent::__construct($folderPath . '/' . self::PENDING_DB_UPDATES_YML);
}
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:15,代码来源:DeltaRepository.class.php
示例18: removeFile
/**
* @param $params
*/
public function removeFile($params)
{
\Env::get('init')->loadLanguageData('MediaBrowser');
$path = !empty($params['get']['path']) ? contrexx_input2raw($params['get']['path']) : null;
$filename = !empty($params['post']['file']['datainfo']['name']) ? contrexx_input2raw($params['post']['file']['datainfo']['name']) : null;
if ($filename && $path) {
$pathArray = explode('/', $path);
// Shift off the first element of the array to get the media type.
$mediaType = array_shift($pathArray);
$strPath = '/' . join('/', $pathArray);
$this->setMessage($this->cx->getMediaSourceManager()->getMediaType($mediaType)->getFileSystem()->removeFile(new \Cx\Core\MediaSource\Model\Entity\LocalFile($strPath . $filename)));
}
}
开发者ID:hbdsklf,项目名称:LimeCMS,代码行数:16,代码来源:JsonMediaBrowser.class.php
示例19: retrieve
/**
* @param String $name
*
* @return array
* @throws ParserException
*/
public function retrieve($name)
{
$file = file_get_contents(\Cx\Core\Core\Controller\Cx::instanciate()->getClassLoader()->getFilePath($this->path . '/' . $name . '/options/options.yml'));
if ($file) {
try {
$yaml = new Parser();
return $yaml->parse($file);
} catch (ParserException $e) {
preg_match("/line (?P<line>[0-9]+)/", $e->getMessage(), $matches);
throw new ParserException($e->getMessage(), $matches['line']);
}
} else {
throw new ParserException("File" . $this->path . '/' . $name . '/options/options.yml not found');
}
}
开发者ID:hbdsklf,项目名称:LimeCMS,代码行数:21,代码来源:OptionSetFileStorage.class.php
示例20: clearCachePageForDomainAndPort
/**
* Clears a cache page
* @param string $urlPattern Drop all pages that match the pattern, for exact format, make educated guesses
* @param string $domain Domain name to drop cache page of
* @param int $port Port to drop cache page of
*/
protected function clearCachePageForDomainAndPort($urlPattern, $domain, $port)
{
$cx = \Cx\Core\Core\Controller\Cx::instanciate();
$strCachePath = $cx->getWebsiteCachePath() . '/';
$glob = null;
if ($urlPattern == '*') {
$glob = $strCachePath . '*';
}
if (!$glob) {
$searchParts = $cx->getComponent('Cache')->getCacheFileNameSearchPartsFromUrl($urlPattern);
$glob = $strCachePath . $cx->getComponent('Cache')->getCacheFileNameFromUrl($urlPattern, false) . '*' . implode('', $searchParts) . '*';
}
if ($glob !== null) {
$fileNames = glob($glob);
foreach ($fileNames as $fileName) {
if (!preg_match('#/[0-9a-f]{32}((_[plutgc][a-z0-9]+)+)?$#', $fileName)) {
continue;
}
try {
$file = new \Cx\Lib\FileSystem\File($fileName);
$file->delete();
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
}
}
return;
}
$cacheFile = $cx->getComponent('Cache')->getCacheFileNameFromUrl($urlPattern);
try {
$file = new \Cx\Lib\FileSystem\File($strCachePath . $cacheFile);
$file->delete();
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
}
// make sure HTTP and HTTPS files are dropped
if (substr($urlPattern, 0, 5) == 'https') {
$urlPattern = 'http' . substr($urlPattern, 5);
} else {
if (substr($urlPattern, 0, 4) == 'http') {
$urlPattern = 'https' . substr($urlPattern, 4);
}
}
$cacheFile = md5($urlPattern);
try {
$file = new \Cx\Lib\FileSystem\File($strCachePath . $cacheFile);
$file->delete();
} catch (\Cx\Lib\FileSystem\FileSystemException $e) {
}
}
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:53,代码来源:ReverseProxyCloudrexx.class.php
注:本文中的Cx\Core\Core\Controller\Cx类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论