Laravel Command Memo

Source: Internet
Author: User

New ProjectCD "needs to build the root directory of the project"

composer create-project laravel/laravel=4.2.* “项目名” --prefer-dist

Deployment Projectphp-s localhost: "Port number"-T Public

Loading the custom class folderLocate the Composer.json defined in the
    "AutoLoad": {        "Classmap": [            "Database"            , "App/library/class"        ],        "psr-4": {            "app\\": " app/"        }    },
Execute composer Dumpautoload

Log extension
classsplogger{//all logs are required to be registered here.    ConstLog_error = ' ERROR '; ConstLog_info = ' INFO '; ConstLog_debug = ' DEBUG '; ConstLog_sql = ' SQL '; Private Static $loggers=Array(); //get an instance     Public Static functionGetLogger ($type= Self::log_error,$day= 30)    {        if(Empty(Self::$loggers[$type]) { self::$loggers[$type] =NewWriter (NewLogger ($type));//Self :: $loggers [$type]->usedailyfiles ('/usr/local/spmanaplat '. /logs/'. $type. " Log ', $day);Self::$loggers[$type]->usedailyfiles (Storage_path (). ' /logs/'.$type.‘. Log ',$day); }        $log= Self::$loggers[$type]; return $log; }}
Classpublicapi{ Public Static function Log($log _string)    {//$action = route::current ()->getactionname ()//List ($class, $method) = explode (' @ ', $action);//String split         $log= [            ' Message ' =$log _string,//message' url ' = = Request::url (),//Current Address' Input ' = Input::all (),//Input Parameters' Time ' =Date(' y-m-d h:i:s '),//Time        ]; Splogger:: GetLogger (Splogger::log_debug)->debug ($log); }}

 

Laravel Command Memo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.