Cakephp 3 Plugin – Changelogs

Ive finally gotten around to releasing this little app i was working on for Cakephp3.  I decided a while ago to abandon Cakephp 2 and go with the new version 3.

Its been a steep learning curve so i wanted to learn as much as i could.  So thats where this app/plugin came in.

The Aim:
The goal of the plugin was to allow a way to simply log tasks, changes or articles about the cakephp project your working on.

If your working on a website/project on your own you need a way to record your changes and tasks so i thought this would be an ideal way to learn and release something. Sure you could do the same with Github and better but i think its better to have something like this integrated into your application.

Screenshot: Version 1
2016-05-25

 

 

 

 

 

Version 2 Screenshot:
changelogseditv2

 

 

 

 


Github & Source:

https://github.com/gerrymcdonnell/cakephp-changelog

Cakephp 3- How to read a remote Xml file

23666One of the great things about CakePHP is that it has a lot of built in librarys.  Heres an example of how to read a remote XML file.

 

 

 

use Cake\Utility\Xml;
use Cake\Network\Http\Client;

//XML file you want to read in
$url="http://store.steampowered.com/feeds/newreleases.xml";

//read a remote xml file
$http = new Client();
$response = $http->get($url);
$xml = Xml::build($response->body());


//Method 1 using SimpleXMLElement Object
//loop the item elements array of xml file
foreach($xml->channel->item as $item){
	//need to cast to string
	debug ((string)$item->title);
	debug ((string)$item->link);
}


//Method 2 convert xml to array
$xml = Xml::toArray($xml);

//loop elements of array
foreach($xml['rss']['channel']['item'] as $item){
	debug ('Title:'.$item['title']);
	debug ('Link:'.$item['link']);
}

The result will print out the list of items from the feed;
http://store.steampowered.com/feeds/newreleases.xml

cakexml

 

 

 

 

 

 

More info here;
http://book.cakephp.org/3.0/en/core-libraries/xml.html#importing-data-to-xml-class

CakePhp3 – Date Formating and Timezone

23666Quite simply this is a pain to set right, as it seems to default to the american time zone despite several efforts to configure it to european time in both Cakephp3 and the Php.ini file.

But you can display the needed time format as follows in your view action;

Below the field “created” is a date field in a MySQL Database.

echo $order->created->i18nFormat('dd-MMMM-YYYY HH:mm');

Edit;

To set the timezone of your application you need to go to the config/app.php

Change below as follows;

'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
to
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_IE'),

This wont change the default display of dates but will set the dates to be displayed in the locale you desire.

edit;

MORE here

No Mans Skys PC Possable Stutter/Hitching Fixes

Found this fix for the game on reddit which seems to fix the terrible stutter problems that people are having;

https://www.reddit.com/r/NoMansSkyTheGame/comments/4xgw82/pc_users_incredible_fps_fix/

The Fix:
Is to create a shortcut to the games executable file “NMS.exe”.  Then in the target window paste the following;

C:\Windows\System32\cmd.exe /c start “Process Monitor” /High “E:\GOG Games\No Man’s Sky\Binaries\NMS.exe”

Note:
Replace “E:\GOG Games\No Man’s Sky\Binaries\NMS.exe”with the path to game on your system.

EDIT:
This fix doesn’t work for me and in fact seems to make the game perform even worse, its best to update to the “BETA / Experimental” Patches available on Steam and GOG.

Cakephp3: Installing Cakephp3

23666Cakephp 3 depends a lot on using composer, so youll need to get that first.; http://getcomposer.org/

Once youve set up composer you can create a brand new cakephp3 app by;

  1. Going to your web servers “htdocs” folder. I.e if your using xammp it should be; C:xampphtdocs
  2. Open a command windows here and type;
    composer create-project --prefer-dist cakephp/app my_app_name
  3. Cakephp will create a folder in your htdocs folder called ” my_app_name”
  4. Open http://localhost/my_app_name

Cakephp 3 installation:
http://book.cakephp.org/3.0/en/installation.html