This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "quickfw".
The branch, master has been updated
via f447a56ecf5a9d5f13d98512771b6f74904d2f36 (commit)
via 6aa48d54cd8f07d6e79952c49aeed5caa890ac46 (commit)
via 1e079494db28d6403c6b8fdaed22e02026b4ab2f (commit)
from 25b39c23eeb4f1884e7adb119b7cac1f99ac2a9f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f447a56ecf5a9d5f13d98512771b6f74904d2f36
Author: Ivan1986 <iva...@li...>
Date: Tue Aug 31 17:26:54 2010 +0400
Выполнение php в js и scss
diff --git a/application/_common/css/.emptydir b/application/_common/css/.emptydir
new file mode 100644
index 0000000..2d80147
--- /dev/null
+++ b/application/_common/css/.emptydir
@@ -0,0 +1 @@
+css dir
\ No newline at end of file
diff --git a/application/_common/js/.emptydir b/application/_common/js/.emptydir
new file mode 100644
index 0000000..a103c49
--- /dev/null
+++ b/application/_common/js/.emptydir
@@ -0,0 +1 @@
+js dir
\ No newline at end of file
diff --git a/application/default/controllers/CssController.php b/application/default/controllers/CssController.php
index 9dbf2ca..d05eed9 100644
--- a/application/default/controllers/CssController.php
+++ b/application/default/controllers/CssController.php
@@ -1,6 +1,7 @@
<?php
/**
* Преобразование scss в css
+ * Выполнение php в css
*
* <br>Необходимо установить sass версии не ниже 3.0
*
@@ -9,7 +10,15 @@
class CssController
{
/** Путь к sass */
- const SASS = 'sass -C';
+ const SASS = 'sass --scss -C';
+ /** Путь к папке с scss - проецируется на DOC_ROOT/css */
+ private $path;
+
+ public function __construct()
+ {
+ //$this->path = DOC_ROOT.'/css';
+ $this->path = APPPATH.'/_common/css';
+ }
/**
* Генерирует несуществующую css по scss если он есть
@@ -22,14 +31,16 @@ class CssController
$args = func_get_args();
$css = implode('/', $args);
$scss = str_replace('.css', '.scss', $css);
- if (!is_file(DOC_ROOT.'/css/'.$scss))
+ if (!is_file($this->path.'/'.$scss))
QFW::$router->show404();
header('Content-Type: text/css');
$out = array();
$ret = false;
+ QFW::$view->setScriptPath($this->path);
+ $text = QFW::$view->fetch($scss);
//запускаем преобразования - по умолчанию без кеша и выводим ошибки в основной поток
- exec(self::SASS.' 2>&1 '.DOC_ROOT.'/css/'.$scss, $out, $ret);
+ exec('echo '.escapeshellarg($text).' | '.self::SASS.' 2>&1 ', $out, $ret);
$out = implode("\n", $out);
if ($ret)
@@ -48,13 +59,16 @@ class CssController
{
$out = array();
$ret = false;
- exec('find '.DOC_ROOT.'/css -name \'*.scss\'', $out, $ret);
+ chdir($this->path);
+ QFW::$view->setScriptPath($this->path);
+ exec('find . -name \'*.scss\'', $out, $ret);
if ($ret)
return;
foreach ($out as $file)
{
$css = str_replace('.scss', '.css', $file);
- exec(self::SASS.' 2>&1 '.$file.' | unexpand -t2 --first-only >'.$css, $out, $ret);
+ $text = QFW::$view->fetch($file);
+ exec('echo '.escapeshellarg($text).' | '.self::SASS.' 2>&1 | unexpand -t2 --first-only > '.DOC_ROOT.'/css/'.$css, $out, $ret);
}
}
@@ -65,12 +79,16 @@ class CssController
{
$out = array();
$ret = false;
- exec('find '.DOC_ROOT.'/css -name \'*.scss\'', $out, $ret);
+ chdir($this->path);
+ exec('find . -name \'*.scss\'', $out, $ret);
if ($ret)
return;
foreach ($out as $file)
{
- $css = str_replace('.scss', '.css', $file);
+ $css = str_replace(
+ array('.scss', './'),
+ array('.css', DOC_ROOT.'/css/'),
+ $file);
if (is_file($css))
unlink($css);
}
diff --git a/application/default/controllers/JsController.php b/application/default/controllers/JsController.php
new file mode 100644
index 0000000..4da4df7
--- /dev/null
+++ b/application/default/controllers/JsController.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Выполнение php в js
+ *
+ * @author ivan1986
+ */
+class JsController
+{
+ /** Путь к папке с js - проецируется на DOC_ROOT/js */
+ private $path;
+
+ public function __construct()
+ {
+ //$this->path = DOC_ROOT.'/js';
+ $this->path = APPPATH.'/_common/js';
+ }
+
+ /**
+ * Генерирует несуществующую js из php шаблона
+ *
+ * @return string сгенерированная js
+ */
+ public function indexAction()
+ {
+ QFW::$view->mainTemplate = '';
+ $args = func_get_args();
+ $js = implode('/', $args);
+ if (!is_file($this->path.'/'.$js))
+ QFW::$router->show404();
+
+ header('Content-Type: application/javascript');
+ $out = array();
+ $ret = false;
+ QFW::$view->setScriptPath($this->path);
+ $text = QFW::$view->fetch($js);
+
+ return $text;
+ }
+
+ /**
+ * Генерирует все файлы js
+ */
+ public function genCli()
+ {
+ $out = array();
+ $ret = false;
+ chdir($this->path);
+ QFW::$view->setScriptPath($this->path);
+ exec('find . -name \'*.js\'', $out, $ret);
+ if ($ret)
+ return;
+ foreach ($out as $file)
+ file_put_contents(DOC_ROOT.'/js/'.$file, QFW::$view->fetch($file));
+ }
+
+ /**
+ * Удаляет автоматически сгенерированные js
+ */
+ public function cleanCli()
+ {
+ $out = array();
+ $ret = false;
+ chdir($this->path);
+ exec('find . -name \'*.js\'', $out, $ret);
+ if ($ret)
+ return;
+ foreach ($out as $file)
+ {
+ $js = str_replace('./', DOC_ROOT.'/js/', $file);
+ if (is_file($js))
+ unlink($js);
+ }
+ }
+
+}
+
+?>
commit 6aa48d54cd8f07d6e79952c49aeed5caa890ac46
Author: Ivan1986 <iva...@li...>
Date: Tue Aug 31 16:58:18 2010 +0400
Ошибка в проксирующем шаблонизаторе - шаблонизатор по умолчанию
diff --git a/QFW/Templater/Proxy.php b/QFW/Templater/Proxy.php
index 27f9bca..d804b78 100644
--- a/QFW/Templater/Proxy.php
+++ b/QFW/Templater/Proxy.php
@@ -55,9 +55,8 @@ class Templater_Proxy extends Templater
public function fetch($name)
{
$key=substr($name,strrpos($name,'.')+1);
- if (!array_key_exists($key, QFW::$config['templater']['exts']))
- return '';
- $T = QFW::$config['templater']['exts'][$key];
+ $T = isset(QFW::$config['templater']['exts'][$key]) ?
+ QFW::$config['templater']['exts'][$key] : 'PlainView';
if (!array_key_exists($T,$this->templates))
{
commit 1e079494db28d6403c6b8fdaed22e02026b4ab2f
Author: Ivan1986 <iva...@li...>
Date: Mon Aug 30 18:14:08 2010 +0400
Обновление plainPHP подсветки
diff --git a/doc/plainPHP.xml b/doc/plainPHP.xml
index d8ae24d..1886186 100644
--- a/doc/plainPHP.xml
+++ b/doc/plainPHP.xml
@@ -5,7 +5,7 @@
<!ENTITY entref "&(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
-<language name="PlainPHP" version="1.98" kateversion="2.4" section="Scripts" extensions="*.qtp;*.html;*.phtm;" mimetype="text/x-php4-src;text/x-php3-src;application/x-php" author="Ivan Borzenkov (iva...@li...)" license="LGPL" priority="10">
+<language name="PlainPHP" version="1.99" kateversion="2.4" section="Scripts" extensions="*.qtp;*.html;*.phtm;" mimetype="text/x-php4-src;text/x-php3-src;application/x-php" author="Ivan Borzenkov (iva...@li...)" license="LGPL" priority="10">
<highlighting>
<contexts>
@@ -27,10 +27,16 @@
<RegExpr attribute="Element" context="El Open" String="<pre\b" insensitive="TRUE" beginRegion="pre" />
<RegExpr attribute="Element" context="El Open" String="<div\b" insensitive="TRUE" beginRegion="div" />
<RegExpr attribute="Element" context="El Open" String="<table\b" insensitive="TRUE" beginRegion="table" />
+ <RegExpr attribute="Element" context="El Open" String="<ul\b" insensitive="TRUE" beginRegion="ul" />
+ <RegExpr attribute="Element" context="El Open" String="<ol\b" insensitive="TRUE" beginRegion="ol" />
+ <RegExpr attribute="Element" context="El Open" String="<dl\b" insensitive="TRUE" beginRegion="dl" />
<RegExpr attribute="Element" context="El Open" String="<&name;" />
<RegExpr attribute="Element" context="El Close" String="</pre\b" insensitive="TRUE" endRegion="pre" />
<RegExpr attribute="Element" context="El Close" String="</div\b" insensitive="TRUE" endRegion="div" />
<RegExpr attribute="Element" context="El Close" String="</table\b" insensitive="TRUE" endRegion="table" />
+ <RegExpr attribute="Element" context="El Close" String="</ul\b" insensitive="TRUE" endRegion="ul" />
+ <RegExpr attribute="Element" context="El Close" String="</ol\b" insensitive="TRUE" endRegion="ol" />
+ <RegExpr attribute="Element" context="El Close" String="</dl\b" insensitive="TRUE" endRegion="dl" />
<RegExpr attribute="Element" context="El Close" String="</&name;" />
<!-- as long as kde gives DTDs the text/html mimetype--><IncludeRules context="FindDTDRules" />
<IncludeRules context="FindEntityRefs" />
@@ -212,7 +218,6 @@
<RegExpr attribute="Element" context="CSS content" String="<\?(?:=|php)?.*\$P-\>sCSS\(.*\).*\?>" insensitive="TRUE" beginRegion="script" lookAhead="true"/>
<RegExpr context="##PHP/PHP" String="<\?(?:=|php)?" lookAhead="true" />
</context>
-
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal" />
-----------------------------------------------------------------------
Summary of changes:
QFW/Templater/Proxy.php | 5 +-
{www => application/_common}/css/.emptydir | 0
application/_common/js/.emptydir | 1 +
application/default/controllers/CssController.php | 32 +++++++--
application/default/controllers/JsController.php | 77 +++++++++++++++++++++
doc/plainPHP.xml | 9 ++-
6 files changed, 112 insertions(+), 12 deletions(-)
copy {www => application/_common}/css/.emptydir (100%)
create mode 100644 application/_common/js/.emptydir
create mode 100644 application/default/controllers/JsController.php
hooks/post-receive
--
quickfw
|