[limb-svn] r5525 - in 3.x/trunk/limb/web_app: cli skel skel/src skel/tests skel/tests/cases skel/tests/settings skel/www

svn at limb-project.com svn at limb-project.com
Wed Apr 4 12:03:51 MSD 2007


Author: pachanga
Date: 2007-04-04 12:03:50 +0400 (Wed, 04 Apr 2007)
New Revision: 5525
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5525

Added:
   3.x/trunk/limb/web_app/skel/cli/
   3.x/trunk/limb/web_app/skel/init/
   3.x/trunk/limb/web_app/skel/lib/
   3.x/trunk/limb/web_app/skel/setup.override.php.tpl
   3.x/trunk/limb/web_app/skel/src/LimbApplication.class.php
   3.x/trunk/limb/web_app/skel/tests/
   3.x/trunk/limb/web_app/skel/tests/cases/
   3.x/trunk/limb/web_app/skel/tests/cases/.init.php
   3.x/trunk/limb/web_app/skel/tests/settings/
   3.x/trunk/limb/web_app/skel/tests/settings/db.conf.php
   3.x/trunk/limb/web_app/skel/tests/settings/wact.conf.php
Removed:
   3.x/trunk/limb/web_app/skel/.htaccess
   3.x/trunk/limb/web_app/skel/setup.override.php-example
Modified:
   3.x/trunk/limb/web_app/cli/WebAppCliCmd.class.php
   3.x/trunk/limb/web_app/skel/setup.php
   3.x/trunk/limb/web_app/skel/www/index.php
Log:
-- making skel more convenient to use:
  * adding setup.override.php.tpl
  * adding LimbApplication
  * tests directory structure

Modified: 3.x/trunk/limb/web_app/cli/WebAppCliCmd.class.php
===================================================================
--- 3.x/trunk/limb/web_app/cli/WebAppCliCmd.class.php	2007-04-03 15:40:26 UTC (rev 5524)
+++ 3.x/trunk/limb/web_app/cli/WebAppCliCmd.class.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -35,8 +35,15 @@
       return 1;
     }
 
-    echo "Copying skeleton application to '$dst_dir'...";
+    echo "Copying skeleton Limb3 WEB_APP application to '$dst_dir'...\n";
+
     lmbFs :: cp(dirname(__FILE__) . '/../skel', $dst_dir, '~^\.svn~');
+
+    echo "Generating code from templates...\n";
+
+    $this->_resolveTemplate("$dst_dir/setup.override.php.tpl",
+                            array('%LIMB_PARENT_DIR%' => realpath(dirname(__FILE__) . '/../../../')));
+
     echo "done!";
   }
 
@@ -51,6 +58,13 @@
 EOD;
     echo $txt;
   }
+
+  protected function _resolveTemplate($template, $vars = array())
+  {
+    $file = substr($template, 0, strrpos($template, '.'));
+    file_put_contents($file, strtr(file_get_contents($template), $vars));
+    unlink($template);
+  }
 }
 
 ?>
\ No newline at end of file

Deleted: 3.x/trunk/limb/web_app/skel/.htaccess
===================================================================
--- 3.x/trunk/limb/web_app/skel/.htaccess	2007-04-03 15:40:26 UTC (rev 5524)
+++ 3.x/trunk/limb/web_app/skel/.htaccess	2007-04-04 08:03:50 UTC (rev 5525)
@@ -1 +0,0 @@
-Deny from all

Deleted: 3.x/trunk/limb/web_app/skel/setup.override.php-example
===================================================================
--- 3.x/trunk/limb/web_app/skel/setup.override.php-example	2007-04-03 15:40:26 UTC (rev 5524)
+++ 3.x/trunk/limb/web_app/skel/setup.override.php-example	2007-04-04 08:03:50 UTC (rev 5525)
@@ -1,10 +0,0 @@
-<?php
-set_time_limit(0);
-restore_include_path();
-set_include_path(dirname(__FILE__) . '/' . PATH_SEPARATOR .
-                 'd:/var/dev/limb/3.x/' . PATH_SEPARATOR .
-                 get_include_path());
-
- at define('LIMB_CACHE_DB_META_IN_FILE', false);
-
-?>
\ No newline at end of file

Added: 3.x/trunk/limb/web_app/skel/setup.override.php.tpl
===================================================================
--- 3.x/trunk/limb/web_app/skel/setup.override.php.tpl	                        (rev 0)
+++ 3.x/trunk/limb/web_app/skel/setup.override.php.tpl	2007-04-04 08:03:50 UTC (rev 5525)
@@ -0,0 +1,6 @@
+<?php
+set_include_path(dirname(__FILE__) . '/' . PATH_SEPARATOR .
+                 '%LIMB_PARENT_DIR%' . PATH_SEPARATOR);
+
+ at define('LIMB_CACHE_DB_META_IN_FILE', false);
+?>
\ No newline at end of file

Modified: 3.x/trunk/limb/web_app/skel/setup.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/setup.php	2007-04-03 15:40:26 UTC (rev 5524)
+++ 3.x/trunk/limb/web_app/skel/setup.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -9,11 +9,13 @@
  * @version    $Id$
  * @package    web_app
  */
+
+set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
+                 dirname(__FILE__) . '/lib/' . PATH_SEPARATOR);
+
 if(file_exists(dirname(__FILE__) . '/setup.override.php'))
   require_once(dirname(__FILE__) . '/setup.override.php');
 
-set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
-
 @define('LIMB_VAR_DIR', dirname(__FILE__) . '/var/');
 
 require_once('limb/core/common.inc.php');

Added: 3.x/trunk/limb/web_app/skel/src/LimbApplication.class.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/src/LimbApplication.class.php	                        (rev 0)
+++ 3.x/trunk/limb/web_app/skel/src/LimbApplication.class.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -0,0 +1,12 @@
+<?php
+lmb_require('limb/web_app/src/lmbWebApplication.class.php');
+
+class LimbApplication extends lmbWebApplication
+{
+  /*function __construct()
+  {
+    //register your own custom filter chain here
+  }
+  */
+}
+?>
\ No newline at end of file

Added: 3.x/trunk/limb/web_app/skel/tests/cases/.init.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/tests/cases/.init.php	                        (rev 0)
+++ 3.x/trunk/limb/web_app/skel/tests/cases/.init.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -0,0 +1,9 @@
+<?php
+
+ at define('LIMB_CONF_INCLUDE_PATH', 'tests/settings;settings');
+ at define('LIMB_CACHE_DB_META_IN_FILE', false);
+ at define('LIMB_VAR_DIR', dirname(__FILE__) . '/../var/');
+
+require_once(dirname(__FILE__) . '/../../setup.php');
+
+?>
\ No newline at end of file

Added: 3.x/trunk/limb/web_app/skel/tests/settings/db.conf.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/tests/settings/db.conf.php	                        (rev 0)
+++ 3.x/trunk/limb/web_app/skel/tests/settings/db.conf.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -0,0 +1,5 @@
+<?php
+
+$conf = array('dsn' => 'mysql://root:secret@localhost/limb_application_tests?charset=utf8');
+
+?>
\ No newline at end of file

Added: 3.x/trunk/limb/web_app/skel/tests/settings/wact.conf.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/tests/settings/wact.conf.php	                        (rev 0)
+++ 3.x/trunk/limb/web_app/skel/tests/settings/wact.conf.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -0,0 +1,8 @@
+<?php
+$conf = array(
+'forcescan' => false,  #Force to scan directories for tags, filters and properties (very slow)
+'forcecompile' => true #Force every template to be re-compiled on every request. Option is used
+                       #for debugging templates when developing template generation code
+
+);
+?>

Modified: 3.x/trunk/limb/web_app/skel/www/index.php
===================================================================
--- 3.x/trunk/limb/web_app/skel/www/index.php	2007-04-03 15:40:26 UTC (rev 5524)
+++ 3.x/trunk/limb/web_app/skel/www/index.php	2007-04-04 08:03:50 UTC (rev 5525)
@@ -1,19 +1,19 @@
 <?php
-/**
- * Limb Web Application Framework
- *
- * @link http://limb-project.com
- *
- * @copyright  Copyright &copy; 2004-2007 BIT
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html
- * @version    $Id$
- * @package    web_app
+/**
+ * Limb Web Application Framework
+ *
+ * @link http://limb-project.com
+ *
+ * @copyright  Copyright &copy; 2004-2007 BIT
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ * @version    $Id$
+ * @package    web_app
  */
 
 require_once(dirname(__FILE__) . '/../setup.php');
-require_once('limb/web_app/src/lmbWebApplication.class.php');
+require_once('src/LimbApplication.class.php');
 
-$application = new lmbWebApplication();
+$application = new LimbApplication();
 $application->process();
 
 ?>



More information about the limb-svn mailing list