dracoblue.net

Creating (internal) links in Agavi Views-Templates

As you set up your routing.xml with some route like that:

<route name="[strong]unnamed_ticket_view[/strong]"
    pattern="[strong]^/ticket/(id:\d+)/$[/strong]" module="Tickets" action="View" />

You can easily create links directly to that with the following code (in your

templates):

echo '<a href="'.$ro->gen("[strong]unnamed_ticket_view[/strong]", array("[strong]id[/strong]" => [strong]12[/strong]))
    .'">'.htmlspecialchars("MyLink").'</a>';

This will create a link MyLink with the target

/ticket/12/, nice, isn't it? :)

In agavi, open source, php by DracoBlue @ 09 Oct 2008 | 65 Words

Agavi database overrides for Propel + MySQL (other databases)

Once you generated your myproject-conf.php and myproject-classmap.php, you'll notice and copy and paste them into your app/config-folder you'll maybe want to set user and password for a specific AgaviPropelDatabase.

<?xml version="1.0" encoding="UTF-8"?>
    &lt;configurations xmlns="http://agavi.org/agavi/1.0/config">
    &lt;configuration environment="development">
        &lt;databases default="[strong]mydb[/strong]">
        &lt;database name="[strong]mydb[/strong]" class="AgaviPropelDatabase">
        &lt;parameter name="config">
            %core.app_dir%/config/[strong]myproject[/strong]-conf.php
        &lt;/parameter>
        &lt;parameter name="overrides">
        &lt;parameter name="connection">
        &lt;dsn>mysql:dbname=[strong]mydb[/strong];host=[strong]localhost[/strong]&lt;/dsn>
        &lt;parameter name="user">root&lt;/parameter>
        &lt;parameter name="password">&lt;/parameter>
        &lt;/parameter>
        &lt;/parameter>
        &lt;/database>
        &lt;/databases>
    &lt;/configuration>
&lt;/configurations>

Here you also can change the dns-entry to match different sql servers!

Your runtime-conf.xml for propel looks like that:

<?xml version="1.0" encoding="UTF-8"?>
&lt;config>
    &lt;propel>
        &lt;datasources default="[strong]mydb[/strong]">
            &lt;datasource id="[strong]mydb[/strong]">


<!-- 
                    this ID must match <database name="">
                    in schema.xml
                -->
                &lt;adapter>mysql&lt;/adapter> 


<!--
                        sqlite, mysql, myssql, oracle, or pgsql
                    -->

                &lt;connection>
                    &lt;dsn>mysql:dbname=[strong]mydb[/strong];host=localhost&lt;/dsn>
                &lt;/connection>
            &lt;/datasource>
        &lt;/datasources>
    &lt;/propel>
&lt;/config>

In agavi, open source, php, propel by DracoBlue @ 09 Oct 2008 | 124 Words

DJson 1.4.1 released

Today I want to announce a new release of DJson. The 1.4.1 features one little bug fix for loading files, with numbers (especially the 0) as element.

Also this update of course includes the changes from the 1.4 release: way faster caching. With 1.4 I managed to use the cache memory based and without journal (which is actually not needed here), which made the api-tests like 100 times faster. DJson is now really lightning fast!

Head over to the

official DJson page or directly to the djson 1.4.1 download.

In djson, open source, pawn by DracoBlue @ 18 Sep 2008 | 92 Words

Dini 1.6 released

Today we have an update for the dini library. It has been a year since the last update, because dini is doing quite well for already 14500 downloaders (awesome!), but in a technical discussion at the sampforums we noticed, that it's possible to tweak the speed of dini - so why not make a new release?

DINI 1.6

Changes:

  • dini_Get uses less memory now
  • All dini_set/get functions use a faster check for the evaluation of the key now
  • dini_BoolSet uses less memory now
  • dependency to dutils has been removed

As you can see dini does not has any new functions, but is faster now. Hope you like it!

Thank you to Magor for the positive and negative remarks on dini and the resulting changes. If you need dini 1.5.1, I mirrored the

old version, too.

In dini, open source, pawn by DracoBlue @ 16 Sep 2008 | 149 Words

Building/Creating Google Chrome Themes: Manual Reshacker-Way

Google Chrome ships with a folder called theme and a file called default.dll in it.

There are plenty of themes popping up everywhere for the new browser, but actually nearly no documentation on how to make your own.

So the questions are: how to create my own default.dll, how to recompile default.dll or how to change images in default.dll. We won't talk about the second question now, but let's face how to create our own default.dll with changed images in the default.dll-file.

There is a very small and useful tool called ResHacker. Use it and open the default.dll. You'll see plenty of binary data and some icons. While looking at the svn repository of chrome, I noticed that all this files are actually .png files!

So let's have a look at how to replace the "Go"-Button in google chrome. By this table you can see, that the go button has the id 9025. So left click the binary data #9025/1033 and press "Action"->"Save Resource as binary fileÂ? ... " and call the file go.png.

Open the go.png with any image editor you like (even mspaint!). Change it and save it.

Now comes the final steps to add the new go-button: [ol]

  • Press "Action"->"Replace other Resource"
  • "Open file with new resource" and open the go.png.
  • Use BINDATA as resource type, 9025 as resource name and 1033 as resource language and press "Replace".
  • Press "File" -> "Save"
  • Restart your Chrome Browser!
  • [/ol] Now your default theme, should have the new Go-button we just created!

    Extracting the files and replacing by hand is a very time intensive way to replace+make themes for google chrome, thatswhy psytoy created 2 batchfiles for automatic extract + replacing of the images in the .dll. So you can create your themes in no time!

    In articles, google chrome, windows by DracoBlue @ 07 Sep 2008 | 311 Words

    Page 31 - Page 32 - Page 33