Latest Post

Creating (internal) links in Agavi Views-Templates

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

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

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

echo ‘<a href=”‘.$ro->gen(”unnamed_ticket_view“, array(”id” => 12)).’”>’.htmlspecialchars(”MyLink”).’</a>’;

This will create a link MyLink with the target /ticket/12/, nice, isn’t it? :)

Continue reading

About

Jan Schütze, also known as DracoBlue, is a 23 years old software developer. This site is more something like a diary for what was done and when it was done.

There is also a private german blog.

Recent posts

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"?>
<configurations xmlns="http://agavi.org/agavi/1.0/config">
<configuration environment="development">
<databases default="mydb“>
<database name=”
mydb" class="AgaviPropelDatabase">
<parameter name="config">%core.app_dir%/config/myproject-conf.php</parameter>
<parameter name=”overrides”>
<parameter name=”connection”>
<dsn>mysql:dbname=mydb;host=localhost</dsn>
<parameter name=”user”>root</parameter>
<parameter name=”password”></parameter>
</parameter>
</parameter>
</database>
</databases>
</configuration>
</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"?>
<config>
<propel>
<datasources default="mydb“>
<datasource id=”mydb“> <!– this ID must match <database name=”"> in schema.xml –>
<adapter>mysql</adapter> <!– sqlite, mysql, myssql, oracle, or pgsql –>
<connection>
<dsn>mysql:dbname=mydb;host=localhost</dsn>
</connection>
</datasource>
</datasources>
</propel>
</config>

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.

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.

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:

  1. Press “Action”->”Replace other Resource”
  2. “Open file with new resource” and open the go.png.
  3. Use BINDATA as resource type, 9025 as resource name and 1033 as resource language and press “Replace”.
  4. Press “File” -> “Save”
  5. Restart your Chrome Browser!

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!

Editing Chrome: Basics with JSON-Files

Since some of the chrome user-data is not saved as sqlite3-database, you will have notice also the json-format for files.

JSON is the javascript object notation and since chrome has a very fast javascript engine called V8, why shouldn’t use the notation for datastorage, too? :)

We’ll have a short information about what files are in the user-data directory, which are encoded as json-files.

Preferences: {
"default_search_provider": {
"id": "2",
"name": "Google",
"search_url": "{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&q={searchTerms}",
"suggest_url": "{google:baseSuggestURL}search?client=chrome&output=chrome&hl={language}&q={searchTerms}"
},
"download": {
"extensions_to_open": ""
},
"geoid_at_install": 94,
"profile": {
"exited_cleanly": true,
"id": "not-signed-in",
"name": "",
"nickname": ""
},
"search": {
"suggest_enabled": false
},
"session": {
"urls_to_restore_on_startup": [  ]
}
}

Bookmarks: Contains all bookmarks in an object with all folders and it’s children-array.

{
"date_added": "12865081791713103",
"name": "DracoBlue",
"type": "url",
"url": "http://dracoblue.net/"
}

We’ll go in details about theme-ing and extending chrome in next days.