Install Dev-Tools Phalcon

Standard

First:

git clone https://github.com/phalcon/phalcon-devtools.git

Installing via Composer

Install composer in a common location or in your project:

curl -s http://getcomposer.org/installer | php

Create the composer.json file as follows:

{
    "require": {
        "phalcon/devtools": "dev-master"
    }
}

If you are still using Phalcon 1.3.x, create a composer.json with the following instead:

{
    "require": {
        "phalcon/devtools": "1.3.*@dev"
    }
}

Run the composer installer:

php composer.phar install

Create a symbolic link to the phalcon.php script:

ln -s ~/devtools/phalcon.php /usr/bin/phalcon
chmod ugo+x /usr/bin/phalcon

How do I change the privileges for MySQL user that is already created?

Standard

To list users:

select user,host from mysql.user;

To show privileges:

show grants for 'user'@'host';

To change privileges, first revoke. Such as:

revoke all privileges on *.* from 'user'@'host';

Then grant the appropriate privileges as desired:

grant SELECT,INSERT,UPDATE,DELETE ON `db`.* TO 'user'@'host';

Table:

GRANTALTER,CREATEON example TO'someuser'@'somehost'

Finally, flush:

flush privileges;

The MySQL documentation is excellent:

http://dev.mysql.com/doc/refman/5.0/en/user-account-management.html

Sample Project mongodb with phalcon Framework

Standard

Selain kemampuannya untuk memetakan tabel dalam database relasional, Phalcon dapat memetakan dokumen dari database NoSQL. ODM menawarkan fungsi CRUD, peristiwa, validasi antara layanan lainnya.

Karena tidak adanya query SQL dan perencana, database NoSQL dapat melihat perbaikan nyata dalam kinerja menggunakan pendekatan Phalcon. Selain itu, tidak ada bangunan SQL mengurangi kemungkinan suntikan SQL.

Untuk terkoneksi dengan mongoDB

Continue reading

dev-tools phalcon

Standard

Sample command:

$ phalcon commands

Phalcon DevTools (1.2.3)

Available commands:
  commands (alias of: list, enumerate)
  controller (alias of: create-controller)
  model (alias of: create-model)
  all-models (alias of: create-all-models)
  project (alias of: create-project)
  scaffold
  migration
  webtools
$ phalcon create-project store

Continue reading

Drop MongoDb

Standard

The drop() Method

MongoDB’s db.collection.drop() is used to drop a collection from the database.

SYNTAX:

Basic syntax of drop() command is as follows

db.COLLECTION_NAME.drop()

EXAMPLE:

Continue reading

Create Collactions

Standard

definisi

db.createCollection (nama, pilihan)
Menciptakan koleksi baru secara eksplisit.

Karena MongoDB menciptakan koleksi secara implisit ketika koleksi pertama dirujuk dalam perintah, metode ini digunakan terutama untuk menciptakan koleksi capped baru. Ini juga digunakan untuk pra-mengalokasikan ruang untuk koleksi biasa.

The db.createCollection () metode memiliki bentuk prototipe berikut:

Continue reading

Drop Database MongoDb

Standard

The dropDatabase() Method

MongoDB db.dropDatabase() command is used to drop a existing database.

SYNTAX:

Basic syntax of dropDatabase() command is as follows:

db.dropDatabase()

This will delete the selected database. If you have not selected any database, then it will delete default ‘test’ database

EXAMPLE:

Continue reading

Create Database MongoDb

Standard

The use Command

MongoDB use DATABASE_NAME is used to create database. The command will create a new database, if it doesn’t exist otherwise it will return the existing database.

SYNTAX:

Basic syntax of use DATABASE statement is as follows:

use DATABASE_NAME

EXAMPLE:

Continue reading

Install MongoDb di Ubuntu

Standard

Install MongoDB

1
Import the public key used by the package management system.

The Ubuntu package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:

sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10

Create a list file for MongoDB:

Continue reading