diff options
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | framework/TApplication.php | 8 | ||||
-rw-r--r-- | framework/TComponent.php | 8 | ||||
-rw-r--r-- | framework/Web/Services/TPageService.php | 4 | ||||
-rw-r--r-- | framework/Web/TCacheManager.php | 116 | ||||
-rw-r--r-- | framework/Web/UI/TControl.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/TPage.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/TTemplate.php | 4 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateControl.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/TTheme.php | 2 |
10 files changed, 16 insertions, 133 deletions
diff --git a/.gitattributes b/.gitattributes index bdbd62cf..7c9dd4dd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -34,7 +34,6 @@ framework/TODO.txt -text framework/Web/Javascripts/WebForms.js -text framework/Web/Services/TAssetService.php -text framework/Web/Services/TPageService.php -text -framework/Web/TCacheManager.php -text framework/Web/THttpRequest.php -text framework/Web/THttpResponse.php -text framework/Web/THttpSession.php -text diff --git a/framework/TApplication.php b/framework/TApplication.php index 973032e5..55c1df6c 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -362,7 +362,7 @@ class TApplication extends TComponent implements IApplication // set application properties
foreach($config->getProperties() as $name=>$value)
- $this->setPropertyByPath($name,$value);
+ $this->setSubProperty($name,$value);
// load parameters
$this->_parameters=new TMap;
@@ -374,7 +374,7 @@ class TApplication extends TComponent implements IApplication {
$component=Prado::createComponent($parameter[0]);
foreach($parameter[1] as $name=>$value)
- $component->setPropertyByPath($name,$value);
+ $component->setSubProperty($name,$value);
$this->_parameters->add($id,$component);
}
}
@@ -390,7 +390,7 @@ class TApplication extends TComponent implements IApplication throw new TConfigurationException('application_module_invalid',$id,self::$_moduleTypes[$id]);
$this->_modules[$id]=$module;
foreach($moduleConfig[1] as $name=>$value)
- $module->setPropertyByPath($name,$value);
+ $module->setSubProperty($name,$value);
$module->init($this,$moduleConfig[2]);
}
@@ -403,7 +403,7 @@ class TApplication extends TComponent implements IApplication throw new TConfigurationException('application_service_invalid',$serviceID);
$this->_service=$service;
foreach($serviceConfig[1] as $name=>$value)
- $service->setPropertyByPath($name,$value);
+ $service->setSubProperty($name,$value);
$service->init($this,$serviceConfig[2]);
$this->attachEventHandler('RunService',array($service,'run'));
}
diff --git a/framework/TComponent.php b/framework/TComponent.php index 36a06632..cdf83016 100644 --- a/framework/TComponent.php +++ b/framework/TComponent.php @@ -206,7 +206,7 @@ class TComponent * @param string property path
* @return mixed the property path value
*/
- public function getPropertyByPath($path)
+ public function getSubProperty($path)
{
$object=$this;
foreach(explode('.',$path) as $property)
@@ -222,14 +222,14 @@ class TComponent * @param string property path
* @param mixed the property path value
*/
- public function setPropertyByPath($path,$value)
+ public function setSubProperty($path,$value)
{
$object=$this;
if(($pos=strrpos($path,'.'))===false)
$property=$path;
else
{
- $object=$this->getPropertyByPath(substr($path,0,$pos));
+ $object=$this->getSubProperty(substr($path,0,$pos));
$property=substr($path,$pos+1);
}
$object->$property=$value;
@@ -344,7 +344,7 @@ class TComponent list($object,$method)=$handler;
if(($pos=strrpos($method,'.'))!==false)
{
- $object=$this->getPropertyByPath(substr($method,0,$pos));
+ $object=$this->getSubProperty(substr($method,0,$pos));
$method=substr($method,$pos+1);
}
$object->$method($sender,$param);
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 6a19273d..0ab1b7bf 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -148,7 +148,7 @@ class TPageService extends TComponent implements IService {
$component=Prado::createComponent($parameter[0]);
foreach($parameter[1] as $name=>$value)
- $component->setPropertyByPath($name,$value);
+ $component->setSubProperty($name,$value);
$parameters->add($id,$component);
}
}
@@ -159,7 +159,7 @@ class TPageService extends TComponent implements IService $module=Prado::createComponent($moduleConfig[0]);
$application->setModule($id,$module);
foreach($moduleConfig[1] as $name=>$value)
- $module->setPropertyByPath($name,$value);
+ $module->setSubProperty($name,$value);
$module->init($this->_application,$moduleConfig[2]);
}
diff --git a/framework/Web/TCacheManager.php b/framework/Web/TCacheManager.php deleted file mode 100644 index f1c9edd8..00000000 --- a/framework/Web/TCacheManager.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php
-/**
-<configuration>
- <modules>
- <module id="cache" Expiry="xxx" CacheStorage="file"
- Location="xxx"
- MemcacheServer="localhost" MemcachePort="1111" />
- <module id="security" MachineKey="xxx" .... />
- <module id="authenticator" ... />
- </modules>
- <services>
- <service id="page" Location="xxx">
- <module id="asset" UseService="false" Location="xxx" Url="xxx" />
- <module id="authorizer" />
- </service>
- </services>
-</configuration>
-
-<module id="cache" Storage="sqlite,memcache" UniquePrefix="xxx"
- SqliteFile="xxx" MemcacheServer="localhost" MemcachePort="1111"/>
-<module id="asset" UseService="true" Location="xxx" Url="xxx" />
-<module id="authenticator" LoginUrl="xxxx" />
-<module id="authorizer" /> // need to investigate the security of memory cache
- */
-
-/**
-<module id="cache" type="System.Modules.TMemCache" Server="localhost" Port="1FileName="xxx" UniquePrefix="" />
-*/
-
-/**
-<module id="cache" type="System.Modules.TSqliteCache" DbFile="xxx" />
-*/
-
-
-class TAuthencator extends TComponent
-{
-}
-
-class TAuthorizer extends TComponent
-{
-}
-
-$cm->generateUniqueID('button:',$id)
-$cm->saveValue('template:'.$tmpFile,$template);
-$cm->saveValue('application:ID',$appID);
-$cm->saveValue('application:hashkey',$key);
-
-class TTemplateManager extends TComponent implements IModule
-{
-}
-
-class TAssetManager extends TComponent implements IModule
-{
- private $_pubDir=null;
- private $_pubUrl=null;
-
- public function init($context)
- {
- if(is_null($this->_pubDir))
- throw new TCongiruationException('cache_public_location_required');
- if(is_null($this->_pubUrl))
- throw new TCongiruationException('cache_public_url_required');
- }
-
- public function getPublicLocation()
- {
- return $this->_pubDir;
- }
-
- public function setPublicLocation($value)
- {
- if(is_dir($value))
- $this->_pubDir=realpath($value);
- else
- throw new TInvalidDataValueException('cache_public_location_invalid');
- }
-
- public function getPublicUrl()
- {
- return $this->_pubUrl;
- }
-
- public function setPublicUrl($value)
- {
- $this->_pubUrl=rtrim($value,'/');
- }
-
- public function publishLocation($path,$forceOverwrite=false)
- {
- $name=basename($path);
- $prefix=md5(dirname($path));
- }
-
- public function publishFile($path,$forceOverwrite=false)
- {
- if(($fullpath=realpath($path))!==false)
- {
- return $this->_pubUrl.'/'.$fullpath;
- }
- else
- throw new TInvalidDataValueException('cachemanager_path_unpublishable');
- }
-
- public function unpublishPath($path)
- {
- }
-}
-
-class TMemcache extends TComponent
-{
-}
-
-class TSqliteCache extends TComponent
-{
-}
-?>
\ No newline at end of file diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index ed6e7dd0..a3d3c93a 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -613,7 +613,7 @@ class TControl extends TComponent if(isset($this->_rf[self::RF_DATA_BINDINGS]))
{
foreach($this->_rf[self::RF_DATA_BINDINGS] as $property=>$expression)
- $this->setPropertyByPath($property,$this->evaluateExpression($expression));
+ $this->setSubProperty($property,$this->evaluateExpression($expression));
if($raiseOnDataBinding)
$this->onDataBinding(null);
if(isset($this->_rf[self::RF_CONTROLS]))
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index bb8f2253..08fbd2fe 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -51,7 +51,7 @@ class TPage extends TTemplateControl if(is_array($initProperties))
{
foreach($initProperties as $name=>$value)
- $this->setPropertyByPath($name,$value);
+ $this->setSubProperty($name,$value);
}
parent::__construct();
}
diff --git a/framework/Web/UI/TTemplate.php b/framework/Web/UI/TTemplate.php index df9bf813..160a00f0 100644 --- a/framework/Web/UI/TTemplate.php +++ b/framework/Web/UI/TTemplate.php @@ -148,11 +148,11 @@ class TTemplate extends TComponent implements ITemplate else // complex property
{
if(is_string($value))
- $component->setPropertyByPath($name,$value);
+ $component->setSubProperty($name,$value);
else if($value[0]===0)
$component->bindProperty($name,$value[1]);
else
- $component->setPropertyByPath($component->evaluateExpression($value[1]));
+ $component->setSubProperty($component->evaluateExpression($value[1]));
}
}
$parent=isset($controls[$object[0]])?$controls[$object[0]]:$tplControl;
diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index 89bfe12f..7042281c 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -73,7 +73,7 @@ class TTemplateControl extends TControl implements INamingContainer if(($tpl=$this->getTemplate(true))!==null)
{
foreach($tpl->getDirective() as $name=>$value)
- $this->setPropertyByPath($name,$value);
+ $this->setSubProperty($name,$value);
}
}
diff --git a/framework/Web/UI/TTheme.php b/framework/Web/UI/TTheme.php index 1e3d8fab..3d4d4e5d 100644 --- a/framework/Web/UI/TTheme.php +++ b/framework/Web/UI/TTheme.php @@ -52,7 +52,7 @@ class TTheme extends TComponent {
foreach($this->_skins[$type][$id] as $name=>$value)
{
- $control->setPropertyByPath($name,$value);
+ $control->setSubProperty($name,$value);
}
}
else
|