Developing New Paths - The Mojavi Project

Archive for August, 2011

Mojavi Project

August 25, 2011

Migrating from Moajvi 2

Tags: ,

By Tyler Tompkins

Note: This document will be changing frequently as I add more information, and rearrange to create a more logical order and progression of the said information.

* Prerequisites
* First Things First
* The Context
* Translating your Renderer
* View
* Actions
* Configuration
* References

Prerequisites

You should have a decent grasp of Mojavi2 and PHP5 before trying to upgrade to Mojavi3.

If you want a quick crash course of Mojavi 3, see Creating Your First Module 2.
First Things First

Before you begin transferring your applications over from Mojavi2, make sure whatever host you’re using supports PHP5. You can figure out if your host supports PHP5 by running

phpinfo();

Furthermore, you need to download and install the Mojavi3 package, which can be attained by going to this location.
The Context

Probably the most important new and powerful aspect of Mojavi3 is the Context object. Once I figured out what this thing did, I fell in love with it. Basically, it is a sort of catalyst/storage object that allows you to access:

* The $request object via getRequest()
* The $controller object via getController()
* The $user object via getUser()
* The Current Action/Module names via getModuleName() and getActionName()
* And finally the Current module’s directory

More or less, most classes that are exposed to the user/developer (you) are going to have a getContext() function, which will allow you to access this object. And with the recent addition of cascading calls, you can perform operations that you were unable to in php4, for example:

The Old Way:

$obj =& $request->getAttribute(‘myobj’);
$anotherobj =& $obj->doSomethingSpecial();
$anotherobj -> execute();

The New Way:

$this->getContext()->getRequest()->getAttribute(‘myobj’)->doSomethingSpecial()->execute();

Okay, so maybe that wasn’t the best example, as it is rather lengthy, but you get my point, 1 line vs 3 lines, and no possible mistakes when dealing with large objects like copying them over without references, etc.

This subsection is to be continued….
Translating your Renderer

Mojavi2 used ‘renderers’ to translate the API of one templating system into a generic API that would easily allow a developer to switch out one templating system for another. For example, the Smarty templating engine uses $smarty->assign() to allow you to set a variable, while patTemplate, another templating system, uses $pat->addVar(). In Mojavi 2, you would then write or use an existing renderer, which you would then invoke to display your output.

Note: This was done typically through a filter, which would create the renderer object, then assign it to your $request via

$request->setAttribute(‘MyRenderer’,$rendererObj))

Mojavi3 uses largely the same methodology, but instead of getting the renderer directly from the $request object within each of your views, it simply extends the View class.

For example:

abstract class SmartyView extends View
{
…..

function __construct()
{
$this->engine = $this->getContext()->getRequest()->getAttribute(‘MySmartyObj’);
}

public function setAttribute($name, $value)
{
$this->engine->assign($name, $value);
}

…..
}

Note: the use of

$this->engine = $this->getContext()->getRequest()->getAttribute(‘MySmartyObj’);

was simply the best solution I could come up with for getting any object from within the view, you could also have done the following just as easily:

$this->engine = new Smarty();

View

The Mojavi3 View is mostly an abstract class, which provides a skeleton of functions to work with, thus providing the unified API as was achieved in Mojavi2 (It’s unified because you are forced to comply with the naming conventions implemented by the abstract class View.)

Now, instead of intitializing your Renderer object (as you would in Mojavi2) you simply extend View, and initialize that. Like shown above:

abstract class SmartyView extends View
{

is what our new View would look like. To put this new View type into action, we extend it when declaring views for our modules. For example:

class DoSomeActionSuccessView extends SmartyView
{

}

As you can see, this is much more fluid than pulling the renderer out of $request with every new View, it’s also a lot less code that you have to copy and paste, and thus less code to maintain. You may also have noticed that the naming scheme is different for the Views, instead of naming the file DoSomeActionView_success.class.php you would now name it DoSomeActionSuccessView.class.php, and name the class likewise(In Mojavi2 we just named our view classes DoSomeActionView, in Mojavi3 it’s DoSomeActionSuccessView replacing ‘Success’ with your application’s state).

This subsection is to be continued….
Actions

Actions in Mojavi3 are fairly similiar to those of Mojavi2, with a few enhancement and semantic tweaks here and there. Listed Below:

* When returning a VIEW_SUCCESS in Mojavi2, now return the View class constant corresponding to your application state, ie: View::Success, or View::Error
* When checking for view types supporting execution (getRequestMethods) instead of returning REQ_POST etc, return Request::Post etc.
* There is a new return type for getRequestMethods(), Request::All, which serves all request methods.
* The root Action class which all your actions extend now has a getContext() method, which allows you access to the context object.

Configuration

Mojavi3 configurations are done, by default, using .ini files. This simple and straightforward configuration makes configuring mojavi very easy. The base syntax of these ini files is as follows:

[SECTION]

; a comment…..
ConfigKey = “%MO_APP_DIR%/my/config/value”

Because some people might not like ini files, Mojavi3 was created in such a way that you could write your own configuration handlers. For example, if you wanted to use xml files to configure your mojavi, you could write a configuration handler, plug it in, and start using your custom configuration styles.

This subsection is to be continued….
References

To find out more about PHP5 in general go here: Where can I go to learn more?

Marketing

August 22, 2011

Play free games online at GameHouse

Tags: , , ,

If you like millions of Americans who love to play games online then GamesHouse is a site you need to check out. GameHouse formerly RealArcade offers free games online as well as paid memberships for those that want to own the games and be able to play offline. For those that have an iPad you can also check out their apps and play some of the most popular games alone or with friends. Want to play Plants vs. Zombies, one of the most popular games of 2010 on your laptop then you will find it online at Gamehouse. They offer thousands of titles that are 100% safe from malware and viruses. Gamehouse prides itself on offering a safe gaming environment. They offer different types of memberships for their customers whether you want to own the game or simply play online and it does not matter if you have a mac or pc. If you join for free you will get the opportunity to download one free game a day and play forever. Each day the free game changes so be sure to check in often and take advantage of this great offer.

At Gamehouse they want to make sure that you not only get access to great games, but that you can also earn prizes while doing it. You can sign up for free and get 1000 coins and have the chance to earn additional coins just for playing games. Then you can cash in those coins for prizes like Amazon gift cards. There are numerous ways in which you can earn coins like logging into your account, liking on facebook, buying a full game, and joining Fun Pass. So not only are you taking some stress out of your daily activities but having the chance to get some great prizes for playing free games online.

 

 

 

 

If you come across a great game that you enjoy drop us a comment and we will share with the rest of our readers.

Marketing

August 20, 2011

Sonora is one of the top BC resorts that you should visit

Whether your idea of a great getaway is fly fishing, whale watching, or simply relaxing near the ocean then Sonora one of BC resorts top destination may be for you. Located in Western Canada about an hour flight north of Vancouver you will find a full service spa that features a hot mineral pool. Once your daytime activities you can wine and dine in their restaurant that overlooks the Pacific Ocean while their chef prepare one of several Pacific Northwest top cuisines. If you love to fish then you can tap into the fly fishing expert located on the property where you can charter a boat to take you to some of the best fishing in the Pacific Ocean. This part of the world is amazing and you will be hard pressed not to come back because there are so many different types of activities to do.

Technology

Found it!

Guest post of the week by Deangelo Spencer

I have really been hurting for home Internet and satellite ever since I moved to this new place, so last week I did some research on Clear Bundle systems and found a bundle package that has everything I need for my home. Since I work from home, I often keep the TV on in the background, so it’s important to me to have a lot of channels to choose from while I’m working. The TV noise definitely makes it seem less lonely around my house! I really feel like the characters on the TV are my coworkers, even though I know that’s silly, but either way, it keeps me from going crazy here by myself all day long. I had toyed with the idea of not getting cable or Internet at home, but in retrospect there’s just no way I can not be connected to the outside world, even if it would save me a little bit of money in the long run. Thankfully, there are some good deals out there and cable won’t bleed me dry.

Technology

Managing your business on the go

In order for businesses to compete in today’s fast paced world you need to be accessible at any point during the day. With the 24 hour access that customers want through websites, blogs, and social networking sites a company has to plan for these ways to interact with their customers. Your Business Phone Service should be able to accommodate your employees and customers the same way by allowing them to work and engage you from anywhere necessary. With solutions from Easy Office Phone you can now reduce your overall telecommunication costs while giving your employees and customers access 24/7. Imagine being able to conference with your team at the same time no matter where they are in the country through one simple solution. Using your smartphone to answer your business line even when you are away from the office. You can give your teams and your company a national presence to make your customers feel closer your company.

With simple solutions that can allow you to use your existing telephone equipment or simply using your PC you can have a number that interact no matter what medium you are using. Your sales people can have their extension ring out to their cell phone even if they are thousands of miles away while giving a local presence. Small to medium sized businesses can benefit from this solution while cutting their overall costs and helping to improve their customer interaction.

Marketing

Visit one of the top BC resorts

British Columbia is home to some of the best fishing and skiing in the world. Whistler Mountain and Vancouver, BC hosted the 2010 Winter Olympics and the world got to see the beauty of Canada. For those looking to vacation in the area you can visit one of the top BC resorts at Sonora. Located on the Inside pasage of the Pacific Ocean. You can take a helicopter to view glaciers one day, and then go fly fishing for salmon the other day. At the end of each day you can relax at their luxury spa and enjoy a full body wrap or soak in a hot mineral pool. No matter what you are looking for you are sure to find the perfect balance of nature and luxury in this all-inclusive resort.

Technology

Fisher Investments and your portfolio

Tags: ,

Today’s investor is presented with more resources and places to invest than any other point in our history. The technology sector is getting a lot of play from big investment firms with the latest IPO offering from companies like LinkedIn and Chinese search engine competitors. This leaves the smaller individual investor somewhat on the outside because of the access to information and trading tools that are not readily available. A word of caution though is to not let the sky rocketing IPO pricing we are seeing move you into a sense of false security. With valuations in the billions on low revenues this has the signs of the early 2000 dot com bust. With any investment strategy you need to diversify and you will read this in any book, blog, or journal on financing. Companies like Fisher Investments just released the sixth book in a series that focuses on the technology sector and provides key insights to investors on how to understand and invest in this rapidly changing field. I was reading an article that if Facebook were to launch their IPO today that the initial stock offering would be over 50X earnings. This is a huge red flag for most investors but can still catch some people off guard. Huge tech companies like Apple and Google continue to set the pace on stock market performance and while these are some great examples had you invested early there hundreds of similar stocks that went the opposite direction.

Tech Sector With the introduction of new technologies every year it can be difficult to assess where to invest your money. If we look at the hot tech sectors of PC computing we can see that tablets are going to be the wave of the future and look to overtake PC sales in the near term. Apple has set the bar for others to follow and giving access to powerful computing platforms that make things simpler from connecting with a colleague to getting on your favorite social network. If Apple has any thing to do with it Cloud computing could be the next open frontier of technology investments. We will soon find out the level of resources and commitment that Apple and companies like them are putting behind this new technology next week at the WWDC that Apple holds annually to introduce new iOS and consumer technologies. I have always been of the mindset that you have to spread your portfolio investments over growth stocks, income stocks, and bonds. You should also have some foreign stock components in your portfolio even in the technology sector to help balance out inflation and the possible decline of the dollar against foreign currencies. There are no magic bullets or full proof investment strategies that you can find that will guarantee success without some failures. We all see this in the past three years as peoples net worth was literally cut in half because they invested in small niche areas and were not fully diversified to account for the uncertainty and down turns in the market. Always consult with a professional before making any financial investments and find credible resources like Bloomberg Market reports to help you understand the opportunities in a particular segment.

Marketing

August 19, 2011

Relax at Sonora Spa resorts BC

Tags: ,

Imagine waking up with views of the Pacific ocean then getting ready to head out on fishing adventure for salmon to then return to a hot mineral pool to soak before heading off to a find dining experience. All of these adventures and pampering located at the Sonora Spa resorts BC. Situated about an hour north via plane from Vancouver, BC you will have access to trails, water rafting, world class fishing, and some of the best food in Canada. At Sonora resort and spa they pride themselves on pampering their guests and with the amenities like full body wraps, full indoor tennis courts, and an amazing view of the Pacific Ocean you are sure to find something that will take your mind off the daily grind. Whether you are celebrating an anniversary or just looking to get away there is so much to do you are sure to make a return visit.

Technology

Grab a deal online at Deal Fun

Tags: , ,

We have all heard and probably used the auction site eBay. Today there is a new wave of auction sites that are making a big entrance called penny auction sites. The newest penny auction site called dealfun.com is making waves across several news sites and have some features to help newbies understand how to best use the site. You join for free and maybe get a few free bids and then the game starts. What is alluring from a simple onlookers stand point is that you have an $800 item selling for $4.53. You can bid on and win items like iPads, laptops, and PS3′s. That sounds amazing and why can’t I win that. Here is how this auction works. Unlike sites like eBay where you bid on an item and you don’t win you are out nothing. At DealFun, once you bid the money is now put towards the item. So you can bid 4-5 units that may cost you .50 each but if someone outbids you that money is gone. The psychological aspect is quite interesting because the dollar is so low that you feel risking a few dollars to win a $800 item cannot be that bad. They are fun to watch and if you step into the game make sure that you set yourself a limit or you could end paying a lot for nothing. DealFun has put a solution in place for your first series of bidding that allow you to regain your bids within 24 hours of your first bidding experience. Plus they offer access to customer support and offer help to everyone  on your question.  I do like that they show what items sold for, who won them, and how many bids they used to win the item. They have just come online with a great domain name and will be compiling stories from across the industry on various auction types available. You can find articles on the site at MSNBC or on Yahoo to understand what other are saying.

Marketing

Vacation at Spa resorts BC

Tags:

If you have some vacation time that you are looking to take before the end of summer then I would look at Sonora Spa resorts BC. Located in the beautiful British Columbia province you will have access to majestic mountains, rivers, and natural forests. You can have the staff at Sonora recommend your days activities that can include outdoor hiking followed up by a relaxing day at their world class spa. There is no better way to spend your vacation than relaxing in a hydrotherapy tub with 252 programmable jets and then jumping in one of the outdoor warm mineral pools to take your mind off the demands at work and recharge your batteries. This is also a great place to consider for that upcoming anniversary to celebrate with the one that you love.

Mojavi Project

Migration for Mojavi

You should have a decent grasp of Mojavi2 and PHP5 before trying to upgrade to Mojavi3.

If you want a quick crash course of Mojavi 3, see Creating Your First Module 2.
First Things First

Before you begin transferring your applications over from Mojavi2, make sure whatever host you’re using supports PHP5. You can figure out if your host supports PHP5 by running

phpinfo();

Furthermore, you need to download and install the Mojavi3 package, which can be attained by going to this location.
The Context

Probably the most important new and powerful aspect of Mojavi3 is the Context object. Once I figured out what this thing did, I fell in love with it. Basically, it is a sort of catalyst/storage object that allows you to access:

* The $request object via getRequest()
* The $controller object via getController()
* The $user object via getUser()
* The Current Action/Module names via getModuleName() and getActionName()
* And finally the Current module’s directory

More or less, most classes that are exposed to the user/developer (you) are going to have a getContext() function, which will allow you to access quality management software. And with the recent addition of cascading calls, you can perform operations that you were unable to in php4, for example:

The Old Way:

$obj =& $request->getAttribute(’myobj’);
$anotherobj =& $obj->doSomethingSpecial();
$anotherobj -> execute();

Marketing

Victoria Condos a new place to live

Sometimes it is good to take a step back in time and this is true when it comes to housing. The Union victoria condos are creating that sense of nostalgia with the brick and upturned eaves with the comforts of today’s technology and convenience of being close to downtown. The housing market across the region has been slowing and people are looking to step into a property with lower upkeep and closer to work. These condos are offering a great way of life with many of the arts,restaurants, and local conveniences all within walking distance so that you can enjoy life. For those looking to live downtown and be a part of a neighborhood that is constantly buzzing with excitement then victoria condos might be your next place to call home.

Technology

August 11, 2011

Finding the right CRM for your business

In today’s competitive business environment connecting with your customers is even more critical with all the channels they have to gain information and make purchases. Equipping your sales people with the latest data and marketing objectives so that when they are interfacing with their customers can make the difference between a losing or gaining a sale. This is why many small to medium sizes companies are turning to CRM tools like Salesforce.com, Act, or Sales Logix. There are so many different CRM Software solutions that knowing which one will work for your particular business needs can make or break your strategy. Teaming up with a partner who knows the top CRM software solutions like Quality Integrity can help save you time and money.
Experts in the field of CRM solutions can help you uncover needs that you may not have thought of and help provide recommendations that are more closely aligned with your business needs. With some of the top CRM solutions now available as a off the shelf solution it may seem simple just to go with the hottest product on the market. There are various benefits that each one offers and being able to test and understand which benefits are right for your company can cost valuable time and money. Let the experts at Quality Integrity help you and your teams make the right choice and beat your competition before they beat you.

Technology

August 6, 2011

Make international calls on your smartphone with Voxofon

For many of us that own a smartphone and need to call abroad there is a new option that covers your phone and allows you to save money on international calls. Now international calling from iPhone devices is as simple as downloading Voxofon’s app and dialing the international number. The process is simple on any smarthpone and Voxofon now covers up to 98% of smartphone users. Android users get the added bonus of being able to call home while traveling abroad because you are able to take advantage of their VoIP services so every call becomes local. Either using 3G or wireless using your iphone, blackberry, or android phone for mobile international calls is now easier and less expensive. You will love the sound quality that you get and the great prices. You can check out Voxofon sites and you can see the current rates for calling abroad. So if you are planning that family vacation to Italy, or that all important business trip to Southeast Asia, download the app for your phone so that you can stay in touch with family and friends.

Blogging

August 2, 2011

Being Outside

Tags: ,

Thanks to Roman May

Man it’s good to be outdoors again! I hate wintertime and how cooped up in the house I have to get – it’s so great to be able to be outside riding my bike or going for a walk or whatever…this is the way people were meant to live! I sort of have a house out in the country anyway so when it snows I get really stuck inside. I got internet last year from a satellite company that had an online ad saying Click HERE and it’s worked really well for my needs since I don’t do a whole lot online. I can’t believe what a terrible winter it was this year and how hard I had to work just to keep the snow from coming inside the house. It’s tough being up on the mountain sometimes but it’s nice to know I can stay connected even when the weather gets rough. Maybe I should move somewhere like California so I don’t have to deal with the terrible winters!