Archive for the ‘PHP’

PHP GAMV is back online01.17.11

A while ago I wanted to get GAMV back online and I decided to use Cupcake the PHP Framework I wrote. If you’re looking for it go to: http://gamv.fernyb.net/

Posted in GAMV, PHP, Projects, Uncategorizedwith Comments Off on PHP GAMV is back online

Current Progress10.16.09

So, it’s been while since I last wrote something here.. Well it’s for a good reason, I’ve been busy with work but besides the work hours, I actually managed to create a PHP Framework which I call Cupcake. The reason for the name is being that I wanted a version of CakePHP without lots of the component I will never use. I initially forked CakePHP but ran into some issues with it. So I decided to write my own and implement it that way I thought it should be. That is available on Github.

Another project I’m working on is a Mac OS X Application that will be similar to my previous apps GAMV and LyFOX which were a great success, and I will attempt to release it by the end of this year 2009.

Posted in GAMV, Mac, Me, Objective-C, PHP, Programming, Projectswith Comments Off on Current Progress

Testing with CakePHP – Part 111.01.08

If you would like the higher quality screencast download it (h.264)

Lately I’ve been messing around with CakePHP and it’s actually pretty good. It’s similar to Rails but obviously not in Ruby. Unlike some people, I don’t discriminate based on code or anything else really. I’m happy with anything I like. Well I figure I would start a series of screencasts for CakePHP since I’m messing around with it.

Oh yeah, I’ve been reading, apparently, and I know, It’s not very well explained, just a heads up.

Posted in PHP, videowith 1 Comment →

PHP Zend Framework – MVC04.01.08

When ever I use the Zend Framework and I want to use the mvc components I always need to create the structure, though it can be a bit of a pain I have wrote a script to speed up that process. The script I wrote will create the mvc framework for you. It downloads a copy of it and uncompresses it. Check it out. on DZone

Posted in Me, PHPwith Comments Off on PHP Zend Framework – MVC

PHP Snippet03.08.08

Here is a PHP Snippet I wrote. It’s a cool trick to for calling multiple methods in a much simpler way. Inspired by Ruby’s ActiveRecord.

<?php

interface Member {
	function login($username, $password);
	function update($status);
}

class Base implements Member {
	public function login($username, $password) {
		echo "You will be logged in as: {$username} with Password: {$password}\n";
	}
	
	public function update($status) {
		echo "Your New Status Message is: {$status}\n";
	}
	
	public function __call($method, array $argv) {
		if(preg_match('/^do_*/i', $method)) {
			foreach(explode("_and_", substr($method, 3)) as $k => $v) {
				$param = array();
				foreach($argv[$k] as $value) { $param[] = "'{$value}'"; }
				$param = join(", ", $param);
				$code = '$this->'. $v ."({$param});";
				eval($code);
			}
		}
	}
}


class User extends Base {
	
	public function say_hello($message) {
		echo "Message: {$message} \n";
	}
}


$usr =& new User();

$usr->do_login_and_update(array("username", "password"), array("Hello World"));
# Prints the following:
# You will be logged in as: username with Password: password
# Your New Status Message is: Hello World
#

$usr->do_login_and_say_hello(array("username", "password"), array("Hi how are you?"));
# Prints the following:
# You will be logged in as: username with Password: password
# Message: Hi how are you?
#

$usr->do_login_and_update_and_say_hello(array("username", "password"), array("Hello World"), array("Hi how are you?"));
# Prints the following:
# You will be logged in as: username with Password: password
# Your New Status Message is: Hello World
# Message: Hi how are you?
#

?>

Posted in PHP, Programmingwith Comments Off on PHP Snippet

Twitter / MySpace Crosspost11.03.07

Twitter MySpace Status Update

So I use Twitter and overall I like it. It’s cool I post whatever is on my mind at the moment. Sometimes I wonder why I even posted that… but anyways I have created a crosspost script. Update your Twitter status and at the same time update your MySpace status so your, myspace friends can see it.

Download: status-update.zip

Written in PHP.

Twitter Follow: http://twitter.com/fernyb

Posted in Hacks, Me, PHP, Projects, Uncategorizedwith 4 Comments →

How to: Get PHP working on Mac OS X 10.5 Leopard10.28.07

PHP Mac OS X 10.5

After updated my mac to the latest version of mac leopard my php installation broke, I guess because Leopard installed Apache2 and I was using Apache1.3 which was what OSX 10.4 came with. So to get PHP5 working with Mac OS X 10.5 Leopard. Do the following:

1. Launch the Terminal its located in applications/utilities

2. In Terminal type: cd /private/etc/apache2

3. Once your in the directory “/private/etc/apache2”, using what ever text editor you like open the file named httpd.conf (if your using textmate text editor, you can do, mate ./httpd.conf)

4. Once you open the httpd.conf file now look for the following line:
“#LoadModule php5_module libexec/apache2/libphp5.so” Once you find it, it’s somewhere around line number 114, uncomment the line So it should look something like this:

LoadModule php5_module libexec/apache2/libphp5.so

5. After doing all that now back in terminal type this command: cd /private/etc/apache2/users

6. Once in that directory open the file with your account username (ex. my file would be named, FernyB.conf)

7. Delete all contents inside the file

8. Start the web server or restart it by going into System Preferences > Web Sharing

9. In Terminal type: open /Library/WebServer/Documents (that should open up finder in that location)

10. Now Create a file called phpinfo.php and place it in /Library/WebServer/Documents

11. Open up phpinfo.php and type the following into phpinfo.php
PHP Info
12. Save and close phpinfo.php13. Now with your favorite web browser safari go to http://127.0.0.1/phpinfo.php

14. Now you should see the PHP Information page

15. The php.ini file will be located in /etc

16. In the directory /etc you will need to rename or copy and rename the file php.ini.default

17. In the directory /etc should have a file named php.ini

18. Now restart the web server, System Preferences > Web Sharing

19. That’s all.

Posted in Mac, PHP, Uncategorizedwith 1 Comment →

Facebook source code08.11.07

Over at facebook secrets have published the main index php source code to facebook. Some how it was released to the wild although it is not confirmed weather this is actual real life code or weather it’s fake. If it is real code there could only be two ways it was released, either the developers secretly released it or it was somehow hacked. I have a feeling it is fake.

Posted in Hacks, PHP, Uncategorizedwith 2 Comments →

MySpace API04.15.07

MySpace does not have an API so while being bored and trying to find something to do. I wrote some code to create a homebrew/homemade API so its the unofficial MySpace API by me. So go ahead and use it do whatever you want with it. A link back to my site would be really cool or at least some credit.

I wrote some documentation for this and you can test it out here aswell. Go to: http://fernyb.net/myspace/api/ It is also available for download so you can use it with your own server.

Posted in Downloads, Hacks, Other, PHP, Programming, Projectswith 16 Comments →

Net_Growl = PHP + Growl02.17.07

So today I was messing around with php & growl. So here is tip for getting started. First download growl if you dont have it already. Next install the php pear package

Once you have all the set-up. Go into your System Preferences and go into the Network tab in the growl settings. While in the Network tab make sure you click on “Listen for incoming notifications” & “Allow remote application registration” and set the password. I set my password to “123456”

Now type this piece of code.

The first time you run the file through your web browser OSX will prompt you with a message.
Just Click Always Allow unless you have a reason not to.

So once you have done everything from above you should now see a message like the one below.

Wasn’t that cool! so here are the all my files I used.
Download: php-growl.zip

mamasam.com

Posted in Mac, Other, PHP, Programming, Uncategorizedwith 5 Comments →

phpLYFOX Update12.17.06

phpLYFOX has been updated. Changes made: added playlist support.
Tell me what you think and suggestion are always cool.
phpLYFOX

Posted in Hacks, PHP, phpLYFOX, Programming, Uncategorizedwith 11 Comments →

Bake Your Cookies12.16.06

Here is a script I wrote in PHP it shows you your own cookies yahoo music gives you after you login. So say you are making some kind of app and need cookies for yahoo music then use your own. Here you go donwload it: login.yahoo.cookies.zip

Posted in Downloads, Hacks, PHP, Programmingwith Comments Off on Bake Your Cookies

phpLYFOX12.15.06

phpLYFOX is completed. What is phpLYFOX? It is simply a way to watch yahoo music videos for us Mac users since Yahoo absolutely doesn’t care to provide Macintosh users access in other words its web based. So here you go my mac friends. Try it out phpLYFOX or you can download the source code here phpLYFOX.zip

Posted in Downloads, Hacks, Mac, PHP, phpLYFOX, Programming, Projectswith 25 Comments →

  • Recent Comments