![]() |
ExecScript, run a controler from shell - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: ExecScript, run a controler from shell (/showthread.php?tid=58360) |
ExecScript, run a controler from shell - El Forum - 06-06-2013 [eluser]XMadMax[/eluser] ExecScript can run any controller from command line (windows or linux), and can be the same for development and production environments. Instructions: I normally install codeigniter as follows: application system www Inside www, I modify index.php to refer system_path and application_folder as : Code: $system_path = '../system'; With this configuration, create the directory 'scripts' under your base directory: application www system scripts Inside scripts directory, create a execScript.php file with : Code: #!/usr/local/bin/php You can go to command line to the scripts directory and type: Code: php -q execScript.php welcome myhost.com This is exactlly the same than call: Code: http://myhost.com/welcome |