zendfman
building web applications for fun and profit :)
Homepage: https://zfreak.wordpress.com
SoapFault exception – Zend Framework SOAP client problem
Posted in PHP, Zend Framework on February 20, 2012
Recently I was writing a Soap client for some payment gateway service and came across this excaption:
Fatal error: Uncaught SoapFault exception: [(null)] in ZendFramework-1.11.3/library/Zend/Soap/Client.php:1121
While I tried using native php SOAP client extensions, it worked with no problem. So where is the catch with Zend Framework Soap client?
Soap version! Changing SOAP version to SOAP_1_1 worked like a charm for me.
When reading ZF documentation i have not came across any notation which SOAP version is used by default, so this was a little tricky to guess.
Hope it saves you some time.
hook_install() problem in Drupal – module install not working
Posted in Drupal on November 16, 2011
After wasting some time with install hook, I have finally managed to solve my “problem” why module install
was not working. If you ever face the same problem during your module development, take this into consideration.
Enabling and disabling module is definetly not the same as install and unistall operation. Why?
Druapl remebers and calls hook_install() only for the first time. Changing my database schema file
and then reinstalling (with devel module) was resulting tons of MYSQL errors, which made no real
sense to me at first.
Shell scripting interpreters – 06
Posted in Unix / Linux, UNIX / Linux shell scripting tutorial on May 23, 2011
Script interpreters in shell scripting
If we have written a very handy script and we want to share our script with users that dont use BASH shell, script interpreters comes into play.
Script interpreters comes with their own language syntax and features (perl,php,awk,csh).
When we run our script the following actions are set in place:
1. File is located and opened
2. First characters are examined in order to determine the executable type (binary or script)
3. In case of script (with no interpreter specified), the shell interprets and run the script.
Read the rest of this entry »
How to run a shell script? – 05
Posted in Unix / Linux, UNIX / Linux shell scripting tutorial on May 23, 2011
4 ways how to run a shell script
Running a shell script is an important part of shell scripting. So understanding different ways is a fundamental skill to achieve.
1. ./hello_script.sh
– running script like this from the command line makes a new copy of our shell in the memory while
our previously running shell(login shell) puts on halt until our running script is finished. So we have 2 running shells.
With that in mind is now vital to explain that when we run a script all our variables in the script are temporary for that particular script.
So we cant call our variable produced in our shell script and use it later when the script finish. All these because the shell script is running as a
separated shell which after execution disappears.
Read the rest of this entry »
Shell built-in commands and special shell characters – 04
Posted in Unix / Linux, UNIX / Linux shell scripting tutorial on May 23, 2011
Commands built into shell
For this tutorial demonstration, we will look at two most frequently used built-in commands in a shell programming environment. When command is
built-in to the shell, that simply means that the program we will run cant be found anywhere in our hard drive (like other programs such as: mount, whois, etc.).
read command reads the standard input (ex. keyboard) are stores the information in a shell variable. The most common use of this command is
receiveing anwsers to questions and prompts by the running shell script.
Example:
read age
32
After runing the command read and the ‘age’ variable name, the shell prompts us with a empty line and nothing happens. When we type in for example number 32,
the read command stops leaving no message. Now the command has actually stored our input (number 32) in a ‘age’ variable, which can be used anywhere in
our script. We can test this by typing:
echo $age
32
Read the rest of this entry »
UNIX shell scripting – 03 Writing first shell script?
Posted in UNIX / Linux shell scripting tutorial on April 29, 2011
WRITING FIRST SHELL SCRIPT (beginners tutorial)
Since we have covered some basics in this tutorial on what a shell and a shell script is, lets get do some real stuff – programming. The simplest example of a shell script is just a plain text file containing Unix commands that we wish to run.
This file must be executable (i hope you know how to make one, else I really dont think you should be reading this tutorial).
Read the rest of this entry »
UNIX shell scripting – 02 What is a shell script?
Posted in UNIX / Linux shell scripting tutorial on April 29, 2011
WHAT IS A SHELL SCRIPT?
On Unix systems some files are executable. This files can be thought of as programs. Some of these programs are compiled form source code (C, Pascal).
We call them binary executables.
Example: code written in C language is written in human understandable form. The process of compilation creates a binary executable file which
can be run. When we run this file we execute the code translated (in the process of compilation) in to the machine readable form. Read the rest of this entry »
UNIX shell scripting – 01 What is a shell?
Posted in Unix / Linux, UNIX / Linux shell scripting tutorial on April 24, 2011
The most simple explanation would be: a program that can be used to start other programs or user interface for OS.
All operating systems have shells. If the shell offers the facility to read its commands from a text file, than below mentioned
syntax and features can be thought of as a programming language. Such files can be thought of as a scripts.
In summary a shell is two things: OS user interface and a programming language. BASH shell scripts are equivalent to the BATCH scripts
for the DOS shell. Read the rest of this entry »
UNIX shell scripting – 00 Why learn shell scripting?
Posted in Unix / Linux, UNIX / Linux shell scripting tutorial on April 24, 2011
TUTORIAL ON UNIX SHELL SCRIPTING – BEGINNER LEVEL (Introduction)
I decided to make a short beginners tutorial on how to write shell scripts. So this tutorial will be entirely focused on programming in a BASH shell. Hope you will enjoy it and make some use of it 🙂
Why BASH? Ee, the most popular shell in the world, thats why.
Reasons for using and learning shell scripts:
– Automation: all task that are preformed on a regular basis can be very time consuming. Shell scripts can be written in order to cut down the time of performing such tasks. Read the rest of this entry »