Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: BBFMedia/DCore
base: 37d65d6c54
...
head fork: BBFMedia/DCore
compare: a9d9fa03c1
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 30, 2012
@adrianj98 adrianj98 updates to framework
Signed-off-by: Adrian Jones <adrianj1998@hotmail.com>
c4fa121
@adrianj98 adrianj98 add request mod
Signed-off-by: Adrian Jones <adrianj1998@hotmail.com>
a9d9fa0
View
1  .gitignore
@@ -0,0 +1 @@
+/nbproject/private/
View
2  DCore.php
@@ -15,7 +15,7 @@
* @package DCore
*/
class DCore {
-
+
/**
* Hard security check
*
View
2  README.md
@@ -8,7 +8,7 @@ would not hurt. Plus would force for better code standards and documentation.
Second motive is to create a XHP UI framework. The XHP framework would site on top
of DCore and reply on it. DCore would not depend on the XHP framework.
-Can try the [tutorials](docs/tutorials.md)
+Can try the [tutorials](http://dcode.bbfmedia.com/docs/tutorials.md)
Status
View
39 core/i18.class.php
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of i18
+ *
+ * @author adrian
+ */
+if (!defined('_DEFAULT_LANGUAGE_'))
+ define('_DEFAULT_LANGUAGE_','eng');
+
+class i18 {
+
+ static $language_id = _DEFAULT_LANGUAGE_;
+
+ function setLanguage($lang)
+ {
+ if (!empty($lang))
+ self::$language_id = $lang;
+ }
+ function getLanguage()
+ {
+ return self::$language_id ;
+ }
+ function loadLanguageFile($filename = '')
+ {
+ if (empty($filename))
+ $filename = self::getLanguage();
+ $filename = 'protected:settings/lang/'.self::getLanguage().'/'.$filename;
+if (DCore::getFilePath($filename,'','','.php',false))
+ DCore::using($filename);
+ }
+}
+
+?>
View
2  core/registry.class.php
@@ -46,7 +46,9 @@ public function __set($index, $value) {
*
*/
public function __get($index) {
+ if (isset($this->vars[$index]))
return $this->vars[$index];
+ return null;
}
/**
View
41 core/request.class.php
@@ -0,0 +1,41 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of request
+ *
+ * @author adrian
+ */
+class request {
+
+ protected $GET = array();
+
+ protected $POST = array();
+ public function __get($index) {
+ if (isset($this->GET[$index]))
+ return $this->GET[$index];
+ if (isset($this->POST[$index]))
+ return $this->POST[$index];
+ return null;
+ }
+
+ public function setPOST($index, $value) {
+ $this->POST[$index] = $value;
+ }
+ public function setGET($index, $value) {
+ $this->GET[$index] = $value;
+ }
+ function addPOST($post)
+ {
+ $this->POST = $post;
+ }
+
+
+
+}
+
+
View
5 core/router.class.php
@@ -236,15 +236,20 @@ private function getController() {
}
}
$index = 2;
+ if (!$this->registry->request)
+ $this->registry->request = new request();
+ $this->registry->request->addPOST($_POST);
// check if template is even loaded
// a pure xhp app may not need to load it
if ($this->registry->template) {
while (count($parts) > $index + 1) {
$cc = ('get_' . $parts[$index]);
+ $this->registry->request->setGET($parts[$index],$parts[$index + 1]);
$this->registry->template->$cc = $parts[$index + 1];
$index += 2;
}
}
+
if (empty($this->controller)) {
$this->controller = 'index';
}
View
4 core/template.class.php
@@ -100,7 +100,9 @@
*
*/
public function __get($index) {
+ if (isset($this->vars[$index]))
return $this->vars[$index];
+ return null;
}
public function __set($index, $value) {
@@ -108,6 +110,8 @@ public function __set($index, $value) {
}
function __construct($registry, $options = null) {
+
+ $this->vars = array();
parent::__construct($registry, $options);
if (isset($options['useXHP']))
$this->useXHP = $options['useXHP'];

No commit comments for this range

Something went wrong with that request. Please try again.