summaryrefslogtreecommitdiff
path: root/framework/Web/TCacheManager.php
diff options
context:
space:
mode:
authorxue <>2005-11-10 12:47:19 +0000
committerxue <>2005-11-10 12:47:19 +0000
commit55c4ac1bfe565f1ca7f537fdd8b7a201be28e581 (patch)
treea0599d5e36fdbb3f1e169ae56bab7d529597e3eb /framework/Web/TCacheManager.php
Initial import of prado framework
Diffstat (limited to 'framework/Web/TCacheManager.php')
-rw-r--r--framework/Web/TCacheManager.php116
1 files changed, 116 insertions, 0 deletions
diff --git a/framework/Web/TCacheManager.php b/framework/Web/TCacheManager.php
new file mode 100644
index 00000000..f1c9edd8
--- /dev/null
+++ b/framework/Web/TCacheManager.php
@@ -0,0 +1,116 @@
+<?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