
Hi! There have been some quite interesting code changes in the repository lately.
Kulyamin "svk" Sergey fixed bugs in the PostgreSQL driver and added experimental support for the Linter database driver in limb/dbal package. Sergey also proposed interesting idea regarding SQL statement execution optimization and after a couple of days the patch was committed. And, finally, svk patched limb/mail package adding capability of images embedding into mail body.
Vasin "vasiatka" Alexey added convenient {{flashbox}} tag for {{macro}} template into limb/web_app package. Here are some possible usage examples:
{{flashbox}}
{{list ....}}
.....
{{/list}}
{{/flashbox}}
{{flashbox as='$flash'/}}
{{list using='$flash'....}}
.....
{{/list}}
I added a runtests.php script into repository which should simplify tests execution for Limb3 packages. The key idea is to allow running tests right after the code checkout, something as follows:
$ svn co https://svn.limb-project.com/3.x/trunk/limb limb
$ cd limb
$ php runtests.php #run tests for all packages
$ php runtests.php core macro cache #run tests only for specific packages
In order to make all this possible package tests should be as independent as possible. Fortunately, limb/tests_runner allows to achieve this using proper .setup.php and .skipif.php scripts. The work in this direction is still in the process.
Stanislav "korchasa" Korchagin added {{tree:empty}} tag(analogue of {{list:empty}}) and expanded lmbHttpResponse functionality for more fine grained cookie control in limb/macro and limb/net packages respectively.
And last, but not least, Sergey "syfisher" Yudin fixed lmbSet in limb/core package for edge cases when working with arrays containing "false" values.
Good job, guys, keep your patches coming ;)
Projects section previously located at http://projects.limb-project.com was moved into Code Bits which is located at http://bits.limb-project.com. The new name reflects the idea behind this section in a better way and the url is more concise and less verbose to type. BC is preserved, of course, the old section redirects to the new one.
Sergey Yudin(syfisher) did really great job by making {{macro}} template engine examples available on-line.
The mentioned page has runnable examples for mostly all core {{macro}} tags. You can browse the template rendering result page, template sources and PHP code which actually works behind the scene.
You can also download the source code of these examples from projects page(where, by the way, you can find some other real life Limb3 usage samples).
We are going to update examples on the regular basis presenting other interesting {{macro}} usage patterns in the future, so, if you are interested, stay tuned.
Sergey Yudin(syfisher) has added an experimental support for eager fetching in limb/active_record package. Simply put, eager fetching technique greedily grabs as much as possible useful information into memory from database(which is opposed to lazy loading, the default limb/active_record behaviour). This allows to dramatically reduce the amount of additional SQL queries in some cases when lots of interconnected objects are fetched.
For example, in the code below for each Lecture object there will be an additional SQL query selecting its Course object(one-to-many relation)
$lectures = lmbActiveRecord :: find('Lecture');
foreach($lectures as $lecture)
echo 'Lecture '$lecture->getTitle() . ' of ' . $lecture->getCourse()->getTitle() . " course.\n";
Thus, if we have 5 Lecture objects having different Courses, there will be 1+5 queries total.
The code above can be rewritten using eager fetching:
$lectures = lmbActiveRecord :: find('Lecture', array('join' => 'course'));
foreach($lectures as $lecture)
echo 'Lecture '$lecture->getTitle() . ' of ' . $lecture->getCourse()->getTitle() . " course.\n";
Now there will be only one SQL query fetching all Lecture and connected Course objects using LEFT JOIN construct
limb/active_record currently supports two types of eager fetching: joining(used in the example above) and attaching.
Eager joining can be only used for has_one, belongs_to and many_belongs_to relations. This limitation is due to the fact this type of eager fetching uses LEFT JOIN infrastructure. Nested eager joins are supported as well:
$lectures = lmbActiveRecord :: find('Lecture', array('join' => array('course' => array('join' => 'program'))));
There will be only one query made in this case:
SELECT lecture.id AS id, lecture.title AS title, lecture.course_id AS course_id,
course.id AS course__id, course.title AS course__title, course.program_id AS course__program_id,
course__program.id AS course__program__id, course__program.title AS course__program__title
FROM lecture
LEFT JOIN course AS course ON lecture.course_id = course.id
LEFT JOIN program AS course__program ON course.program_id = program__course.id
Eager attaching is a more general and a bit more slower operation than eager joining. Eager attaching makes an additional query for each relation(not object!) limiting the amount of fetched data with WHERE .. IN(..) SQL construct. This type of eager fetching is compatible with any type of relation. Nested attaching is supported as well:
$programs = lmbActiveRecord :: find('Program', array('attach' => array('courses' => array('attach' => 'lectures'))));
There will be 3 queries done in this case:
SELECT program.id AS id, program.title AS title FROM program;
SELECT course.id AS id, course.title AS title, course.program_id AS program_id
FROM course WHERE program_id IN (...) ORDER BY program_id ASC;
SELECT lecture.id AS id, lecture.title AS title, lecture.course_id AS course_id
FROM lecture WHERE course_id IN (...) ORDER BY course_id ASC;
While there are some wrinkles yet to be ironed out(for example, proper Postgres support), eager fetching support has been already successfully tried on a couple of projects.
Want to be on the bleeding edge too? Go for it - try the SVN version of limb/active_record package!
We have unified {{include}} and {{wrap}} tags for the {{macro}} templating engine and now it's possible to use only one tag for both of these operations. Meet the new experimental tag {{insert}}!
Here's the sample usage:
Hello, {{insert file="foo.html"/}}
foo.html
Bob
Hello, Bob
Hello, {{insert file="$file"/}}
foo.html
Bob
Hello, Bob
{{insert into="slot1" file="foo.html"}}Bob{{/insert}}
Hello, {{slot id="slot1"/}}
Hello, Bob
{{insert into="slot1" file="$file"}}Bob{{/insert}}
Hello, {{slot id="slot1"/}}
Hello, Bob
{{insert file="foo.html"}}
{{insert:into slot="slot1"}}Bob{{/insert:into}}
{{insert:into slot="slot2"}}Thorton{{/insert:into}}
{{/insert}}
Hello, {{slot id="slot2"/}} {{slot id="slot1"/}}
Hello, Thorton Bob
If you are interested, go ahead and try the latest changes in {{macro}} SVN repository.
P.S. By the way, {{include}} and {{wrap}} tags don't really exist anymore, they are just aliases for the {{insert}} tag.
Happy New Year and Merry Christmas!
It has become a good tradition of the Limb core team to release new packages of Limb3 framework right before the new year, well, this time is not an exception ;)
We are really proud to announce the immediate availability of the Limb3 2007.4(Frozzy) release!
Here's the list of the most notable changes:
This is rather a general changelog, see packages for more details.
The bundled release of all packages is available in the SourceForge downloads section of Limb3-2007.4
I'd like to thank syfisher, william, alex433, korchasa, CM-Z, svk, 3d-max, To LST ld й for their numerous contributions. This release wouldn't have been possible without you guys!
Cheers!
We are glad to announce the new release of the TESTS_RUNNER package which ships with limb_unit - a SimpleTest tests "swiss army knife" console based runner.
The CHANGELOG for this release is as follows:
This release introduces some unique features which can be quite useful for large sets of tests. They are test class annotation groups selectors and test methods filtering.
Annotation groups selector allows you to execute only those test cases which have some specific @group annotation tags. For example, running the following command:
$ limb_unit -G db,auth test1.php test2.php...will yield executing only those test cases from test1.php and test2.php files which have @group annotation tag matching "db,auth" filter, e.g:
/**
* group db
*/
class MyTest1 extends UnitTestCase
...
/**
* group auth,db
*/
class MyTest2 extends UnitTestCase
...
Test methods filtering allows to run only those test methods which match the passed filter. For example, the following command:
$ limb_unit -M testFoo,testBar test.php..will execute only testFoo and testBar methods omitting the rest ones found in all test cases in test.php file.
TESTS_RUNNER package can be installed via Limb pear channel using the shell commands below:
# pear channel-discover pear.limb-project.comUpdate: Just a couple of days after this post TESTS_RUNNER-0.8.7(beta) was released. It features new test class filter that allows you to run only those test classes that match this filter, e.g:
# pear install limb/tests_runner-beta
$ limb_unit -T FooTest,BarTest alltests.php
Hi!
We have introduced new site section - projects.limb-project.com.
This new section will contain not just examples but Limb3 based applications and tools as well. All previous examples from examples.limb-project.com were moved here too.
The first candidates listed in this new section are Syncman, Buildman applications and limb_unit testing utility. And we believe there will be more Limb3 based projects coming quite soon.
Old examples section is now considered to be obsolete, however it will be accessible for a while.
Hi, folks!
We have made two Limb3 based applications Syncman and Buildman available to the public.
Syncman is an application which simplifies projects remote deployment and synchronization by providing both nice web UI(great for managers and other non-technical personnel) and basic shell interface.
Features:
Buildman is a simple tool which helps to easily establish a Continuous Integration process for your applications.
Features:
Both applications are in alpha state and there are no file releases yet. You can download the source code for both applications only via svn. However we have been using these applications for quite some time and they proved to be quite useful and stable.
If you have any interest in contributing to any of these projects we'll gladly accept any help, suggestions, patches, etc.
Limb3 Skeleton, CRUD and Shop applications are now released on SourceForge as separate packages. Check out Limb3 SourceForge file releases section!
In a nutshell, these applications are:
CRUD and Shop applications have been available in the examples section for quite some time while the Skeleton application is released for the very first time.
After 4 moths of hard working we're proud to announce the availability of the Limb3 2007.3 bundle release!
The main features of this release are:
Please note, this is a general changelog, if you need more detailed changes consider viewing changelog files for each package.
Download this release from SourceForge Limb3 releases section.
Folks, we have released TESTS_RUNNER-0.8.3 Limb3 package which aims to simplify running your SimpleTest based tests. This package provides limb_unit utility which is an advanced SimpleTest tests runner.
limb_unit is similar in some ways to phpunit utility from PHPUnit library, yet more powerful we believe.
The main features of limb_unit are:
limb_unit is shipped with Limb3 TESTS_RUNNER package and can be installed via PEAR channel. Here's an example of quick installation:
# pear channel-discover pear.limb-project.com
# pear install limb/tests_runner-beta
Some quick usage examples for the impatient:
#running all test cases defined in my_test.php
$ limb_unit my_test.php
#running all test cases contained in *_test.php files
$ limb_unit *_test.php
#running recursively all tests from tests directory
$ limb_unit tests
#running all tests from any directories called tests
$ find -name tests -type d | xargs -i limb_unit "{}"
#run tests and show tests coverage for source code in src directory
$ limb_unit -C src tests
Actually limb_unit can do a lot more than that ;) If you feel interested here's a more detailed documentation.
We're proud to announce the new site section - Examples!
This site section will contain miscellaneous Limb based examples ranging from simple code snippets to pretty complicated applications. All examples will be available for download(currently directly from repository) and for on-line browsing.
Currently the following examples are present:
Enjoy!
We have completely reimplemented our nightly builds server and now it's almost a full fledged Continuous Integration server. 'Almost' because some important features are still missing: RSS build feeds, mail notification, to name a few. However this is a much better and more flexible solution than it used to be.
This is how it works in a nutshell. Every night all packages are checked out from the repository and unit tested with each package's tests. If all tests for the certain package pass the build is marked successful(green) otherwise failed(red).
Either way, successful or not, each build is assigned some unique identifier, archived and published into web accessible directory. Up to 3 last package builds are stored and you can browse each build's CHANGE.LOG and BUILD.LOG files to see latest changes and complete log of system messages including errors.
We also plan to make 'on-demand' building of packages in the nearest future. This will be done via Subversion on-commit hook triggering the build process for the certain packages.
New Continuous Integration server is based on the buildman project built with Limb3. Once a bit more tested in production the buildman's source code will be available to the public.
Welcome to the redesigned version of limb-project.com which is based on Limb3 framework!
The new version of limb-project.com will be placed into Limb repository as an example Limb3 based project in a couple of days.
The old version of the site will be available for some time at old.limb-project.com.
You have probably noted that wiki and forum have been moved into sub-domains: wiki.limb-project.com and forum.limb-project.com respectively. This should allow us to spread the load among different servers in the future.
Old forum and wiki links should work just fine via Apache mod_rewrite module, so we hope you won't have any broken links issues.It's 2007! Fill your heart with new hopes, reach out for new opportunities and celebrate the New Year! Cheers!
The previous 2006 year was really full of exciting events for the core dev.team:
Firstly we finally managed to launch the Limb3 PEAR channel. We have high hopes for Limb3 and all our future efforts will be mainly focused on further development and improvement of Limb3 packages. We're pushing the PHP's limits with Limb3 and prove that PHP still can be a powerfull RAD tool despite to much PHP criticizing lately.
Secondly we released Limb2.4-rc1 stable release(well, almost stable since it's a release candidate) after more than one year of silence in this branch. We hope to release Limb2.4 final pretty soon and even though many developers still find Limb2 attractive we'd like to admit that there won't be much development in this branch in the future. The code base of Limb2 is pretty outdated and sometimes ugly, that's why we want to convert Limb2 into Limb3 package as soon as possible.After almost a year of hard working we're proud to announce the launch of PEAR channel for Limb3 packages! These packages should greatly simplify the process of developing web applications with PHP. One of the most interesting packages among them is web_app which allows you to develop web applications in Rails alike way using similar controllers, pretty flexible ActiveRecord powered model and excellent WACT based views.
These are the steps you're required to follow in order to install web_app package and all its dependencies:
# as of this writing PEAR 1.5 is required which is in alpha state
$ pear install PEAR-alpha
$ pear channel-discover pear.limb-project.com
# we're in alpha state too
$ pear install limb/web_app-alpha
The channel has a bit terse look right now however this is going to be fixed pretty soon. We're also working on providing automatic nightly builds of packages right from the repository.
The english documentation is mostly outdated but we're working on this issue as well(we're finishing the Russian documentation at the moment). However there are some simple examples in web_app package which, hopefully, should help you get started quickly.
We'd like to thank all core Limb developers for their great work and dedication to the project. It would never have happened without you guys!
Let it be a new year present to all PHP agile geeks ;)