<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cakebaker &#187; task</title>
	<atom:link href="http://cakebaker.42dh.com/tags/task/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 20 Dec 2011 15:29:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Shells and Tasks</title>
		<link>http://cakebaker.42dh.com/2007/05/16/shells-and-tasks/</link>
		<comments>http://cakebaker.42dh.com/2007/05/16/shells-and-tasks/#comments</comments>
		<pubDate>Wed, 16 May 2007 05:23:15 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/05/16/shells-and-tasks/</guid>
		<description><![CDATA[Last week I wrote about the new command line features of CakePHP 1.2. And this week it is already outdated what I wrote then ;-) The command line scripts are now called &#8220;Shells&#8221; instead of &#8220;CakeScripts&#8221;, so I adapted the previous article to those changes. With the recent changes a new concept has been introduced: [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I wrote about the new command line features of CakePHP 1.2. And this week it is already outdated what I wrote then ;-) The command line scripts are now called &#8220;Shells&#8221; instead of &#8220;CakeScripts&#8221;, so I adapted the <a href="http://cakebaker.42dh.com/2007/05/07/writing-a-custom-cakephp-console-script/">previous article</a> to those changes.</p>
<p>With the recent changes a new concept has been introduced: Tasks. Well, tasks are not entirely new as tasks were already used by bake2 (which no longer exists). But now tasks are for shells what components are for controllers. </p>
<p>Tasks are placed in app/vendors/shells/tasks if they are application-specific resp. in vendors/shells/tasks if they are general-purpose tasks. Like shell scripts, task classes have to extend the &#8220;Shell&#8221; class, but the class name has to end with &#8220;Task&#8221;. Here a simple example of a task:</p>
<pre>
// vendors/shells/tasks/test.php
class TestTask extends Shell {

    function execute() {
        // do something
    }
}
</pre>
<p>In the core tasks (and in this test task) the main function is called &#8220;execute&#8221;, but you are free to use any name you want. </p>
<p>The test task can now be used in the shell script in the following way:</p>
<pre>
// vendors/shells/demo.php
class DemoShell extends Shell {
    var $tasks = array('Test');

    function initialize() {
        // empty
    }

    function main() {
        $this-&gt;Test-&gt;execute();
    }
}
</pre>
<p>Happy baking :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/05/16/shells-and-tasks/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Testing the core &amp; two new releases</title>
		<link>http://cakebaker.42dh.com/2007/02/05/testing-the-core-two-new-releases/</link>
		<comments>http://cakebaker.42dh.com/2007/02/05/testing-the-core-two-new-releases/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 08:56:32 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/02/05/testing-the-core-two-new-releases/</guid>
		<description><![CDATA[Today, two new versions of CakePHP have been released: 1.1.13.4450 and 1.2.0.4451alpha. The first one is a bug fix release, the second is a new development release. Read the announcement and/or get the new versions from CakeForge. The 1.2 release now comes with some test cases. You find instructions about how to run them in [...]]]></description>
			<content:encoded><![CDATA[<p>Today, two new versions of CakePHP have been released: 1.1.13.4450 and 1.2.0.4451alpha. The first one is a bug fix release, the second is a new development release. Read the <a href="http://bakery.cakephp.org/articles/view/232">announcement</a> and/or get the new versions from <a href="http://cakeforge.org/projects/cakephp/">CakeForge</a>.</p>
<p>The 1.2 release now comes with some test cases. You find instructions about how to run them in the announcement. As I prefer to run the tests via command line, I wrote a simple bake task to execute those core tests. You can find it in the <a href="http://cakebaker.42dh.com/downloads">downloads section</a>. Its usage is:</p>
<pre>
php bake2.php coretest  // runs all tests
php bake2.php coretest libs/view  // runs all tests in the folder cake/tests/cases/libs/view and its subfolders
php bake2.php coretest group no_database  // runs the specified group test
</pre>
<p>At the moment it is recommended to run the group test &#8220;no_database&#8221;, because the tests for AclNode and DboSource will fail (they are not included in that group test).</p>
<p>Happy baking :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2007/02/05/testing-the-core-two-new-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A first glimpse at two core bake tasks</title>
		<link>http://cakebaker.42dh.com/2006/10/27/a-first-glimpse-at-two-core-bake-tasks/</link>
		<comments>http://cakebaker.42dh.com/2006/10/27/a-first-glimpse-at-two-core-bake-tasks/#comments</comments>
		<pubDate>Fri, 27 Oct 2006 09:19:44 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[bake]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2006/10/27/a-first-glimpse-at-two-core-bake-tasks/</guid>
		<description><![CDATA[Felix already wrote about the new bake2.php script. This script is rather simple, it simply executes tasks, i.e. classes with a certain interface. At the moment, there exist two such tasks in the branch of CakePHP 1.2: AppTask and DbconfigTask. Let&#8217;s have a look at them, even though they are not finished yet. The AppTask [...]]]></description>
			<content:encoded><![CDATA[<p>Felix already <a href="http://www.thinkingphp.org/2006/10/16/command-line-fun-in-cakephp-12/">wrote</a> about the new bake2.php script. This script is rather simple, it simply executes tasks, i.e. classes with a certain interface. At the moment, there exist two such tasks in the branch of CakePHP 1.2: AppTask and DbconfigTask. Let&#8217;s have a look at them, even though they are not finished yet.</p>
<p>The AppTask creates the application skeleton. The usage is:</p>
<pre>
php bake2.php app alias /path_to_app_dir
</pre>
<p>It does almost the same as:</p>
<pre>
php bake.php -project /path_to_app_dir
</pre>
<p>The differences are:</p>
<ul>
<li>bake2 doesn&#8217;t ask you any questions</li>
<li>you can define an application alias</li>
</ul>
<p>The idea of the application alias is to make it easier to work with multiple applications. So you can use just the alias to refer to a specific application. The alias/application mapping is stored in apps.ini, in the root folder of your cake installation. </p>
<p>After the AppTask you will usually execute the DbconfigTask to create the database configuration. This task allows a lot of parameters, but most of them are optional. Here is its usage:</p>
<pre>
php bake2.php dbconfig alias database username [password] [-c=config name] [-d=database driver]
                                               [-persistent] [-h=host[:port]] [-p=prefix]
</pre>
<p>That&#8217;s it. Feedback and bug reports are welcome :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/10/27/a-first-glimpse-at-two-core-bake-tasks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A simple task to generate sql scripts</title>
		<link>http://cakebaker.42dh.com/2006/10/25/a-simple-task-to-generate-sql-scripts/</link>
		<comments>http://cakebaker.42dh.com/2006/10/25/a-simple-task-to-generate-sql-scripts/#comments</comments>
		<pubDate>Wed, 25 Oct 2006 16:55:07 +0000</pubDate>
		<dc:creator>cakebaker</dc:creator>
				<category><![CDATA[bake]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[task]]></category>

		<guid isPermaLink="false">http://cakebaker.42dh.com/2006/10/25/a-simple-task-to-generate-sql-scripts/</guid>
		<description><![CDATA[To make it a bit easier to write the sql scripts for creating and dropping tables, I wrote a simple bake task. There isn&#8217;t much to say about it, so I show you just an example. The following call: php bake2.php sqlscripts users profiles profiles_users creates app/config/sql/create.sql: CREATE TABLE users ( id INT(11) NOT NULL [...]]]></description>
			<content:encoded><![CDATA[<p>To make it a bit easier to write the sql scripts for creating and dropping tables, I wrote a simple bake task. There isn&#8217;t much to say about it, so I show you just an example. </p>
<p>The following call:</p>
<pre>
php bake2.php sqlscripts users profiles profiles_users
</pre>
<p>creates app/config/sql/create.sql:</p>
<pre>
CREATE TABLE users (
  id INT(11) NOT NULL AUTO_INCREMENT,
  created DATETIME,
  modified DATETIME,
  PRIMARY KEY (id)
); 

CREATE TABLE profiles (
  id INT(11) NOT NULL AUTO_INCREMENT,
  created DATETIME,
  modified DATETIME,
  PRIMARY KEY (id)
); 

CREATE TABLE profiles_users (
  profile_id INT(11) NOT NULL,
  user_id INT(11) NOT NULL,
  PRIMARY KEY (profile_id, user_id)
);
</pre>
<p>and app/config/sql/drop.sql:</p>
<pre>
DROP TABLE IF EXISTS users;

DROP TABLE IF EXISTS profiles;

DROP TABLE IF EXISTS profiles_users;
</pre>
<p>That&#8217;s it. You can find the code in the <a href="http://cakebaker.42dh.com/downloads">download section</a>. Happy baking :)</p>
]]></content:encoded>
			<wfw:commentRss>http://cakebaker.42dh.com/2006/10/25/a-simple-task-to-generate-sql-scripts/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

