本文整理汇总了PHP中__Config类的典型用法代码示例。如果您正苦于以下问题:PHP __Config类的具体用法?PHP __Config怎么用?PHP __Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了__Config类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
/**
* @param $msg
* @param int $level
* @param string $group
*
* @return bool|mixed
* @throws Exception
*/
function log($msg, $level = GLZ_LOG_DEBUG, $group = '')
{
if (!$this->_check($level, $group)) {
return false;
}
$t = explode(" ", microtime());
$params = array('@timestamp' => date("Y-m-d\\TH:i:s", $t[1]) . substr((string) $t[0], 1, 4) . date("P"), 'host' => !isset($_SERVER["SERVER_ADDR"]) ? 'console' : $_SERVER["SERVER_ADDR"], 'group' => $group, 'level' => $level, 'caller' => $this->getCallingName(), 'pid' => getmypid(), 'appName' => __Config::get('APP_NAME'));
$message = array_merge($this->_message, $params);
if (is_array($msg)) {
$message = array_merge($message, $msg);
} else {
$message = array_merge($message, array('message' => $msg));
}
// set_time_limit(0);
$data = json_encode($message);
$restUrl = $this->_host . $this->_index . '-' . date("Y.m.d") . '/' . $this->_type;
$ch = curl_init($restUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($data)));
if (!($result = curl_exec($ch))) {
if (class_exists('org_glizy_Config') && org_glizy_Config::get('DEBUG') === true) {
throw new Exception(curl_error($ch), curl_errno($ch));
}
}
curl_close($ch);
return $result;
}
示例2: __construct
public function __construct()
{
$application = org_glizy_ObjectValues::get('org.glizy', 'application');
if (__Config::get('glizycms.speakingUrl') && !$application->isAdmin()) {
$this->addEventListener(GLZ_EVT_START_COMPILE_ROUTING, $this);
}
}
示例3: executeLater
public function executeLater()
{
if ($this->submit && $this->controller->validate()) {
$email = org_glizy_Request::get('user_email', '');
$ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
if ($ar->find(array('user_loginId' => $email))) {
// TODO tradurre
$this->view->validateAddError('L\'email è già presente nel database, usare un\'altra email o richiedere la password');
return;
}
$fields = $ar->getFields();
foreach ($fields as $k => $v) {
if (__Request::exists($k)) {
$ar->{$k} = __Request::get($k);
}
}
$ar->user_FK_usergroup_id = __Config::get('USER_DEFAULT_USERGROUP');
$ar->user_isActive = __Config::get('USER_DEFAULT_ACTIVE_STATE');
$ar->user_password = glz_password(__Request::get('user_password'));
$ar->user_loginId = $email;
$ar->user_email = $email;
$ar->user_dateCreation = new org_glizy_types_DateTime();
$ar->save();
$this->changeAction('registrationConfirm');
}
}
示例4: execute
public function execute()
{
$siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->application->getEditingLanguage(), ''));
if ($siteProp) {
$this->view->setData($siteProp);
}
}
示例5: init
/**
* Init
*
* @return void
* @access public
*/
public function init()
{
$this->defineAttribute('global', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('adm:cssClass', false, __Config::get('glizy.formElement.admCssClass'), COMPONENT_TYPE_STRING);
// call the superclass for validate the attributes
parent::init();
}
示例6: loadSelectedImage
private function loadSelectedImage($query)
{
foreach ($query['savedImage'] as $item) {
$imgSrc = $item->edmPreview[0] ? $item->edmPreview[0] : __Config::get('movio.noImage.src');
$this->_content['records'][] = array('id' => $item->id, 'image' => $item->src, 'title' => $item->title, 'url' => $item->href);
}
}
示例7: collect
/**
* {@inheritdoc}
*/
public function collect()
{
$application = org_glizy_ObjectValues::get('org.glizy', 'application');
$result = array();
$result['pageId'] = $application->getPageId();
$result['routing'] = __Request::get('__routingName__') . ' > ' . __Request::get('__routingPattern__');
$result['controllers'] = implode(', ', $this->calledControllers);
$user = $application->getCurrentUser();
$userData = array('id' => $user->id, 'firstName' => $user->firstName, 'lastName' => $user->lastName, 'email' => $user->email, 'groupId' => $user->groupId, 'backEndAccess' => $user->backEndAccess);
$result['user'] = $this->getDataFormatter()->formatVar($userData);
$menu = $application->getCurrentMenu();
$menuData = array('id' => $menu->id, 'title' => $menu->title, 'parentId' => $menu->parentId, 'pageType' => $menu->pageType, 'type' => $menu->type, 'depth' => $menu->depth);
$result['menu'] = $this->getDataFormatter()->formatVar($menuData);
// request
$data = __Request::getAllAsArray();
$tempData = array();
foreach ($data as $k => $v) {
if (strpos($k, '__') !== 0) {
$tempData[$k] = $v;
}
}
$result['__Request'] = $this->getDataFormatter()->formatVar($tempData);
$result['__Config'] = $this->getDataFormatter()->formatVar(__Config::getAllAsArray());
$result['__Routing'] = $this->getDataFormatter()->formatVar(__Routing::getAllAsArray());
$result['__Session'] = $this->getDataFormatter()->formatVar(__Session::getAllAsArray());
return $result;
}
示例8: publish
public function publish()
{
$exportPath = __Paths::get('CACHE') . 'export/';
$mediaPath = $exportPath . 'media/';
$zipPath = __Paths::get('BASE') . 'export/' . 'mobileContents.zip';
org_glizy_helpers_Files::deleteDirectory($exportPath);
@unlink($zipPath);
@mkdir($exportPath);
@mkdir($mediaPath);
$exportService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.ExportService');
$exportService->export();
$medias = $exportService->getMedias();
foreach ($medias as $id => $fileName) {
$media = org_glizycms_mediaArchive_MediaManager::getMediaById($id);
copy($media->getFileName(), $mediaPath . $fileName);
}
$dbHost = __Config::get('DB_HOST');
$dbUser = __Config::get('DB_USER');
$dbPass = __Config::get('DB_PSW');
$dbName = __Config::get('DB_NAME');
$tableName = __Config::get('movio.modules.publishApp.mobileContentsTable');
$sqliteDb = $exportPath . __Config::get('movio.modules.publishApp.sqliteDbName');
$mysql2SqliteService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.Mysql2SqliteService');
$mysql2SqliteService->convert($dbHost, $dbUser, $dbPass, $dbName, $tableName, $sqliteDb);
$this->createZip($exportPath, $zipPath);
org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', time());
}
示例9: init
/**
* Init
*
* @return void
* @access public
*/
function init()
{
// define the custom attributes
$this->defineAttribute('bindTo', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('cssClass', false, __Config::get('glizy.formElement.cssClass'), COMPONENT_TYPE_STRING);
$this->defineAttribute('cssClassLabel', false, __Config::get('glizy.formElement.cssClassLabel'), COMPONENT_TYPE_STRING);
$this->defineAttribute('dataProvider', false, NULL, COMPONENT_TYPE_OBJECT);
$this->defineAttribute('disabled', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('emptyValue', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('jsAction', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('label', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('multiSelect', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('rows', false, 1, COMPONENT_TYPE_INTEGER);
$this->defineAttribute('readOnly', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('required', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('size', false, '', COMPONENT_TYPE_STRING);
$this->defineAttribute('value', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('wrapLabel', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('insertInto', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('target', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('title', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('checkValues', false, NULL, COMPONENT_TYPE_STRING);
$this->defineAttribute('searchCondition', false, '=', COMPONENT_TYPE_STRING);
$this->defineAttribute('adm:suggest', false, NULL, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('adm:suggestAdd', false, NULL, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('adm:suggestDelimiter', false, ' ', COMPONENT_TYPE_STRING);
$this->defineAttribute('outputOnlyValue', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('linkedTo', false, NULL, COMPONENT_TYPE_OBJECT);
$this->defineAttribute('flip', false, false, COMPONENT_TYPE_BOOLEAN);
$this->defineAttribute('setFirstValue', false, true, COMPONENT_TYPE_BOOLEAN);
// call the superclass for validate the attributes
parent::init();
}
示例10: includeFolder
private function includeFolder($folder)
{
// controlla se il file in cache è valido
$options = array('cacheDir' => org_glizy_Paths::get('CACHE_CODE'), 'lifeTime' => org_glizy_Config::get('CACHE_CODE'), 'readControlType' => '', 'fileExtension' => '.css');
$cacheSignature = get_class($this) . $folder;
$cacheObj = org_glizy_ObjectFactory::createObject('org.glizy.cache.CacheFile', $options);
$cssFileName = $cacheObj->verify($cacheSignature);
if ($cssFileName === false) {
$cssFile = '';
if ($dir_handle = @opendir($folder)) {
while ($file_name = readdir($dir_handle)) {
if ($file_name != "." && $file_name != ".." && !is_dir("{$dir}/{$file_name}")) {
$f[] = $file_name;
}
}
sort($f);
closedir($dir_handle);
foreach ($f as $element) {
$cssCode = file_get_contents($folder . '/' . $element);
$cssFile .= $cssCode . "\n";
}
}
if (__Config::get('DEBUG') !== false) {
$cacheObj->save($cssFile, NULL, get_class($this));
} else {
$cacheObj->save($cssFile, NULL, $cacheSignature);
}
$cssFileName = $cacheObj->getFileName();
}
return $cssFileName;
}
示例11: createChildComponents
function createChildComponents()
{
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$properties = $entityTypeService->getEntityTypeAttributeProperties(__Request::get('entityTypeId'), $this->_parent->getId());
$moduleId = $properties['entity_properties_params'];
$this->_content['title'] = $this->data->text;
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'title', 'title');
$this->addChild($c);
$this->_content['url'] = __Routing::makeUrl($moduleId, array('document_id' => $this->data->id, 'title' => $this->data->text));
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'url', 'url');
$this->addChild($c);
$module = org_glizy_Modules::getModule($moduleId);
$ar = org_glizy_ObjectFactory::createModel($module->classPath . '.models.Model');
$ar->load($this->data->id);
if ($ar->fieldExists('image')) {
$this->_content['__image'] = $ar->image;
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $this, 'glz:Image', '__image', '__image');
$c->setAttribute('width', __Config::get('THUMB_WIDTH'));
$c->setAttribute('height', __Config::get('THUMB_HEIGHT'));
$c->setAttribute('crop', true);
$this->addChild($c);
} else {
$c =& org_glizy_ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.NoImage', $this->_application, $this, 'glz:Image', '__image', '__image');
$c->setAttribute('width', __Config::get('THUMB_SMALL_WIDTH'));
$c->setAttribute('height', __Config::get('THUMB_SMALL_HEIGHT'));
$this->addChild($c);
}
}
示例12: execute
public function execute()
{
$authClass = org_glizy_ObjectFactory::createObject(__Config::get('glizy.authentication'));
$authClass->logout();
org_glizy_helpers_Navigation::gotoUrl(GLZ_HOST);
exit;
}
示例13: render_html
function render_html()
{
if (!__Config::get('MULTILANGUAGE_ENABLED')) {
return false;
}
$iterator = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language', 'all', array('order' => 'language_order'));
if ($iterator->count() > 1) {
$output = '<ul class="' . $this->getAttribute('cssClass') . '" id="' . $this->getId() . '">';
if ($this->getAttribute('separator') == 'start') {
$output .= '<li class="separator">|</li>';
}
foreach ($iterator as $ar) {
$url = __Link::addParams(array('language' => $ar->language_code));
if ($ar->language_id == $this->_application->getLanguageId()) {
$output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url, '', 'active') . '</li>';
} else {
$output .= '<li class="' . $ar->language_code . '">' . org_glizy_helpers_Link::makeSimpleLink(glz_encodeOutput($ar->language_name), $url) . '</li>';
}
}
if ($this->getAttribute('separator') == 'end') {
$output .= '<li>|</li>';
}
$output .= '</ul>';
$this->addOutputCode($output);
}
}
示例14: renderCell
public function renderCell(&$ar)
{
$media = org_glizycms_mediaArchive_MediaManager::getMediaByRecord($ar);
$sizes = method_exists($media, 'getOriginalSizes') ? $media->getOriginalSizes() : array('width' => 0, 'height' => 0);
$thumbnail = $media->getThumbnail(__Config::get('THUMB_WIDTH'), __Config::get('THUMB_HEIGHT'), __Config::get('ADM_THUMBNAIL_CROP'), __Config::get('ADM_THUMBNAIL_CROPPOS'));
$ar->thumb_filename = $thumbnail['fileName'];
$ar->thumb_w = $thumbnail['width'];
$ar->thumb_h = $thumbnail['height'];
$ar->media_w = $sizes['width'];
$ar->media_h = $sizes['height'];
if ($ar->media_title == '') {
$ar->media_title = $ar->media_originalFileName;
}
if (!$ar->media_date) {
$ar->media_date = '';
}
if (!$ar->media_copyright) {
$ar->media_copyright = '';
}
if (!$ar->media_description) {
$ar->media_description = '';
}
$ar->__jsonMedia = org_glizycms_Glizycms::getMediaArchiveBridge()->getJsonFromAr($ar);
$application = $this->application;
$user = $application->_user;
$ar->__url__ = $user->acl($application->getPageId(), 'edit') ? __Routing::makeUrl('actionsMVC', array('action' => 'edit', 'id' => $ar->media_id)) : false;
$ar->__urlDelete__ = $user->acl($application->getPageId(), 'delete') ? __Routing::makeUrl('actionsMVC', array('action' => 'delete', 'id' => $ar->media_id)) : false;
$ar->__urlDownload__ = org_glizycms_helpers_Media::getFileUrlById($ar->media_id);
$ar->__urlPreview__ = org_glizycms_helpers_Media::getImageUrlById($ar->media_id, 800, 600);
}
示例15: getGraph
public function getGraph($entityTypeId, &$visited, &$edges)
{
if ($visited[$entityTypeId]) {
return '';
} else {
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$entityProperties = $entityTypeService->getEntityTypeProperties($entityTypeId);
$graph = '';
$color = __Config::get('movio.graph.shapeColor');
$entityTypeName = $entityTypeService->getEntityTypeName($entityTypeId);
if ($this->getAttribute('generateLinks')) {
$entityResolver = org_glizy_objectFactory::createObject('movio.modules.ontologybuilder.EntityResolver');
$ar = $entityResolver->getMenuVisibleEntity($entityTypeId);
if ($ar) {
$url = $this->makeUrl($ar->id, $ar->title);
}
}
// se è il nodo da cui inizia la ricerca ricorsiva
if (count($visited) == 0) {
if (empty($url)) {
$graph .= '"' . $this->escape($entityTypeName) . '" [label="<div class=\'main-node\'>' . $this->escape($entityTypeName) . '</div>",style="fill: #ddd"];' . PHP_EOL;
} else {
$graph .= '"' . $this->escape($entityTypeName) . '" [label="<div class=\'main-node\'><a href=\'' . $url . '\'>' . $this->escape($entityTypeName) . '</a></div>",style="fill: #ddd"];' . PHP_EOL;
}
} else {
if ($url) {
$graph .= '"' . $this->escape($entityTypeName) . '" [label="<div><a href=\'' . $url . '\'>' . $this->escape($entityTypeName) . '</a>"];' . PHP_EOL;
}
}
$visited[$entityTypeId] = true;
foreach ((array) $entityProperties as $entityProperty) {
if ($entityProperty['entity_properties_target_FK_entity_id']) {
$toEntityTypeId = $entityProperty['entity_properties_target_FK_entity_id'];
$toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId);
$label = __Tp('rel:' . $entityProperty['entity_properties_type']);
if (!$edges[$entityTypeName][$toEntityTypeName]) {
$edges[$entityTypeName][$toEntityTypeName] = true;
$graph .= '"' . $this->escape($entityTypeName) . '" -> "' . $this->escape($toEntityTypeName) . '" [label="' . $label . '"];' . PHP_EOL;
}
$graph .= $this->getGraph($toEntityTypeId, $visited, $edges);
}
}
$referenceRelations = $entityTypeService->getEntityTypeReferenceRelations($entityTypeId);
foreach ((array) $referenceRelations as $referenceRelation) {
if ($referenceRelation['entity_properties_target_FK_entity_id']) {
$toEntityTypeId = $referenceRelation['entity_properties_FK_entity_id'];
$toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId);
$label = __Tp('rel:' . $referenceRelation['entity_properties_type']);
if (!$edges[$toEntityTypeName][$entityTypeName]) {
$edges[$toEntityTypeName][$entityTypeName] = true;
$graph .= '"' . $this->escape($toEntityTypeName) . '" -> "' . $this->escape($entityTypeName) . '" [label="' . $label . '"];' . PHP_EOL;
}
$graph .= $this->getGraph($toEntityTypeId, $visited, $edges);
}
}
$visited[$entityTypeId] = true;
return $graph;
}
}