Re: OT: Fase v0.8
I completely agree. Maybe that'll be next. http://groups.google.com/group/cake-php/browse_thread/thread/a237f83c62258839/aef88149701efbec --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
For the performance part of it. I think you could easily check if the js/css files md5 hash has changed and if not use a cached version. That way you wouldn't need to go through the dispatcher. However this only works if the same js/css include outputs the same js/css with no dynamic data beeing required. -- http://www.thinkingphp.org http://www.fg-webdesign.de [EMAIL PROTECTED] schrieb: I like the CSS deal. I have a dsitributed app and it gets tiring going in and making the same color change all the time. Plus, if it serves it without whitespaces that saves time and transfer so it might benefit even though it is going thru the dispatcher. My current CSS file is 245 lines and increasing. Also, another cool thing is that Cake could also provide a obfuscator with the _javascript_ that further "compacts" the JS code it is sending out. In the long run on larger scale applications with large JS and CSS files having them be PHPitized in CakePHP framework might not be a bad idea. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
I like the CSS deal. I have a dsitributed app and it gets tiring going in and making the same color change all the time. Plus, if it serves it without whitespaces that saves time and transfer so it might benefit even though it is going thru the dispatcher. My current CSS file is 245 lines and increasing. Also, another cool thing is that Cake could also provide a obfuscator with the javascript that further "compacts" the JS code it is sending out. In the long run on larger scale applications with large JS and CSS files having them be PHPitized in CakePHP framework might not be a bad idea. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
$this->log pasting ClassName::function() is a good idea --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
I guess it could help, but if you've used Fase for that reason only, the cost would probably be greater than the benefit. Fase is a framework in itself and I recommend trying it out. But it's not at all documented and the learning curve can be a bit steep for someone without a lot of experience with Cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
I might have :) At http://sputnik.pl/dev/labs/wd/ I've put up a small fragment of an application I am rather sure I'll forget about sooner than later, that uses a file-based cache for HTML. I've used .htaccess to make Apache check for the cached file without starting-up the PHP runtime: RewriteEngine On # Trailing slash fix RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+[^/])$ $1/ # Homepage RewriteRule ^$ data/index.html # URLs with parameters are never cached RewriteCond %{THE_REQUEST} \? [OR] RewriteCond %{REQUEST_FILENAME} !-s RewriteRule ^data/([^\?]*)(\?(.*))*$ data.php?__file=$1$3 [QSA,L] The rest of the code is rather uninteresting, but I can send you the source code if you wish so. The application runs on Ajax, yet it is rather snappy, despite the slow server it's installed on. Besides, great most of inefficiencies in web aps are either large-scale design problems or slow SQL queries. If I make one less bad decision while designing an app because I'm able to tailor my CSS and Javascript any way I want, the app will probably be just as fast as if the scripts and styles were static. And think of the possibilities. You could cope with browser inconsistencies at the server, automatically serving IE code to IE's and FF code to FF's. Instead of client-side conditionals: this.target =$(event.target || event.srcElement); you can do this on your server: : this.target = $(); I'd say that this makes code leaner and more compatibile. I for one am going for it :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
On my application, I have made a few links to the controller "categories" instead of doing "categories/index". Cake calls by default the index method, so I get the page I wanted. But the links to images in my css and js files are broken. I know I could handle this with routes but I like such default behavior. Would Fase be a good answer for this or am I again completely out-of-topic ? Olivvv Michal Tatarynowicz wrote: > If you want to, you can use Fase just for Javascript and CSS. Put > Fase's files in Cake's /app/webroot/fase and point the browser at it. > Assuming that your Cake app lives in www.site.com/foobar/ , this link: > > media="screen" /> > > ...is answered with parsed contents of > /foobar/fase/app/css/default.css, and this: > > > > ...gets parsed contents of /foobar/fase/app/js/default.js > > I strongly recommend keeping the default styles provided with Fase: > they include Yahoo's CSS Fonts which helps to keep font sizes > consistent between different browsers and CSS Reset which zeroes all > the different default paddings, margins and aligns. Also included is a > brilliant hack to clear floats without any additional markup and a fix > for IE's problems with paddings on and type="submit"> > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
If you want to, you can use Fase just for Javascript and CSS. Put Fase's files in Cake's /app/webroot/fase and point the browser at it. Assuming that your Cake app lives in www.site.com/foobar/ , this link: ...is answered with parsed contents of /foobar/fase/app/css/default.css, and this: ...gets parsed contents of /foobar/fase/app/js/default.js I strongly recommend keeping the default styles provided with Fase: they include Yahoo's CSS Fonts which helps to keep font sizes consistent between different browsers and CSS Reset which zeroes all the different default paddings, margins and aligns. Also included is a brilliant hack to clear floats without any additional markup and a fix for IE's problems with paddings on and --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
Yeah, that struck me as very clever also. The thing is, even with caching, running everything including static requests through the Dispatcher, as fast as it is, is still a little expensive. I'm thinking of trying a bootstrap-based proof-of-concept if no one beats me to it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
On 6/6/06, Michal Tatarynowicz <[EMAIL PROTECTED]> wrote: ...- All CSS and JS files are parsed with PHP by default. This not onlyallows for portable web apps, but also allows for include()'s in CSSand JS (which they sadly lack) and constants in CSS ( .Foo { color: #5870a2 } can become .Foo { color: COLOR_FUCHSIA } which is far morereadable and less error-prone). I think something like this would be excellent for cake. I was wishing I had something like this the other day when altering CSS files after copying a couple from one application to another. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: OT: Fase v0.8
For those of you who don't know, Michal Tatarynowicz (aka Pies) is the original author of CakePHP. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
OT: Fase v0.8
Fase is a minimalist VC (View+Controller, no Model as so far) framework . Roughly it does what Cake does (url passed do dispatcher, parsed into class+method+params, run and returned). It's quite simple -- 32 files in 8 directories, including a few CSS', 3 charset translation tables (Polish, but there's more where they came from), .htaccess (roughly the same as Cake's) and error pages. To start it up edit two entries in /app/config.php: FASE_DEFAULT_APP says which controller is taking care of the homepage, and FASE_DATABASE_CFG which describes the database connection (optional). There's a few ideas in it, that Cake could benefit from (if it doesn't already, I don't follow the development of Cake anymore). - All CSS and JS files are parsed with PHP by default. This not only allows for portable web apps, but also allows for include()'s in CSS and JS (which they sadly lack) and constants in CSS ( .Foo { color: #5870a2 } can become .Foo { color: COLOR_FUCHSIA } which is far more readable and less error-prone). Comments and unnecessary whitespace are automatically stripped in-flight (unless constant DEBUG is true)). I haven't used it yet on any sites with enough traffic to warrant a cache, but it wouldn't be very difficult to implement (or you can skip the thing and link to static files.) - The database is accessed using a abstract static class DB_Base extended with a database-specific DB_Mysql (as so far, there's only MySQL). The database connection resource is kept in a constant. While this prevents you from using more than one database connection for one HTTP request, the point here is that you don't have to pass the $DB variable around any more. Standard helper methods include - DB::insert('comments', $data) - DB::find_all('users', 'login,password', 'active == 1') - DB::delete('posts', 'id = 5') - There's a few introspection functions used mostly for debugging and logging (i.e. each error log entry contains a call stack), notably caller_file() which returns full path to the file from which the function that called it was called. Take, for example, the insert() function. You can use it to include views within views (including CSS and Javascript) in much the same way you use include() for standard PHP. But what makes it quite useful is that if the insert()ed file is not present, it tries with a relative by prepending the view file's path to the arguments it received. Additionally, it figures out the file extension from the callers'. In example, when from /app/css/default.css you call: ...by the lack of slash it figures out the path is relative, so it takes the caller's path (/app/css/default.css) and extracts the context (/app/css) and file extension (.css) from it. It then tries to load the file as usual. What's more, this makes it easier to provide: - Automatic multiple output types handling -- appropriate headers are sent, and appropriate views are parsed depending on what output format is expected. The default output type is HTML, but that's configurable (per-controller). When you call, say www.example.com/posts/list by default HTML from /app/posts/list.html (a PHP script) is returned (if it exists). But if you add a different file extension: www.example.com/posts/list.rss The latter call uses the same controller and method as the former, but renders /app/posts/list.rss (which in reality is also a PHP script) as its view. More so, insert()'s are output-type-agnostic, so an _insert('item')_ tries to insert a .html file if called from a .html file, and an .rss file with the same base name if called from a .rss. With proper application code (which is not really difficult to develop) providing an alternative output option is as easy as adding another view of the same data. - Debugging, logging and testing functions are in place and ready to be extended. Tests are to be kept together with the libraries they test, so that it's less painful to actually write any. - And more :) I wouldn't actually recommend anyone using it commercially (it's a beta), but if you're a developer who likes to experiment a bit, Fase provides a small-footprint, unrestricting framework for applications. Download from: http://sputnik.pl/dev/labs/fase/fase_0.8.zip Most of the files are licenced under the MIT licence, and files which don't specify a license are in Public Domain. Please let me know if you [use|like|hate] it. Michal Tatarynowicz aka Pies. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---