Adding Composer Autoload to Yii Framework 1 and using PHPMarkdown

Using the database to manage blog content sucks, let’s use markdown to create a blog on yii framework 1.

Setting Up Composer Autoload

I’m assuming composer is already setup as per yii’s installation. You need to get the PHPMarkdown package with:

composer require michelf/php-markdown

The to make sure the classes from composer are autoloaded, add the following to yii’s index.php entry point.


// Add composer packages
$loader = require(__DIR__ . '/../vendor/autoload.php');
Yii::$classMap = $loader->getClassMap();

Now creating the simple blog post.

Creating a simple blog post with PHP Markdown in Yii Framework 1

So we will need to read the contents of a markdown file sitting on the server, preferably in a non public location like <root>/protected/data/blog/my-blog.md.

So let us add that file:


## Yay

This is my first blog post

Now in the action of the BlogController that you will need to create, we need to read the file contents and then convert that to html with PHPMarkdown and then send that html to the view file.


$markdown=file_get_contents(dirname(__FILE__) . "/../data/blog/my-blog.md",'r');
$html = Markdown::defaultTransform($markdown);

$this->render('index', array('article' => $html));

The final step is showing the htmlified contents of the blog post in the view file index.php:

 yii-markdown-blog-post

Source: Adding composer to yii stackoverflow

The Real Inflation rate for Consumers in South Africa

The biggest expenditure one makes in their lifetime is a house/property, a car and school fees. Why then are these huge expenditures left out of the regular CPI inflation calculations? I will be clarifying what the real Inflation rate for South Africa is for 2016-2017.

Along with day-to-day expenses things like medical aid increases, house price increase, car price increases, the cost of servicing vehicles, cost of insurance increases and school fees increases should be taken into account.

I intend to calculate a more realistic inflation figure.

The basket of Goods and Services with Real Inflation

Remember these are just estimates based on article found on the net.

Now we have this figure called the Average CPI Inflation for South Africa for 2016 was 6.56%.  From the figures above you can see that this figure is clearly way off the mark.

bad-indicator-of-inflation-south-africa-get-the-real-inflation-rate(CPI inflation chart source)

Now there are some costs that went down for example Milk went down due to a price decrease at one of the major stores (all other stores had to drop to compete) and I am assuming that internet and communication costs will go down (ie. their price will remain constant 0%).

There is also looking from a rental perspective that is likely to remain in the 6-7% band. So we will use that with our house price benchmark. As whether you have a bond or are renting it is a similar expense long term.

Real Inflation Calculation

Now to calculate what the Real Inflation rate for South Africa 2016 – 2017 was we need to look at what we will most likely be spending our salaries on, the percentage and also what we are saving / servicing debt for those massive purchases in our lifetime.

First off about half of our salaries go into the home and living expenses. So that is Food, electricity, rates, taxes and sanitation.

A lot of that is spent food and groceries and the other half would be the cost of the home, so that is 30%. So household insurance 1%, 1% electricity and the 5% is rates, taxes, sanitation refuse and water. That comes to 37%.

The other 68% are those big once-off or maintenance purchases. The biggest(most expensive) asset you will probably buy in your lifetime is a house. So we’ll mark that at 25%, as most likely 25% of your entire life’s income up until you buy it will go to paying for a house. School fees at 8% and Car at 7%. Medical aid at 4%, computer at 1% and data at 2% (remember it will not inflate). Gym fees (0.5%), car servicing (1%), car insurance get (1%)  and car licensing get 0.5%. Nb. Transport costs take up much more of the lower income groups salary usage.

So the final calculation:

Real Inflation = 30%(Food inflation) + 1%(Household Insurance) + 1%(Electricity) +5%(Rates, taxes, sanitation, refuse and water) + 27%(house price increase) + 13%(School fees) + 7%(Car) + 9%(Medical Aid) + 1% (Computer) + 2% (Data) + 0.5% (Gym / Other Hobbie) + 2% (Car service) + 1%(car insurance) + 0.5% (Car licensing)

Lets work this out: The Real Inflation value for South Africa 2016

Real Inflation = 30%(10.4) + 1%(9.9) + 1%(7.2) +5%(9.775) + 27%(6.2) + 13%(8.15) + 7%(10.5) + 9%(10.2) + 1% (19.59) + 2% (0) + 0.5% (14.9) + 2% (14.4) + 1%(7) + 0.5% (6)

Real Inflation = 3.12 + 0.099 + 0.072 +0.48875 + 1.674 + 1.0595 + 0.714 + 0.918 + 0.1959 + 0 + 0.0745 + 0.288 + 0.03

Real Inflation = 8.73365%

So not too far off from real CPI. But what does this mean for you…

Let us bring it back home and understand what the true real inflation rate means for you

Say you earn R15000 a month and you got a R1000 increase for the year and a 13th cheque (bonus).

In 2016 you earned: R180000 + a 13th cheqaue, so R195000, in theory or the fantasy world.

In reality you earned: (R 13276 * 11) + R24152 = R170188

Now let us ask what you will be making in 2017.

That is R192000 + 13th cheque = R 208000.

In reality that is: (14069 * 11) + R25532 = R180291

You can use taxtim to help with your personal income calculations

So by how much has your income increased? It has increased by 5.94%

But to just keep your same lifestyle, even though you have another 1 year of experience at your job and all the skill and expertise that comes with that, you will have needed to earn Your old salary + The real inflation rate of 8.73365%

Meaning just to stay constant your increase should total: R185 051. So to hit this figure bang on you need an increase of R1500 and you need to argue the case with your boss. That means your salary is just staying constant, so it is not an increase.

Now I have also accounted for the increase in the house price as an average of house prices and have not accounted for the primate prime lending rate which is currently at 10.5%. You could use this value as a substitute for the house price increase for a possibly even more accurate value.

Summary of 97% Owned Financial Documentary

97% Owned

Seigniorage – a form of fund raising for the government by selling currency to commercial banks.

It created bank notes for 4 pence, and sells the note to bank for 10 pounds, the profit goes straight to treasury and reduces tax burden.

In 10 years the Bank of England raised 18 billion pounds

In 1948 notes and coins were 17% of total money supply

Now notes and coins make up less than 3%. The rest of the money is digital and imaginary…97% owned.

Most money is now digital so it is not the central bank that creates the money it is the commercial/private banks that create the vast majority and decide how and to whom it is loaned to.

Banks create money, they don’t lend it. When you get a loan, the bank just pretends you have deposited the money. It has to invent the liability.

If everyone starts saving, the amount of money in the economy shrinks. We have a recession.

Whoever creates the electronic money gets the proceeds. It is much more profitable than creating cash in the form of notes and coins as with digital money there is zero expense.

Commercial banks have created 1.2 trillion pounds in same time it took the central bank to create 18 billion pounds with hard currency.

Banks create new money by extending credit, buying an existing asset or by making payments on their account.

When a bank buys a company’s bond it adds the bond to it’s assets and increases the company’s deposits by the corresponding amount. In other words, the bank just types in the figure it just bought the bond for on the company’s account and it has acquired the asset. So it has created new money to the value of the bond out of thin air.

People think their personal or household economy works the same way as the national economy.

That is incorrect.

The money is distributed based on the priorities of the banking sector.

If you let bankers control money supply, they will keep creating it. Why would you stop you are creating it from thin air? And it is their prerogative to acquire more loans.

Until there is so much debt that it can’t be paid back.

Money in the current system is debt. So the only way we can have money is if we have borrowed it all from the banks.

We think money is created from hard work, from working in a job. But in reality you would never have got that job without a loan / credit in the first instance.

Then people get over-indebted and cannot repay their debt.

Banks go insolvent and stop lending which causes a recession. People lose jobs and become more indebted to the banks.

If we didn’t bail out the banks it would be a total and complete killer of economic growth or the whole economy, but now there is more debt from bailout.

The only way to stop this is for banks to stop creating money. Private profit seeking banks creating 200 million pounds a year and pumping that into the economy. These private profit seeking banks are putting money into housing bubbles making houses more expensive, making their loans bigger and making more money out of thin air.

Central bank reserves is an electronic version of cash (not the imaginary numbers or bank money the general public use), it is how banks pay each other.

A High street bank will create a bond which is effectively government debt and give it to the central bank and then the central bank will type some numbers into the account for that bank at the bank of england.

So the central bank is creating these reserves out of nothing.

Before the credit crisis if a bank was short of central bank reserves, it could loan reserves from other banks with interest.

When transactions take place they use special money central bank reserves, so you buy a house from another bank they tell central bank to change values of reserves.

If they don’t have enough central bank money, then they can’t make payments and the whole system seized up. So bank must ensure this doesn’t happen.

Banks were allowed to set their own reserve targets each month.

Quantitative easing, is the process of giving commercial banks the reserve currency for free.

So central reserve money is considered real money, but fact is banks can have as much of this as they want now. It is also FIAT money, backed by nothing.

History of money

After world war 2, the UK and USA came together to manage world economies with the IMF and the world bank. At that time there was still a gold standard – Dollars was pegged to gold. And all currencies pegged to the dollar so long as americans played the roll as oversight. Preventing countries not being able to pay their bills / currency collapses. Then Americans started inflating the value of their own currency (To pay for vietnam war).

The French got worried and sent a gun boat to ask for their gold back

FIAT currency – medium of exchange where issuer does not promise to redeem in a commodity and holds its value based on confidence alone.

We believe it is worth something.

Growth and Inflation

A growing economy required growing debt.

Politicians (and many finance and economic professionals) do not realise this.

Money supply can be used to drive growth but it can also be used to inflate asset prices and for market speculation.

Inflation is the general rise in prices of goods and services. It means that each unit of currency is worth less as time passes.

When money supply grows there is more money for investments and growth but there is also more money for market speculation and buying of goods.

Inflation is caused by too much money chasing too few goods and services. When money supply is growing at a faster rate than goods and services.

Recorded / Measured is flawed

CPI is a measure of the increase in price of  basket of goods and services over time. It is deemed to provide a consistently lower figure for inflation. This is because house prices, mortgage repayments and council tax are excluded from the calculation.

RPI retail price index is deemed a better representation of inflation.

The biggest expenditures one makes should be taken into account, like house or car / school fees.

The increase in mortgage/loan on a house does not increase the economic output of a naction. It just increases money supply and hence does not enhance GDP, causing inflation. Banks creating money leads to more speculative credit and higher valuations on safe assets.

You can give a loan to a small business, is more risky as there is less collateral. Giving a Loan to a house, on the other hand, there is collateral. Not productive investments.

Bubbles

High inflation on a specific good or service.

The Tulip mania. The money system is not abstract it has alot to do with nations, power, trade and how they interact.

The ideal attributes for bubble creation: Luxury and Necessity.

Inflation can be avoided if money supply or creation does not exceed the economic output

Argument for government to guide where money should be invested (war economy)

People are getting poorer all the time, money is distributed from the poor to rich.

Every pound of money, has a pound of debt.

Debts from the poor to the rich are set in stone and are now sacred.

The reason the poor are in debt is because the prices have gone out of control and when the system breaks the poors are the ones owing.

Bank Run

You can withdraw all your cash from bank, but this does not reduce digital money supply.

You can stop the monopoly by moving your money into local community banks, not these massive private banks.

International bank run – withdraw from one currency to another, reserve currency shifts from reserve currency to international bank. But not part of their local central bank.

Currency Wars

It will get a trade imbalance.

Spending more than they are earning = trade deficit. Ability to repay debts is questioned. You can devalue your currency so exports increase. Domestic industry demand has grown.

Central bank can sell reserve currency in the market to devalue currency (this reserve is created from nothing, typed into a computer).

Belief is the thing holding up a currency.

Third world debt is used as a form of colonialism, having power of the economy controlling what they do.

IMF tells 3rd world countries that they can pay back their debt by increasing exports so they are earning more dollars so you can pay off your debt. Which is all a lie.

In reality countries cut their government spending and hence they stop growing. So they paid their debts but their own economy was not being developed. So the country becomes poorer and then big corporations come to exploit its natural resources.

These rules imposed by IMF actually destroys local industry and makes more dependent on foreign loans.

Also tell countries to lower tax in multinational corporations.

Also means profits made in country go out and do not help locals.

To manage risk on this unbacked currency you needed derivatives, futures and new markets. Hedging = insuring against your risk.

Derivatives based not on real products were essentially gambling, which changed in the 1960.

Efficient market hypothesis, The theory is that a market regulates itself better than if a government interferes.

The 2008 credit crisis caused that belief to end. Anyone who still believes the market is self regulating is a pencil neck.

Credit default swaps – insurance against companies from going bust – inflated from 1 trillion to 60 trillion in 5 years. But it turns out they don’t provide stability and the maths inside them is completely borked.

Cash is backed up by government debt and government debt is backed up by the ability of government to get money from the public through tax.

System is designed to make a few people very rich at the expense of taxpayers and citizens.

It Lowers standard of living of majority.

Currency Reform

So what can we do…

One hypothesis it to back a currency by renewable energy, which will increase investment in that space.

Banks should have to ask you what they do with your money. They shouldn’t be able to gamble with it.

A safe account and an investment account so banks don’t need to be bailed out by government.

Person to person banking.

We should not ask the banks for advice on how to improve the money system, they are the last people to ask.

You wouldn’t ask a bad house builder advice on how to build a house.