<?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>pamiętnik programisty &#187; php</title>
	<atom:link href="http://piotr.doniec.eu/devlog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://piotr.doniec.eu/devlog</link>
	<description></description>
	<lastBuildDate>Wed, 28 Dec 2011 23:52:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to migrate from Mambo 4.5.1 to Joomla 1.6</title>
		<link>http://piotr.doniec.eu/devlog/2011/03/how-to-migrate-from-mambo-4-5-1-to-joomla-1-6/</link>
		<comments>http://piotr.doniec.eu/devlog/2011/03/how-to-migrate-from-mambo-4-5-1-to-joomla-1-6/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 22:39:33 +0000</pubDate>
		<dc:creator>pejotr</dc:creator>
				<category><![CDATA[Inne]]></category>
		<category><![CDATA[Programowanie]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tricky]]></category>

		<guid isPermaLink="false">http://piotr.doniec.eu/devlog/?p=584</guid>
		<description><![CDATA[My task was to migrate database from Mambo 4.5.1 to newest Joomla version which is now 1.6. I didn&#8217;t have to migrate any additional components data, just core functionality. At first I thought I will be an easy task, but then a few difficulties showed. Below I provide step which took me to happy end. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://piotr.doniec.eu/devlog/wp-content/uploads/2011/03/joomla-logo.png"><img class="alignleft size-medium wp-image-604" title="joomla-logo" src="http://piotr.doniec.eu/devlog/wp-content/uploads/2011/03/joomla-logo-300x205.png" alt="" width="210" height="144" /></a>My task was to migrate database from Mambo 4.5.1 to newest Joomla version which is now 1.6. I didn&#8217;t have to migrate any additional components data, just core functionality. At first I thought I will be an easy task, but then a few difficulties showed. Below I provide step which took me to happy end.<br />
<span id="more-584"></span></p>
<ol>
<li><strong>1. Copy database tables and Mambo code from remote server to local system</strong>. I used WAMP to do all migration. By doing that the site was still online, while I was doing some research. If for some reason you don&#8217;t have access to phpMyAdmin or any other database client, use <a href="http://sidu.sourceforge.net/sidu/">SIDU 3.2 DB Web GUI</a></li>
<li><strong>2. Convert SQL file to UTF8 encoding.</strong>You can do this using i.e. Notepad++ &#8211; use Convert to UTF8 (without BOM).<br />
Also change tables encoding to UTF8. This operation will cause problems with &#8216;ocp_core_acl_aro&#8217; table <code>"#1071, Specified key was too long; max key length is 1000 bytes"</code>. Rewrite it as below
<pre class="brush: sql">
CREATE TABLE `ocp_core_acl_aro` (
`aro_id` int(11) NOT NULL auto_increment,
`section_value` varchar(240) NOT NULL default &#039;0&#039;,
`value` varchar(240) NOT NULL default &#039;&#039;,
`order_value` int(11) NOT NULL default &#039;0&#039;,
`name` varchar(255) NOT NULL default &#039;&#039;,
`hidden` int(11) NOT NULL default &#039;0&#039;,
PRIMARY KEY  (`aro_id`),
UNIQUE KEY `ocp_gacl_section_value_value_aro` (`section_value`(100),`value`(75)),
UNIQUE KEY `section_value_value_aro` (`section_value`(100),`value`(75)),
KEY `hidden_aro` (`hidden`),
KEY `ocp_gacl_hidden_aro` (`hidden`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8
</pre>
</li>
<li><strong>3. Migrate to Mambo 4.5.2</strong> Create local database for Mambo 4.5.2 and use utf8_general_ci for connection and comparison.  Download and extract Mambo 4.5.2 to webserver directory. Change db settings in configuration.php and apply sql script upgrade451to452.sql from installation\sql direcotry</li>
<li><strong>4. Install Joomla 1.5 but do not load sample data</strong></li>
<li><strong>5. Install mtwmigrator for Joomla 1.5</strong> You can download it here <a href="http://www.matware.com.ar/downloads/joomla/mtwmigrator/mtwmigrator-v0-2-1.html">mtwmigrator-v0-2-1</a>. Run component and go to Preference. Set db name, location, login and password. Select data you want to migrate and launch migration process. After this step you should have all data from Joomla 1.0 availbale in new installation on Joomla 1.5</li>
<li><strong>6. Migrate to Joomla 1.6 using jUpgrade. </strong>You can download it here <a href="http://www.matware.com.ar/downloads/joomla/jupgrade.html">jUpgrade</a>. All you have to do is to install it within Joomla 1.5 and start. If some problem occurs try enabling Debuging in jUpgrade</li>
<p>Now, you should have new installation of Joomla 1.6 created for you and available in jUpgrade dir in Joomla 1.5 directory. New tables were created in same database as Joomla 1.5, so depending on needs, final step might be to dump those tables and move to new, dedicated location.</ol>
]]></content:encoded>
			<wfw:commentRss>http://piotr.doniec.eu/devlog/2011/03/how-to-migrate-from-mambo-4-5-1-to-joomla-1-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Auth i Doctrine</title>
		<link>http://piotr.doniec.eu/devlog/2009/04/zend_auth-i-doctrine/</link>
		<comments>http://piotr.doniec.eu/devlog/2009/04/zend_auth-i-doctrine/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 09:38:42 +0000</pubDate>
		<dc:creator>pejotr</dc:creator>
				<category><![CDATA[Programowanie]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://piotr.doniec.eu/devlog/?p=166</guid>
		<description><![CDATA[O łączeniu frameworku Zenda z ORM Doctrine wiele w internecie napisano. Ale trzeba pamiętać że wiele bibliotek zawartych w frameworku również może wymagać połączenia z bazą danych, a domyślnie wymagają użycia Zend_Db_Table. Na szczęście taka sytuacja została przewidziana przez twórców którzy udostępnili odpowiedni zestaw interface&#8217;ów umożliwiając w ten sposób tworzenie własnych adapterów a tym samym [...]]]></description>
			<content:encoded><![CDATA[<p>O łączeniu frameworku Zenda z ORM Doctrine wiele w internecie napisano. Ale trzeba pamiętać że wiele bibliotek zawartych w frameworku również może wymagać połączenia z bazą danych, a domyślnie wymagają użycia Zend_Db_Table. Na szczęście taka sytuacja została przewidziana przez twórców którzy udostępnili odpowiedni zestaw interface&#8217;ów umożliwiając w ten sposób tworzenie własnych adapterów a tym samym dostosowanie komponentów wedle własnych zachcianek.<span id="more-166"></span><br />
Jak połączyć Doctrine i Zend_Session napisał Zyx na swoim blogu(www.zyxist.com). W podobny sposób można podpiąć Zend_Auth, ale klasa już została napisana i można ją pobrać stąd <a href="http://http://framework.zend.com/wiki/pages/viewpage.action?pageId=3866950&#038;focusedCommentId=10944686">Zend_Auth_Adapter_Doctrine_Table</a>. Do tego miejsca wszystko jest jasne i proste, dziwi mnie za to trochę sposób używania tego w aplikacji.<br />
Zakładając że mamy prostą tabele użytkowników opisaną następująco</p>
<pre class="brush: php">
WebsiteUser:
  tableName: website_users
  columns:
    UserId:   { type: integer(8), primary: true, autoincrement: true }
    GroupId:  { type: integer(8), notnull: true  }
    Username: { type: string(255), notnull: true }
    Password: { type: string(255), notnull: true }
    Email:    { type: string(255), notnull: true }
  indexes:
    uniqueusername: { fields: [Username], type: unique }
    uniqueemail:    { fields: [Email], type: unique    }
  relations:
    WebsiteGroup: { class: RuczajGroup, local: GroupId, foreign: GroupId }
  options: { type: INNODB, collate: utf8_polish_ci, charset: utf8 }
</pre>
<p>to ustawienia nazwy tabeli i pól wygląda dość dziwnie, mianowicie nazwa tabeli nie jest faktyczną nazwą tabeli tylko czymś w rodzaju nazwy encji. Pola też należy pisać dokładnie takimi samymi literami(chodzi o wielkość) jak w pliku YAML, mimo że tworzone tabele składają się wyłącznie z małych liter. W sumie wydaje się to logiczne, ale trochę czasu mi zajęło dojście co oni tak naprawdę chcą a wyjątek typu<br />
<code>('The supplied parameters to Zend_Auth_Adapter_Doctrine_Record failed to produce a valid sql statement, please check table and column names for validity');</code> nie podpowiada zbyt wiele.</p>
<p>Poprawny kod autoryzacji wygląda zatem tak:</p>
<pre class="brush: php">
$dbConnection = Doctrine::getConnectionByTableName(&#039;website_users&#039;);
$authAdapter = new Zend_Auth_Adapter_Doctrine_Table($dbConnection);
$authAdapter-&gt;setTableName(&#039;WebsitejUser&#039;)
                  -&gt;setIdentityColumn(&#039;Username&#039;)
    		  -&gt;setCredentialColumn(&#039;Password&#039;)
		  -&gt;setCredentialTreatment(&#039;md5(?)&#039;);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://piotr.doniec.eu/devlog/2009/04/zend_auth-i-doctrine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

