├── .gitignore ├── .puppet ├── .gitignore ├── LICENSE ├── README.md ├── Vagrantfile └── vagrant │ ├── manifests │ ├── app.pp │ ├── config_app_server.class.pp │ ├── package_app_server.class.pp │ ├── package_base.class.pp │ ├── package_dev_tools.class.pp │ └── package_phpunit.class.pp │ └── resources │ ├── apache2-vhost │ ├── apc.conf.php │ ├── apt-config │ ├── mcrypt.ini │ ├── my.cnf │ └── php.ini ├── .travis.yml ├── LICENSE ├── README.md ├── UPGRADE-2.2.md ├── UPGRADE.md ├── Vagrantfile ├── app ├── .htaccess ├── AppCache.php ├── AppKernel.php ├── Resources │ └── views │ │ └── base.html.twig ├── SymfonyRequirements.php ├── autoload.php ├── check.php ├── config │ ├── config.yml │ ├── config_dev.yml │ ├── config_prod.yml │ ├── config_test.yml │ ├── parameters.yml │ ├── routing.yml │ ├── routing_dev.yml │ └── security.yml ├── console ├── phpunit.xml.dist └── serializer │ └── FOSUserBundle │ └── Model.User.yml ├── composer.json ├── composer.lock ├── src ├── .htaccess └── Twitter │ ├── ApiBundle │ ├── Controller │ │ ├── ApiController.php │ │ ├── TweetController.php │ │ └── UserController.php │ ├── DependencyInjection │ │ ├── Configuration.php │ │ └── TwitterApiExtension.php │ ├── EventListener │ │ └── LinkRequestListener.php │ ├── Form │ │ └── Registration.php │ ├── Resources │ │ ├── config │ │ │ ├── routing.yml │ │ │ └── services.xml │ │ ├── doc │ │ │ └── index.rst │ │ └── translations │ │ │ └── messages.fr.xlf │ ├── Tests │ │ └── Controller │ │ │ ├── DefaultControllerTest.php │ │ │ └── TweetControllerTest.php │ └── TwitterApiBundle.php │ └── DomainBundle │ ├── Controller │ └── DefaultController.php │ ├── DependencyInjection │ ├── Configuration.php │ └── TwitterDomainExtension.php │ ├── Entity │ ├── Tweet.php │ ├── TweetRepository.php │ ├── User.php │ └── UserRepository.php │ ├── Resources │ ├── config │ │ ├── routing.yml │ │ └── services.yml │ ├── doc │ │ └── index.rst │ ├── translations │ │ └── messages.fr.xlf │ └── views │ │ └── Default │ │ └── index.html.twig │ ├── Tests │ └── Controller │ │ └── DefaultControllerTest.php │ └── TwitterDomainBundle.php └── web ├── .htaccess ├── app.php ├── app_dev.php ├── apple-touch-icon.png ├── config.php ├── favicon.ico └── robots.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /web/bundles/ 2 | /app/bootstrap.php.cache 3 | /app/cache/* 4 | /app/logs/* 5 | /build/ 6 | /vendor/ 7 | /bin/ 8 | /composer.phar 9 | .vagrant 10 | -------------------------------------------------------------------------------- /.puppet/.gitignore: -------------------------------------------------------------------------------- 1 | /.vagrant 2 | /project 3 | /log 4 | -------------------------------------------------------------------------------- /.puppet/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Andreas Hucks 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /.puppet/README.md: -------------------------------------------------------------------------------- 1 | # What does it do? 2 | 3 | This vagrant configuration sets up a basic LAMP environment suited for Symfony 2 development: 4 | 5 | * Based on Ubuntu Lucid 6 | * Apache 2.2 7 | * PHP 5.3 with intl and readline, xdebug, sqlite extensions 8 | * phpMyAdmin 9 | * MySQL Server 5.1 10 | * Git and SVN clients 11 | 12 | # Prerequisites 13 | 14 | ## Install Vagrant 15 | 16 | Obviously, you need [Vagrant](http://www.vagrantup.com/), which in turn requires Ruby and VirtualBox. Vagrant runs on Linux, OS X, and Windows, although some special configuration applies to Windows (see below). 17 | 18 | ## Download and install a base image 19 | 20 | $ vagrant box add base http://files.vagrantup.com/lucid32.box 21 | 22 | This example uses the default Ubuntu image from the Vagrant project, although you can use other Ubuntu boxes if you like. If you do not name the box "base", you will later on need to adapt the Vagrantfile in the project root directory. 23 | 24 | ## Setup a working directory and start your new environment 25 | 26 | $ git clone git://github.com/meandmymonkey/sf2-vagrant.git mydir 27 | $ cd mydir 28 | $ vagrant up 29 | 30 | Depending on the versions of the box and your VirtualBox installation, you might see a notice that the guest additions of the box do not match the version of VirtualBox you are using. If you encounter any problems, you might want to install up to date guest additions on your box once running and [repackage it for use with Vagrant](http://vagrantup.com/docs/getting-started/packaging.html). 31 | 32 | If you prefer a clean URL, you might want to map `33.33.33.100` to a local domain of your choice in your hosts file. This is entirely optional. 33 | 34 | ## Use it 35 | 36 | ### Webserver 37 | 38 | Vagrant will create two additional directories: 39 | 40 | `mydir/log/apache2` for Apache logs and `mydir/project` for your actual project files 41 | 42 | Drop your Symfony 2 app into the `mydir/project` directory. Apache will use `mydir/project/web` as the web root. 43 | 44 | The app is now accessible from your host system at [http://33.33.33.100](http://33.33.33.100). 45 | 46 | ### MySQL 47 | 48 | The setup will configure MySQL with a user/password of root/root. PhpMyAdmin is at [http://33.33.33.100/phpmyadmin](http://33.33.33.100/phpmyadmin). 49 | 50 | ### SSH and the Symfony console 51 | 52 | Connect to your virtual machine: 53 | 54 | $ vagrant ssh 55 | 56 | Change to your project directory and launch the Symfony shell: 57 | 58 | vagrant@vagrantup:~$ cd /vagrant/project 59 | vagrant@vagrantup:~$ ./app/console -s 60 | 61 | ## Notes 62 | 63 | Vagrant will run on Windows without problems, although this is not tested with this specific configuration. As Windows does not offer NFS, you will however need to comment out the corresponding line in `mydir/Vagrantfile`. 64 | 65 | If you want to use multiple instances of this virtual machine at the same time on a single host, you will need to edit the IP set in `mydir/Vagrantfile` to avoid conflicts. 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /.puppet/Vagrantfile: -------------------------------------------------------------------------------- 1 | 2 | Vagrant::Config.run do |config| 3 | 4 | config.vm.box = "base" 5 | config.vm.network :hostonly, "33.33.33.100" 6 | # remove the next line when running on a windows host system (Windows does not have NFS support) 7 | config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true) 8 | config.vm.provision :puppet do |puppet| 9 | puppet.manifests_path = ".puppet/vagrant/manifests" 10 | puppet.manifest_file = "app.pp" 11 | end 12 | 13 | end 14 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/app.pp: -------------------------------------------------------------------------------- 1 | 2 | import 'package_base.class.pp' 3 | import 'package_dev_tools.class.pp' 4 | import 'package_app_server.class.pp' 5 | import 'package_phpunit.class.pp' 6 | import 'config_app_server.class.pp' 7 | 8 | Class['package_base']->Class['package_dev_tools']->Class['package_app_server']->Class['package_phpunit']->Class['config_app_server'] 9 | 10 | service 11 | { 12 | 'apache2.daemon': 13 | name => 'apache2', 14 | ensure => running, 15 | require => Class['config_app_server'], 16 | } 17 | 18 | Class['config_app_server'] ~> Service['apache2.daemon'] 19 | 20 | include package_base 21 | include package_dev_tools 22 | include package_app_server 23 | include package_phpunit 24 | include config_app_server 25 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/config_app_server.class.pp: -------------------------------------------------------------------------------- 1 | 2 | class config_app_server 3 | { 4 | 5 | file 6 | { 7 | 'apache2.config': 8 | path => '/etc/apache2/sites-available/default', 9 | ensure => present, 10 | source => '/vagrant/.puppet/vagrant/resources/apache2-vhost' 11 | } 12 | 13 | exec 14 | { 15 | 'apache2.mods': 16 | path => '/bin:/usr/bin:/usr/sbin', 17 | command => 'a2enmod rewrite headers', 18 | require => File['apache2.config'] 19 | } 20 | 21 | file 22 | { 23 | 'php5.config': 24 | path => '/etc/php5/apache2/php.ini', 25 | ensure => present, 26 | source => '/vagrant/.puppet/vagrant/resources/php.ini' 27 | } 28 | 29 | file 30 | { 31 | 'php5cli.config': 32 | path => '/etc/php5/cli/php.ini', 33 | ensure => '/etc/php5/apache2/php.ini', 34 | require => File['php5.config'] 35 | } 36 | 37 | exec 38 | { 39 | 'apc.decompress': 40 | unless => '[ -f /usr/share/doc/php-apc/apc.php ]', 41 | command => 'gzip -d /usr/share/doc/php-apc/apc.php.gz', 42 | path => '/bin:/usr/bin' 43 | } 44 | 45 | file 46 | { 47 | 'apc.config': 48 | path => '/usr/share/doc/php-apc/apc.conf.php', 49 | ensure => present, 50 | source => '/vagrant/.puppet/vagrant/resources/apc.conf.php' 51 | } 52 | 53 | # the mcrypt.ini file creates a notice when starting the php.cli, 54 | # removing the comment in the file fixes it 55 | file 56 | { 57 | 'mcrypt.fix': 58 | path => '/etc/php5/conf.d/mcrypt.ini', 59 | ensure => '/vagrant/.puppet/vagrant/resources/mcrypt.ini', 60 | require => File['php5.config'] 61 | } 62 | 63 | file 64 | { 65 | 'phpmyadmin.apacheconfig': 66 | path => '/etc/apache2/conf.d/apache.conf', 67 | ensure => '/etc/phpmyadmin/apache.conf', 68 | require => File['php5.config'] 69 | } 70 | 71 | file 72 | { 73 | 'mysql.config': 74 | path => '/etc/mysql/my.cnf', 75 | ensure => present, 76 | source => '/vagrant/.puppet/vagrant/resources/my.cnf', 77 | } 78 | 79 | exec 80 | { 81 | 'mysql.password': 82 | unless => 'mysqladmin -uroot -proot status', 83 | path => '/bin:/usr/bin', 84 | command => 'mysqladmin -uroot password root', 85 | require => File['mysql.config'] 86 | } 87 | 88 | # this creates outer access with username root and no password 89 | exec 90 | { 91 | 'mysql.permissions': 92 | path => '/bin:/usr/bin', 93 | command => 'mysql -uroot -proot -e "GRANT ALL PRIVILEGES ON *.* TO \'root\'@\'%\' WITH GRANT OPTION;"', 94 | require => Exec['mysql.password'] 95 | } 96 | 97 | file 98 | { 99 | 'project.basedir': 100 | path => '/vagrant/project', 101 | ensure => directory 102 | } 103 | 104 | file 105 | { 106 | 'system.logdir': 107 | path => '/vagrant/app/log', 108 | ensure => directory 109 | } 110 | 111 | file 112 | { 113 | 'apache.logdir': 114 | path => '/vagrant/app/log/apache2', 115 | ensure => directory, 116 | require => File['system.logdir'] 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/package_app_server.class.pp: -------------------------------------------------------------------------------- 1 | 2 | class package_app_server 3 | { 4 | 5 | package 6 | { 7 | 'nfs-kernel-server': 8 | ensure => present, 9 | } 10 | 11 | service 12 | { 13 | 'nfs-kernel-server': 14 | ensure => running, 15 | enable => true, 16 | hasstatus => true, 17 | require => Package['nfs-kernel-server'], 18 | } 19 | 20 | package 21 | { 22 | 'sendmail': 23 | ensure => present 24 | } 25 | 26 | package 27 | { 28 | 'mysql-server': 29 | ensure => present 30 | } 31 | 32 | package 33 | { 34 | 'mysql-client': 35 | ensure => present 36 | } 37 | 38 | package 39 | { 40 | 'apache2': 41 | ensure => present, 42 | require => Package['mysql-server'] 43 | } 44 | 45 | package 46 | { 47 | 'php5': 48 | ensure => present, 49 | require => Package['apache2'] 50 | } 51 | 52 | package 53 | { 54 | 'php-apc': 55 | ensure => present, 56 | require => Package['php5'] 57 | } 58 | 59 | package 60 | { 61 | 'php5-xdebug': 62 | ensure => present, 63 | require => Package['php5'] 64 | } 65 | 66 | package 67 | { 68 | 'php5-curl': 69 | ensure => present, 70 | require => Package['php5'] 71 | } 72 | 73 | package 74 | { 75 | 'php5-sqlite': 76 | ensure => present, 77 | require => Package['php5'] 78 | } 79 | 80 | package 81 | { 82 | 'phpmyadmin': 83 | ensure => present, 84 | require => Package['php5'] 85 | } 86 | 87 | package 88 | { 89 | 'php5-cli': 90 | ensure => present, 91 | require => Package['php5'] 92 | } 93 | 94 | package 95 | { 96 | 'php-pear': 97 | ensure => present, 98 | require => Package['php5-cli'] 99 | } 100 | 101 | package 102 | { 103 | 'default-jre': 104 | ensure => present 105 | } 106 | 107 | package 108 | { 109 | 'zip': 110 | ensure => present 111 | } 112 | 113 | file 114 | { 115 | 'pear.tmpdirfix.prepare': 116 | ensure => directory, 117 | path => '/tmp/pear', 118 | require => Package['php-pear'] 119 | } 120 | 121 | file 122 | { 123 | 'pear.tmpdirfix': 124 | ensure => directory, 125 | path => '/tmp/pear/cache', 126 | mode => 777, 127 | require => File['pear.tmpdirfix.prepare'] 128 | } 129 | 130 | exec 131 | { 132 | 'pear.upgrade.pear': 133 | path => '/bin:/usr/bin:/usr/sbin', 134 | command => 'pear upgrade PEAR', 135 | require => File['pear.tmpdirfix'] 136 | } 137 | 138 | file 139 | { 140 | '/vagrant/app/logs/apache2': 141 | ensure => "directory" 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/package_base.class.pp: -------------------------------------------------------------------------------- 1 | class package_base 2 | { 3 | group { 4 | "puppet": ensure => "present"; 5 | } 6 | 7 | file 8 | { 9 | 'apt.config': 10 | path => '/etc/apt/apt.conf.d/99aptcache', 11 | ensure => present, 12 | source => '/vagrant/.puppet/vagrant/resources/apt-config' 13 | } 14 | 15 | exec 16 | { 17 | 'init': 18 | command => 'apt-get update', 19 | path => '/usr/bin/', 20 | require => File['apt.config'] 21 | } 22 | 23 | package 24 | { 25 | 'htop': 26 | ensure => present, 27 | require => Exec['init'] 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/package_dev_tools.class.pp: -------------------------------------------------------------------------------- 1 | 2 | class package_dev_tools 3 | { 4 | 5 | package 6 | { 7 | 'git-core': 8 | ensure => present 9 | } 10 | 11 | package 12 | { 13 | 'subversion': 14 | ensure => present 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /.puppet/vagrant/manifests/package_phpunit.class.pp: -------------------------------------------------------------------------------- 1 | 2 | class package_phpunit 3 | { 4 | 5 | package 6 | { 7 | 'phpunit': 8 | ensure => present, 9 | require => Package['php5'] 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.puppet/vagrant/resources/apache2-vhost: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin webmaster@localhost 3 | 4 | DocumentRoot /vagrant/web 5 | 6 | Options FollowSymLinks 7 | AllowOverride All 8 | 9 | 10 | 11 | Header set Cache-Control "no-cache, no-store" 12 | Options Indexes FollowSymLinks MultiViews 13 | AllowOverride All 14 | Order allow,deny 15 | allow from all 16 | 17 | 18 | ErrorLog /vagrant/app/log/apache2/error.log 19 | 20 | # Possible values include: debug, info, notice, warn, error, crit, 21 | # alert, emerg. 22 | LogLevel warn 23 | 24 | CustomLog /vagrant/app/log/apache2/access.log combined 25 | 26 | # APC 27 | Alias /apc /usr/share/doc/php-apc/ 28 | 29 | 30 | Options FollowSymLinks 31 | DirectoryIndex apc.php 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.puppet/vagrant/resources/apc.conf.php: -------------------------------------------------------------------------------- 1 | tags as PHP source which should be processed as such. It's been 216 | ; recommended for several years that you not use the short tag "short cut" and 217 | ; instead to use the full tag combination. With the wide spread use 218 | ; of XML and use of these tags by other languages, the server can become easily 219 | ; confused and end up parsing the wrong code in the wrong context. But because 220 | ; this short cut has been a feature for such a long time, it's currently still 221 | ; supported for backwards compatibility, but we recommend you don't use them. 222 | ; Default Value: On 223 | ; Development Value: Off 224 | ; Production Value: Off 225 | ; http://php.net/short-open-tag 226 | short_open_tag = Off 227 | 228 | ; Allow ASP-style <% %> tags. 229 | ; http://php.net/asp-tags 230 | asp_tags = Off 231 | 232 | ; The number of significant digits displayed in floating point numbers. 233 | ; http://php.net/precision 234 | precision = 14 235 | 236 | ; Enforce year 2000 compliance (will cause problems with non-compliant browsers) 237 | ; http://php.net/y2k-compliance 238 | y2k_compliance = On 239 | 240 | ; Output buffering is a mechanism for controlling how much output data 241 | ; (excluding headers and cookies) PHP should keep internally before pushing that 242 | ; data to the client. If your application's output exceeds this setting, PHP 243 | ; will send that data in chunks of roughly the size you specify. 244 | ; Turning on this setting and managing its maximum buffer size can yield some 245 | ; interesting side-effects depending on your application and web server. 246 | ; You may be able to send headers and cookies after you've already sent output 247 | ; through print or echo. You also may see performance benefits if your server is 248 | ; emitting less packets due to buffered output versus PHP streaming the output 249 | ; as it gets it. On production servers, 4096 bytes is a good setting for performance 250 | ; reasons. 251 | ; Note: Output buffering can also be controlled via Output Buffering Control 252 | ; functions. 253 | ; Possible Values: 254 | ; On = Enabled and buffer is unlimited. (Use with caution) 255 | ; Off = Disabled 256 | ; Integer = Enables the buffer and sets its maximum size in bytes. 257 | ; Note: This directive is hardcoded to Off for the CLI SAPI 258 | ; Default Value: Off 259 | ; Development Value: 4096 260 | ; Production Value: 4096 261 | ; http://php.net/output-buffering 262 | output_buffering = 4096 263 | 264 | ; You can redirect all of the output of your scripts to a function. For 265 | ; example, if you set output_handler to "mb_output_handler", character 266 | ; encoding will be transparently converted to the specified encoding. 267 | ; Setting any output handler automatically turns on output buffering. 268 | ; Note: People who wrote portable scripts should not depend on this ini 269 | ; directive. Instead, explicitly set the output handler using ob_start(). 270 | ; Using this ini directive may cause problems unless you know what script 271 | ; is doing. 272 | ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" 273 | ; and you cannot use both "ob_gzhandler" and "zlib.output_compression". 274 | ; Note: output_handler must be empty if this is set 'On' !!!! 275 | ; Instead you must use zlib.output_handler. 276 | ; http://php.net/output-handler 277 | ;output_handler = 278 | 279 | ; Transparent output compression using the zlib library 280 | ; Valid values for this option are 'off', 'on', or a specific buffer size 281 | ; to be used for compression (default is 4KB) 282 | ; Note: Resulting chunk size may vary due to nature of compression. PHP 283 | ; outputs chunks that are few hundreds bytes each as a result of 284 | ; compression. If you prefer a larger chunk size for better 285 | ; performance, enable output_buffering in addition. 286 | ; Note: You need to use zlib.output_handler instead of the standard 287 | ; output_handler, or otherwise the output will be corrupted. 288 | ; http://php.net/zlib.output-compression 289 | zlib.output_compression = Off 290 | 291 | ; http://php.net/zlib.output-compression-level 292 | ;zlib.output_compression_level = -1 293 | 294 | ; You cannot specify additional output handlers if zlib.output_compression 295 | ; is activated here. This setting does the same as output_handler but in 296 | ; a different order. 297 | ; http://php.net/zlib.output-handler 298 | ;zlib.output_handler = 299 | 300 | ; Implicit flush tells PHP to tell the output layer to flush itself 301 | ; automatically after every output block. This is equivalent to calling the 302 | ; PHP function flush() after each and every call to print() or echo() and each 303 | ; and every HTML block. Turning this option on has serious performance 304 | ; implications and is generally recommended for debugging purposes only. 305 | ; http://php.net/implicit-flush 306 | ; Note: This directive is hardcoded to On for the CLI SAPI 307 | implicit_flush = Off 308 | 309 | ; The unserialize callback function will be called (with the undefined class' 310 | ; name as parameter), if the unserializer finds an undefined class 311 | ; which should be instantiated. A warning appears if the specified function is 312 | ; not defined, or if the function doesn't include/implement the missing class. 313 | ; So only set this entry, if you really want to implement such a 314 | ; callback-function. 315 | unserialize_callback_func = 316 | 317 | ; When floats & doubles are serialized store serialize_precision significant 318 | ; digits after the floating point. The default value ensures that when floats 319 | ; are decoded with unserialize, the data will remain the same. 320 | serialize_precision = 100 321 | 322 | ; This directive allows you to enable and disable warnings which PHP will issue 323 | ; if you pass a value by reference at function call time. Passing values by 324 | ; reference at function call time is a deprecated feature which will be removed 325 | ; from PHP at some point in the near future. The acceptable method for passing a 326 | ; value by reference to a function is by declaring the reference in the functions 327 | ; definition, not at call time. This directive does not disable this feature, it 328 | ; only determines whether PHP will warn you about it or not. These warnings 329 | ; should enabled in development environments only. 330 | ; Default Value: On (Suppress warnings) 331 | ; Development Value: Off (Issue warnings) 332 | ; Production Value: Off (Issue warnings) 333 | ; http://php.net/allow-call-time-pass-reference 334 | allow_call_time_pass_reference = Off 335 | 336 | ; Safe Mode 337 | ; http://php.net/safe-mode 338 | safe_mode = Off 339 | 340 | ; By default, Safe Mode does a UID compare check when 341 | ; opening files. If you want to relax this to a GID compare, 342 | ; then turn on safe_mode_gid. 343 | ; http://php.net/safe-mode-gid 344 | safe_mode_gid = Off 345 | 346 | ; When safe_mode is on, UID/GID checks are bypassed when 347 | ; including files from this directory and its subdirectories. 348 | ; (directory must also be in include_path or full path must 349 | ; be used when including) 350 | ; http://php.net/safe-mode-include-dir 351 | safe_mode_include_dir = 352 | 353 | ; When safe_mode is on, only executables located in the safe_mode_exec_dir 354 | ; will be allowed to be executed via the exec family of functions. 355 | ; http://php.net/safe-mode-exec-dir 356 | safe_mode_exec_dir = 357 | 358 | ; Setting certain environment variables may be a potential security breach. 359 | ; This directive contains a comma-delimited list of prefixes. In Safe Mode, 360 | ; the user may only alter environment variables whose names begin with the 361 | ; prefixes supplied here. By default, users will only be able to set 362 | ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR). 363 | ; Note: If this directive is empty, PHP will let the user modify ANY 364 | ; environment variable! 365 | ; http://php.net/safe-mode-allowed-env-vars 366 | safe_mode_allowed_env_vars = PHP_ 367 | 368 | ; This directive contains a comma-delimited list of environment variables that 369 | ; the end user won't be able to change using putenv(). These variables will be 370 | ; protected even if safe_mode_allowed_env_vars is set to allow to change them. 371 | ; http://php.net/safe-mode-protected-env-vars 372 | safe_mode_protected_env_vars = LD_LIBRARY_PATH 373 | 374 | ; open_basedir, if set, limits all file operations to the defined directory 375 | ; and below. This directive makes most sense if used in a per-directory 376 | ; or per-virtualhost web server configuration file. This directive is 377 | ; *NOT* affected by whether Safe Mode is turned On or Off. 378 | ; http://php.net/open-basedir 379 | ;open_basedir = 380 | 381 | ; This directive allows you to disable certain functions for security reasons. 382 | ; It receives a comma-delimited list of function names. This directive is 383 | ; *NOT* affected by whether Safe Mode is turned On or Off. 384 | ; http://php.net/disable-functions 385 | disable_functions = 386 | 387 | ; This directive allows you to disable certain classes for security reasons. 388 | ; It receives a comma-delimited list of class names. This directive is 389 | ; *NOT* affected by whether Safe Mode is turned On or Off. 390 | ; http://php.net/disable-classes 391 | disable_classes = 392 | 393 | ; Colors for Syntax Highlighting mode. Anything that's acceptable in 394 | ; would work. 395 | ; http://php.net/syntax-highlighting 396 | ;highlight.string = #DD0000 397 | ;highlight.comment = #FF9900 398 | ;highlight.keyword = #007700 399 | ;highlight.bg = #FFFFFF 400 | ;highlight.default = #0000BB 401 | ;highlight.html = #000000 402 | 403 | ; If enabled, the request will be allowed to complete even if the user aborts 404 | ; the request. Consider enabling it if executing long requests, which may end up 405 | ; being interrupted by the user or a browser timing out. PHP's default behavior 406 | ; is to disable this feature. 407 | ; http://php.net/ignore-user-abort 408 | ;ignore_user_abort = On 409 | 410 | ; Determines the size of the realpath cache to be used by PHP. This value should 411 | ; be increased on systems where PHP opens many files to reflect the quantity of 412 | ; the file operations performed. 413 | ; http://php.net/realpath-cache-size 414 | ;realpath_cache_size = 16k 415 | 416 | ; Duration of time, in seconds for which to cache realpath information for a given 417 | ; file or directory. For systems with rarely changing files, consider increasing this 418 | ; value. 419 | ; http://php.net/realpath-cache-ttl 420 | ;realpath_cache_ttl = 120 421 | 422 | ;;;;;;;;;;;;;;;;; 423 | ; Miscellaneous ; 424 | ;;;;;;;;;;;;;;;;; 425 | 426 | ; Decides whether PHP may expose the fact that it is installed on the server 427 | ; (e.g. by adding its signature to the Web server header). It is no security 428 | ; threat in any way, but it makes it possible to determine whether you use PHP 429 | ; on your server or not. 430 | ; http://php.net/expose-php 431 | expose_php = On 432 | 433 | ;;;;;;;;;;;;;;;;;;; 434 | ; Resource Limits ; 435 | ;;;;;;;;;;;;;;;;;;; 436 | 437 | ; Maximum execution time of each script, in seconds 438 | ; http://php.net/max-execution-time 439 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 440 | max_execution_time = 30 441 | 442 | ; Maximum amount of time each script may spend parsing request data. It's a good 443 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 444 | ; long running scripts. 445 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 446 | ; Default Value: -1 (Unlimited) 447 | ; Development Value: 60 (60 seconds) 448 | ; Production Value: 60 (60 seconds) 449 | ; http://php.net/max-input-time 450 | max_input_time = 60 451 | 452 | ; Maximum input variable nesting level 453 | ; http://php.net/max-input-nesting-level 454 | ;max_input_nesting_level = 64 455 | 456 | ; Maximum amount of memory a script may consume (128MB) 457 | ; http://php.net/memory-limit 458 | memory_limit = 128M 459 | 460 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 461 | ; Error handling and logging ; 462 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 463 | 464 | ; This directive informs PHP of which errors, warnings and notices you would like 465 | ; it to take action for. The recommended way of setting values for this 466 | ; directive is through the use of the error level constants and bitwise 467 | ; operators. The error level constants are below here for convenience as well as 468 | ; some common settings and their meanings. 469 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 470 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 471 | ; recommended coding standards in PHP. For performance reasons, this is the 472 | ; recommend error reporting setting. Your production server shouldn't be wasting 473 | ; resources complaining about best practices and coding standards. That's what 474 | ; development servers and development settings are for. 475 | ; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This 476 | ; means it pretty much reports everything which is exactly what you want during 477 | ; development and early testing. 478 | ; 479 | ; Error Level Constants: 480 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0) 481 | ; E_ERROR - fatal run-time errors 482 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 483 | ; E_WARNING - run-time warnings (non-fatal errors) 484 | ; E_PARSE - compile-time parse errors 485 | ; E_NOTICE - run-time notices (these are warnings which often result 486 | ; from a bug in your code, but it's possible that it was 487 | ; intentional (e.g., using an uninitialized variable and 488 | ; relying on the fact it's automatically initialized to an 489 | ; empty string) 490 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 491 | ; to your code which will ensure the best interoperability 492 | ; and forward compatibility of your code 493 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 494 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 495 | ; initial startup 496 | ; E_COMPILE_ERROR - fatal compile-time errors 497 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 498 | ; E_USER_ERROR - user-generated error message 499 | ; E_USER_WARNING - user-generated warning message 500 | ; E_USER_NOTICE - user-generated notice message 501 | ; E_DEPRECATED - warn about code that will not work in future versions 502 | ; of PHP 503 | ; E_USER_DEPRECATED - user-generated deprecation warnings 504 | ; 505 | ; Common Values: 506 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.) 507 | ; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices) 508 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 509 | ; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.) 510 | ; Default Value: E_ALL & ~E_NOTICE 511 | ; Development Value: E_ALL | E_STRICT 512 | ; Production Value: E_ALL & ~E_DEPRECATED 513 | ; http://php.net/error-reporting 514 | error_reporting = E_ALL & ~E_DEPRECATED 515 | 516 | ; This directive controls whether or not and where PHP will output errors, 517 | ; notices and warnings too. Error output is very useful during development, but 518 | ; it could be very dangerous in production environments. Depending on the code 519 | ; which is triggering the error, sensitive information could potentially leak 520 | ; out of your application such as database usernames and passwords or worse. 521 | ; It's recommended that errors be logged on production servers rather than 522 | ; having the errors sent to STDOUT. 523 | ; Possible Values: 524 | ; Off = Do not display any errors 525 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 526 | ; On or stdout = Display errors to STDOUT 527 | ; Default Value: On 528 | ; Development Value: On 529 | ; Production Value: Off 530 | ; http://php.net/display-errors 531 | display_errors = Off 532 | 533 | ; The display of errors which occur during PHP's startup sequence are handled 534 | ; separately from display_errors. PHP's default behavior is to suppress those 535 | ; errors from clients. Turning the display of startup errors on can be useful in 536 | ; debugging configuration problems. But, it's strongly recommended that you 537 | ; leave this setting off on production servers. 538 | ; Default Value: Off 539 | ; Development Value: On 540 | ; Production Value: Off 541 | ; http://php.net/display-startup-errors 542 | display_startup_errors = Off 543 | 544 | ; Besides displaying errors, PHP can also log errors to locations such as a 545 | ; server-specific log, STDERR, or a location specified by the error_log 546 | ; directive found below. While errors should not be displayed on productions 547 | ; servers they should still be monitored and logging is a great way to do that. 548 | ; Default Value: Off 549 | ; Development Value: On 550 | ; Production Value: On 551 | ; http://php.net/log-errors 552 | log_errors = On 553 | 554 | ; Set maximum length of log_errors. In error_log information about the source is 555 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 556 | ; http://php.net/log-errors-max-len 557 | log_errors_max_len = 1024 558 | 559 | ; Do not log repeated messages. Repeated errors must occur in same file on same 560 | ; line unless ignore_repeated_source is set true. 561 | ; http://php.net/ignore-repeated-errors 562 | ignore_repeated_errors = Off 563 | 564 | ; Ignore source of message when ignoring repeated messages. When this setting 565 | ; is On you will not log errors with repeated messages from different files or 566 | ; source lines. 567 | ; http://php.net/ignore-repeated-source 568 | ignore_repeated_source = Off 569 | 570 | ; If this parameter is set to Off, then memory leaks will not be shown (on 571 | ; stdout or in the log). This has only effect in a debug compile, and if 572 | ; error reporting includes E_WARNING in the allowed list 573 | ; http://php.net/report-memleaks 574 | report_memleaks = On 575 | 576 | ; This setting is on by default. 577 | ;report_zend_debug = 0 578 | 579 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 580 | ; to On can assist in debugging and is appropriate for development servers. It should 581 | ; however be disabled on production servers. 582 | ; Default Value: Off 583 | ; Development Value: On 584 | ; Production Value: Off 585 | ; http://php.net/track-errors 586 | track_errors = Off 587 | 588 | ; Turn off normal error reporting and emit XML-RPC error XML 589 | ; http://php.net/xmlrpc-errors 590 | ;xmlrpc_errors = 0 591 | 592 | ; An XML-RPC faultCode 593 | ;xmlrpc_error_number = 0 594 | 595 | ; When PHP displays or logs an error, it has the capability of inserting html 596 | ; links to documentation related to that error. This directive controls whether 597 | ; those HTML links appear in error messages or not. For performance and security 598 | ; reasons, it's recommended you disable this on production servers. 599 | ; Note: This directive is hardcoded to Off for the CLI SAPI 600 | ; Default Value: On 601 | ; Development Value: On 602 | ; Production value: Off 603 | ; http://php.net/html-errors 604 | html_errors = On 605 | 606 | ; If html_errors is set On PHP produces clickable error messages that direct 607 | ; to a page describing the error or function causing the error in detail. 608 | ; You can download a copy of the PHP manual from http://php.net/docs 609 | ; and change docref_root to the base URL of your local copy including the 610 | ; leading '/'. You must also specify the file extension being used including 611 | ; the dot. PHP's default behavior is to leave these settings empty. 612 | ; Note: Never use this feature for production boxes. 613 | ; http://php.net/docref-root 614 | ; Examples 615 | ;docref_root = "/phpmanual/" 616 | 617 | ; http://php.net/docref-ext 618 | ;docref_ext = .html 619 | 620 | ; String to output before an error message. PHP's default behavior is to leave 621 | ; this setting blank. 622 | ; http://php.net/error-prepend-string 623 | ; Example: 624 | ;error_prepend_string = "" 625 | 626 | ; String to output after an error message. PHP's default behavior is to leave 627 | ; this setting blank. 628 | ; http://php.net/error-append-string 629 | ; Example: 630 | ;error_append_string = "" 631 | 632 | ; Log errors to specified file. PHP's default behavior is to leave this value 633 | ; empty. 634 | ; http://php.net/error-log 635 | ; Example: 636 | ;error_log = php_errors.log 637 | ; Log errors to syslog (Event Log on NT, not valid in Windows 95). 638 | ;error_log = syslog 639 | 640 | ;;;;;;;;;;;;;;;;; 641 | ; Data Handling ; 642 | ;;;;;;;;;;;;;;;;; 643 | 644 | ; The separator used in PHP generated URLs to separate arguments. 645 | ; PHP's default setting is "&". 646 | ; http://php.net/arg-separator.output 647 | ; Example: 648 | ;arg_separator.output = "&" 649 | 650 | ; List of separator(s) used by PHP to parse input URLs into variables. 651 | ; PHP's default setting is "&". 652 | ; NOTE: Every character in this directive is considered as separator! 653 | ; http://php.net/arg-separator.input 654 | ; Example: 655 | ;arg_separator.input = ";&" 656 | 657 | ; This directive determines which super global arrays are registered when PHP 658 | ; starts up. If the register_globals directive is enabled, it also determines 659 | ; what order variables are populated into the global space. G,P,C,E & S are 660 | ; abbreviations for the following respective super globals: GET, POST, COOKIE, 661 | ; ENV and SERVER. There is a performance penalty paid for the registration of 662 | ; these arrays and because ENV is not as commonly used as the others, ENV is 663 | ; is not recommended on productions servers. You can still get access to 664 | ; the environment variables through getenv() should you need to. 665 | ; Default Value: "EGPCS" 666 | ; Development Value: "GPCS" 667 | ; Production Value: "GPCS"; 668 | ; http://php.net/variables-order 669 | variables_order = "GPCS" 670 | 671 | ; This directive determines which super global data (G,P,C,E & S) should 672 | ; be registered into the super global array REQUEST. If so, it also determines 673 | ; the order in which that data is registered. The values for this directive are 674 | ; specified in the same manner as the variables_order directive, EXCEPT one. 675 | ; Leaving this value empty will cause PHP to use the value set in the 676 | ; variables_order directive. It does not mean it will leave the super globals 677 | ; array REQUEST empty. 678 | ; Default Value: None 679 | ; Development Value: "GP" 680 | ; Production Value: "GP" 681 | ; http://php.net/request-order 682 | request_order = "GP" 683 | 684 | ; Whether or not to register the EGPCS variables as global variables. You may 685 | ; want to turn this off if you don't want to clutter your scripts' global scope 686 | ; with user data. 687 | ; You should do your best to write your scripts so that they do not require 688 | ; register_globals to be on; Using form variables as globals can easily lead 689 | ; to possible security problems, if the code is not very well thought of. 690 | ; http://php.net/register-globals 691 | register_globals = Off 692 | 693 | ; Determines whether the deprecated long $HTTP_*_VARS type predefined variables 694 | ; are registered by PHP or not. As they are deprecated, we obviously don't 695 | ; recommend you use them. They are on by default for compatibility reasons but 696 | ; they are not recommended on production servers. 697 | ; Default Value: On 698 | ; Development Value: Off 699 | ; Production Value: Off 700 | ; http://php.net/register-long-arrays 701 | register_long_arrays = Off 702 | 703 | ; This directive determines whether PHP registers $argv & $argc each time it 704 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 705 | ; is invoked. $argc contains an integer representing the number of arguments 706 | ; that were passed when the script was invoked. These arrays are extremely 707 | ; useful when running scripts from the command line. When this directive is 708 | ; enabled, registering these variables consumes CPU cycles and memory each time 709 | ; a script is executed. For performance reasons, this feature should be disabled 710 | ; on production servers. 711 | ; Note: This directive is hardcoded to On for the CLI SAPI 712 | ; Default Value: On 713 | ; Development Value: Off 714 | ; Production Value: Off 715 | ; http://php.net/register-argc-argv 716 | register_argc_argv = Off 717 | 718 | ; When enabled, the SERVER and ENV variables are created when they're first 719 | ; used (Just In Time) instead of when the script starts. If these variables 720 | ; are not used within a script, having this directive on will result in a 721 | ; performance gain. The PHP directives register_globals, register_long_arrays, 722 | ; and register_argc_argv must be disabled for this directive to have any affect. 723 | ; http://php.net/auto-globals-jit 724 | auto_globals_jit = On 725 | 726 | ; Maximum size of POST data that PHP will accept. 727 | ; http://php.net/post-max-size 728 | post_max_size = 8M 729 | 730 | ; Magic quotes are a preprocessing feature of PHP where PHP will attempt to 731 | ; escape any character sequences in GET, POST, COOKIE and ENV data which might 732 | ; otherwise corrupt data being placed in resources such as databases before 733 | ; making that data available to you. Because of character encoding issues and 734 | ; non-standard SQL implementations across many databases, it's not currently 735 | ; possible for this feature to be 100% accurate. PHP's default behavior is to 736 | ; enable the feature. We strongly recommend you use the escaping mechanisms 737 | ; designed specifically for the database your using instead of relying on this 738 | ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is 739 | ; scheduled for removal in PHP 6. 740 | ; Default Value: On 741 | ; Development Value: Off 742 | ; Production Value: Off 743 | ; http://php.net/magic-quotes-gpc 744 | magic_quotes_gpc = Off 745 | 746 | ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc. 747 | ; http://php.net/magic-quotes-runtime 748 | magic_quotes_runtime = Off 749 | 750 | ; Use Sybase-style magic quotes (escape ' with '' instead of \'). 751 | ; http://php.net/magic-quotes-sybase 752 | magic_quotes_sybase = Off 753 | 754 | ; Automatically add files before PHP document. 755 | ; http://php.net/auto-prepend-file 756 | auto_prepend_file = 757 | 758 | ; Automatically add files after PHP document. 759 | ; http://php.net/auto-append-file 760 | auto_append_file = 761 | 762 | ; By default, PHP will output a character encoding using 763 | ; the Content-type: header. To disable sending of the charset, simply 764 | ; set it to be empty. 765 | ; 766 | ; PHP's built-in default is text/html 767 | ; http://php.net/default-mimetype 768 | default_mimetype = "text/html" 769 | 770 | ; PHP's default character set is set to empty. 771 | ; http://php.net/default-charset 772 | ;default_charset = "iso-8859-1" 773 | 774 | ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is 775 | ; to disable this feature. 776 | ; http://php.net/always-populate-raw-post-data 777 | ;always_populate_raw_post_data = On 778 | 779 | ;;;;;;;;;;;;;;;;;;;;;;;;; 780 | ; Paths and Directories ; 781 | ;;;;;;;;;;;;;;;;;;;;;;;;; 782 | 783 | ; UNIX: "/path1:/path2" 784 | ;include_path = ".:/usr/share/php" 785 | ; 786 | ; Windows: "\path1;\path2" 787 | ;include_path = ".;c:\php\includes" 788 | ; 789 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 790 | ; http://php.net/include-path 791 | 792 | ; The root of the PHP pages, used only if nonempty. 793 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 794 | ; if you are running php as a CGI under any web server (other than IIS) 795 | ; see documentation for security issues. The alternate is to use the 796 | ; cgi.force_redirect configuration below 797 | ; http://php.net/doc-root 798 | doc_root = 799 | 800 | ; The directory under which PHP opens the script using /~username used only 801 | ; if nonempty. 802 | ; http://php.net/user-dir 803 | user_dir = 804 | 805 | ; Directory in which the loadable extensions (modules) reside. 806 | ; http://php.net/extension-dir 807 | ; extension_dir = "/usr/lib/php5/20090626" 808 | ; On windows: 809 | ; extension_dir = "ext" 810 | 811 | ; Whether or not to enable the dl() function. The dl() function does NOT work 812 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 813 | ; disabled on them. 814 | ; http://php.net/enable-dl 815 | enable_dl = Off 816 | 817 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 818 | ; most web servers. Left undefined, PHP turns this on by default. You can 819 | ; turn it off here AT YOUR OWN RISK 820 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 821 | ; http://php.net/cgi.force-redirect 822 | ;cgi.force_redirect = 1 823 | 824 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 825 | ; every request. PHP's default behavior is to disable this feature. 826 | ;cgi.nph = 1 827 | 828 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 829 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 830 | ; will look for to know it is OK to continue execution. Setting this variable MAY 831 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 832 | ; http://php.net/cgi.redirect-status-env 833 | ;cgi.redirect_status_env = ; 834 | 835 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 836 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 837 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 838 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 839 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 840 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 841 | ; http://php.net/cgi.fix-pathinfo 842 | ;cgi.fix_pathinfo=1 843 | 844 | ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate 845 | ; security tokens of the calling client. This allows IIS to define the 846 | ; security context that the request runs under. mod_fastcgi under Apache 847 | ; does not currently support this feature (03/17/2002) 848 | ; Set to 1 if running under IIS. Default is zero. 849 | ; http://php.net/fastcgi.impersonate 850 | ;fastcgi.impersonate = 1; 851 | 852 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 853 | ; this feature. 854 | ;fastcgi.logging = 0 855 | 856 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 857 | ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that 858 | ; is supported by Apache. When this option is set to 1 PHP will send 859 | ; RFC2616 compliant header. 860 | ; Default is zero. 861 | ; http://php.net/cgi.rfc2616-headers 862 | ;cgi.rfc2616_headers = 0 863 | 864 | ;;;;;;;;;;;;;;;; 865 | ; File Uploads ; 866 | ;;;;;;;;;;;;;;;; 867 | 868 | ; Whether to allow HTTP file uploads. 869 | ; http://php.net/file-uploads 870 | file_uploads = On 871 | 872 | ; Temporary directory for HTTP uploaded files (will use system default if not 873 | ; specified). 874 | ; http://php.net/upload-tmp-dir 875 | ;upload_tmp_dir = 876 | 877 | ; Maximum allowed size for uploaded files. 878 | ; http://php.net/upload-max-filesize 879 | upload_max_filesize = 2M 880 | 881 | ; Maximum number of files that can be uploaded via a single request 882 | max_file_uploads = 20 883 | 884 | ;;;;;;;;;;;;;;;;;; 885 | ; Fopen wrappers ; 886 | ;;;;;;;;;;;;;;;;;; 887 | 888 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 889 | ; http://php.net/allow-url-fopen 890 | allow_url_fopen = On 891 | 892 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 893 | ; http://php.net/allow-url-include 894 | allow_url_include = Off 895 | 896 | ; Define the anonymous ftp password (your email address). PHP's default setting 897 | ; for this is empty. 898 | ; http://php.net/from 899 | ;from="john@doe.com" 900 | 901 | ; Define the User-Agent string. PHP's default setting for this is empty. 902 | ; http://php.net/user-agent 903 | ;user_agent="PHP" 904 | 905 | ; Default timeout for socket based streams (seconds) 906 | ; http://php.net/default-socket-timeout 907 | default_socket_timeout = 60 908 | 909 | ; If your scripts have to deal with files from Macintosh systems, 910 | ; or you are running on a Mac and need to deal with files from 911 | ; unix or win32 systems, setting this flag will cause PHP to 912 | ; automatically detect the EOL character in those files so that 913 | ; fgets() and file() will work regardless of the source of the file. 914 | ; http://php.net/auto-detect-line-endings 915 | ;auto_detect_line_endings = Off 916 | 917 | ;;;;;;;;;;;;;;;;;;;;;; 918 | ; Dynamic Extensions ; 919 | ;;;;;;;;;;;;;;;;;;;;;; 920 | 921 | ; If you wish to have an extension loaded automatically, use the following 922 | ; syntax: 923 | ; 924 | ; extension=modulename.extension 925 | ; 926 | ; For example, on Windows: 927 | ; 928 | ; extension=msql.dll 929 | ; 930 | ; ... or under UNIX: 931 | ; 932 | ; extension=msql.so 933 | ; 934 | ; ... or with a path: 935 | ; 936 | ; extension=/path/to/extension/msql.so 937 | ; 938 | ; If you only provide the name of the extension, PHP will look for it in its 939 | ; default extension directory. 940 | ; 941 | 942 | ;;;;;;;;;;;;;;;;;;; 943 | ; Module Settings ; 944 | ;;;;;;;;;;;;;;;;;;; 945 | 946 | [Date] 947 | ; Defines the default timezone used by the date functions 948 | ; http://php.net/date.timezone 949 | date.timezone = 'Europe/Berlin' 950 | 951 | ; http://php.net/date.default-latitude 952 | ;date.default_latitude = 31.7667 953 | 954 | ; http://php.net/date.default-longitude 955 | ;date.default_longitude = 35.2333 956 | 957 | ; http://php.net/date.sunrise-zenith 958 | ;date.sunrise_zenith = 90.583333 959 | 960 | ; http://php.net/date.sunset-zenith 961 | ;date.sunset_zenith = 90.583333 962 | 963 | [filter] 964 | ; http://php.net/filter.default 965 | ;filter.default = unsafe_raw 966 | 967 | ; http://php.net/filter.default-flags 968 | ;filter.default_flags = 969 | 970 | [iconv] 971 | ;iconv.input_encoding = ISO-8859-1 972 | ;iconv.internal_encoding = ISO-8859-1 973 | ;iconv.output_encoding = ISO-8859-1 974 | 975 | [intl] 976 | ;intl.default_locale = 977 | ; This directive allows you to produce PHP errors when some error 978 | ; happens within intl functions. The value is the level of the error produced. 979 | ; Default is 0, which does not produce any errors. 980 | ;intl.error_level = E_WARNING 981 | 982 | [sqlite] 983 | ; http://php.net/sqlite.assoc-case 984 | ;sqlite.assoc_case = 0 985 | 986 | [sqlite3] 987 | ;sqlite3.extension_dir = 988 | 989 | [Pcre] 990 | ;PCRE library backtracking limit. 991 | ; http://php.net/pcre.backtrack-limit 992 | ;pcre.backtrack_limit=100000 993 | 994 | ;PCRE library recursion limit. 995 | ;Please note that if you set this value to a high number you may consume all 996 | ;the available process stack and eventually crash PHP (due to reaching the 997 | ;stack size limit imposed by the Operating System). 998 | ; http://php.net/pcre.recursion-limit 999 | ;pcre.recursion_limit=100000 1000 | 1001 | [Pdo] 1002 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 1003 | ; http://php.net/pdo-odbc.connection-pooling 1004 | ;pdo_odbc.connection_pooling=strict 1005 | 1006 | ;pdo_odbc.db2_instance_name 1007 | 1008 | [Pdo_mysql] 1009 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1010 | ; http://php.net/pdo_mysql.cache_size 1011 | pdo_mysql.cache_size = 2000 1012 | 1013 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1014 | ; MySQL defaults. 1015 | ; http://php.net/pdo_mysql.default-socket 1016 | pdo_mysql.default_socket= 1017 | 1018 | [Phar] 1019 | ; http://php.net/phar.readonly 1020 | phar.readonly = Off 1021 | 1022 | ; http://php.net/phar.require-hash 1023 | phar.require_hash = Off 1024 | 1025 | ;phar.cache_list = 1026 | 1027 | [Syslog] 1028 | ; Whether or not to define the various syslog variables (e.g. $LOG_PID, 1029 | ; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In 1030 | ; runtime, you can define these variables by calling define_syslog_variables(). 1031 | ; http://php.net/define-syslog-variables 1032 | define_syslog_variables = Off 1033 | 1034 | [mail function] 1035 | ; For Win32 only. 1036 | ; http://php.net/smtp 1037 | SMTP = localhost 1038 | ; http://php.net/smtp-port 1039 | smtp_port = 25 1040 | 1041 | ; For Win32 only. 1042 | ; http://php.net/sendmail-from 1043 | ;sendmail_from = me@example.com 1044 | 1045 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 1046 | ; http://php.net/sendmail-path 1047 | ;sendmail_path = 1048 | 1049 | ; Force the addition of the specified parameters to be passed as extra parameters 1050 | ; to the sendmail binary. These parameters will always replace the value of 1051 | ; the 5th parameter to mail(), even in safe mode. 1052 | ;mail.force_extra_parameters = 1053 | 1054 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 1055 | mail.add_x_header = On 1056 | 1057 | ; Log all mail() calls including the full path of the script, line #, to address and headers 1058 | ;mail.log = 1059 | 1060 | [SQL] 1061 | ; http://php.net/sql.safe-mode 1062 | sql.safe_mode = Off 1063 | 1064 | [ODBC] 1065 | ; http://php.net/odbc.default-db 1066 | ;odbc.default_db = Not yet implemented 1067 | 1068 | ; http://php.net/odbc.default-user 1069 | ;odbc.default_user = Not yet implemented 1070 | 1071 | ; http://php.net/odbc.default-pw 1072 | ;odbc.default_pw = Not yet implemented 1073 | 1074 | ; Controls the ODBC cursor model. 1075 | ; Default: SQL_CURSOR_STATIC (default). 1076 | ;odbc.default_cursortype 1077 | 1078 | ; Allow or prevent persistent links. 1079 | ; http://php.net/odbc.allow-persistent 1080 | odbc.allow_persistent = On 1081 | 1082 | ; Check that a connection is still valid before reuse. 1083 | ; http://php.net/odbc.check-persistent 1084 | odbc.check_persistent = On 1085 | 1086 | ; Maximum number of persistent links. -1 means no limit. 1087 | ; http://php.net/odbc.max-persistent 1088 | odbc.max_persistent = -1 1089 | 1090 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1091 | ; http://php.net/odbc.max-links 1092 | odbc.max_links = -1 1093 | 1094 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1095 | ; passthru. 1096 | ; http://php.net/odbc.defaultlrl 1097 | odbc.defaultlrl = 4096 1098 | 1099 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1100 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1101 | ; of odbc.defaultlrl and odbc.defaultbinmode 1102 | ; http://php.net/odbc.defaultbinmode 1103 | odbc.defaultbinmode = 1 1104 | 1105 | ;birdstep.max_links = -1 1106 | 1107 | [Interbase] 1108 | ; Allow or prevent persistent links. 1109 | ibase.allow_persistent = 1 1110 | 1111 | ; Maximum number of persistent links. -1 means no limit. 1112 | ibase.max_persistent = -1 1113 | 1114 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1115 | ibase.max_links = -1 1116 | 1117 | ; Default database name for ibase_connect(). 1118 | ;ibase.default_db = 1119 | 1120 | ; Default username for ibase_connect(). 1121 | ;ibase.default_user = 1122 | 1123 | ; Default password for ibase_connect(). 1124 | ;ibase.default_password = 1125 | 1126 | ; Default charset for ibase_connect(). 1127 | ;ibase.default_charset = 1128 | 1129 | ; Default timestamp format. 1130 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 1131 | 1132 | ; Default date format. 1133 | ibase.dateformat = "%Y-%m-%d" 1134 | 1135 | ; Default time format. 1136 | ibase.timeformat = "%H:%M:%S" 1137 | 1138 | [MySQL] 1139 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1140 | ; http://php.net/mysql.allow_local_infile 1141 | mysql.allow_local_infile = On 1142 | 1143 | ; Allow or prevent persistent links. 1144 | ; http://php.net/mysql.allow-persistent 1145 | mysql.allow_persistent = On 1146 | 1147 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1148 | ; http://php.net/mysql.cache_size 1149 | mysql.cache_size = 2000 1150 | 1151 | ; Maximum number of persistent links. -1 means no limit. 1152 | ; http://php.net/mysql.max-persistent 1153 | mysql.max_persistent = -1 1154 | 1155 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1156 | ; http://php.net/mysql.max-links 1157 | mysql.max_links = -1 1158 | 1159 | ; Default port number for mysql_connect(). If unset, mysql_connect() will use 1160 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1161 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1162 | ; at MYSQL_PORT. 1163 | ; http://php.net/mysql.default-port 1164 | mysql.default_port = 1165 | 1166 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1167 | ; MySQL defaults. 1168 | ; http://php.net/mysql.default-socket 1169 | mysql.default_socket = 1170 | 1171 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1172 | ; http://php.net/mysql.default-host 1173 | mysql.default_host = 1174 | 1175 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1176 | ; http://php.net/mysql.default-user 1177 | mysql.default_user = 1178 | 1179 | ; Default password for mysql_connect() (doesn't apply in safe mode). 1180 | ; Note that this is generally a *bad* idea to store passwords in this file. 1181 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") 1182 | ; and reveal this password! And of course, any users with read access to this 1183 | ; file will be able to reveal the password as well. 1184 | ; http://php.net/mysql.default-password 1185 | mysql.default_password = 1186 | 1187 | ; Maximum time (in seconds) for connect timeout. -1 means no limit 1188 | ; http://php.net/mysql.connect-timeout 1189 | mysql.connect_timeout = 60 1190 | 1191 | ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and 1192 | ; SQL-Errors will be displayed. 1193 | ; http://php.net/mysql.trace-mode 1194 | mysql.trace_mode = Off 1195 | 1196 | [MySQLi] 1197 | 1198 | ; Maximum number of persistent links. -1 means no limit. 1199 | ; http://php.net/mysqli.max-persistent 1200 | mysqli.max_persistent = -1 1201 | 1202 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1203 | ; http://php.net/mysqli.allow_local_infile 1204 | ;mysqli.allow_local_infile = On 1205 | 1206 | ; Allow or prevent persistent links. 1207 | ; http://php.net/mysqli.allow-persistent 1208 | mysqli.allow_persistent = On 1209 | 1210 | ; Maximum number of links. -1 means no limit. 1211 | ; http://php.net/mysqli.max-links 1212 | mysqli.max_links = -1 1213 | 1214 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1215 | ; http://php.net/mysqli.cache_size 1216 | mysqli.cache_size = 2000 1217 | 1218 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1219 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1220 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1221 | ; at MYSQL_PORT. 1222 | ; http://php.net/mysqli.default-port 1223 | mysqli.default_port = 3306 1224 | 1225 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1226 | ; MySQL defaults. 1227 | ; http://php.net/mysqli.default-socket 1228 | mysqli.default_socket = 1229 | 1230 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1231 | ; http://php.net/mysqli.default-host 1232 | mysqli.default_host = 1233 | 1234 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1235 | ; http://php.net/mysqli.default-user 1236 | mysqli.default_user = 1237 | 1238 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1239 | ; Note that this is generally a *bad* idea to store passwords in this file. 1240 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1241 | ; and reveal this password! And of course, any users with read access to this 1242 | ; file will be able to reveal the password as well. 1243 | ; http://php.net/mysqli.default-pw 1244 | mysqli.default_pw = 1245 | 1246 | ; Allow or prevent reconnect 1247 | mysqli.reconnect = Off 1248 | 1249 | [mysqlnd] 1250 | ; Enable / Disable collection of general statstics by mysqlnd which can be 1251 | ; used to tune and monitor MySQL operations. 1252 | ; http://php.net/mysqlnd.collect_statistics 1253 | mysqlnd.collect_statistics = On 1254 | 1255 | ; Enable / Disable collection of memory usage statstics by mysqlnd which can be 1256 | ; used to tune and monitor MySQL operations. 1257 | ; http://php.net/mysqlnd.collect_memory_statistics 1258 | mysqlnd.collect_memory_statistics = Off 1259 | 1260 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1261 | ; http://php.net/mysqlnd.net_cmd_buffer_size 1262 | ;mysqlnd.net_cmd_buffer_size = 2048 1263 | 1264 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1265 | ; bytes. 1266 | ; http://php.net/mysqlnd.net_read_buffer_size 1267 | ;mysqlnd.net_read_buffer_size = 32768 1268 | 1269 | [OCI8] 1270 | 1271 | ; Connection: Enables privileged connections using external 1272 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1273 | ; http://php.net/oci8.privileged-connect 1274 | ;oci8.privileged_connect = Off 1275 | 1276 | ; Connection: The maximum number of persistent OCI8 connections per 1277 | ; process. Using -1 means no limit. 1278 | ; http://php.net/oci8.max-persistent 1279 | ;oci8.max_persistent = -1 1280 | 1281 | ; Connection: The maximum number of seconds a process is allowed to 1282 | ; maintain an idle persistent connection. Using -1 means idle 1283 | ; persistent connections will be maintained forever. 1284 | ; http://php.net/oci8.persistent-timeout 1285 | ;oci8.persistent_timeout = -1 1286 | 1287 | ; Connection: The number of seconds that must pass before issuing a 1288 | ; ping during oci_pconnect() to check the connection validity. When 1289 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1290 | ; pings completely. 1291 | ; http://php.net/oci8.ping-interval 1292 | ;oci8.ping_interval = 60 1293 | 1294 | ; Connection: Set this to a user chosen connection class to be used 1295 | ; for all pooled server requests with Oracle 11g Database Resident 1296 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1297 | ; the same string for all web servers running the same application, 1298 | ; the database pool must be configured, and the connection string must 1299 | ; specify to use a pooled server. 1300 | ;oci8.connection_class = 1301 | 1302 | ; High Availability: Using On lets PHP receive Fast Application 1303 | ; Notification (FAN) events generated when a database node fails. The 1304 | ; database must also be configured to post FAN events. 1305 | ;oci8.events = Off 1306 | 1307 | ; Tuning: This option enables statement caching, and specifies how 1308 | ; many statements to cache. Using 0 disables statement caching. 1309 | ; http://php.net/oci8.statement-cache-size 1310 | ;oci8.statement_cache_size = 20 1311 | 1312 | ; Tuning: Enables statement prefetching and sets the default number of 1313 | ; rows that will be fetched automatically after statement execution. 1314 | ; http://php.net/oci8.default-prefetch 1315 | ;oci8.default_prefetch = 100 1316 | 1317 | ; Compatibility. Using On means oci_close() will not close 1318 | ; oci_connect() and oci_new_connect() connections. 1319 | ; http://php.net/oci8.old-oci-close-semantics 1320 | ;oci8.old_oci_close_semantics = Off 1321 | 1322 | [PostgresSQL] 1323 | ; Allow or prevent persistent links. 1324 | ; http://php.net/pgsql.allow-persistent 1325 | pgsql.allow_persistent = On 1326 | 1327 | ; Detect broken persistent links always with pg_pconnect(). 1328 | ; Auto reset feature requires a little overheads. 1329 | ; http://php.net/pgsql.auto-reset-persistent 1330 | pgsql.auto_reset_persistent = Off 1331 | 1332 | ; Maximum number of persistent links. -1 means no limit. 1333 | ; http://php.net/pgsql.max-persistent 1334 | pgsql.max_persistent = -1 1335 | 1336 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1337 | ; http://php.net/pgsql.max-links 1338 | pgsql.max_links = -1 1339 | 1340 | ; Ignore PostgreSQL backends Notice message or not. 1341 | ; Notice message logging require a little overheads. 1342 | ; http://php.net/pgsql.ignore-notice 1343 | pgsql.ignore_notice = 0 1344 | 1345 | ; Log PostgreSQL backends Noitce message or not. 1346 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1347 | ; http://php.net/pgsql.log-notice 1348 | pgsql.log_notice = 0 1349 | 1350 | [Sybase-CT] 1351 | ; Allow or prevent persistent links. 1352 | ; http://php.net/sybct.allow-persistent 1353 | sybct.allow_persistent = On 1354 | 1355 | ; Maximum number of persistent links. -1 means no limit. 1356 | ; http://php.net/sybct.max-persistent 1357 | sybct.max_persistent = -1 1358 | 1359 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1360 | ; http://php.net/sybct.max-links 1361 | sybct.max_links = -1 1362 | 1363 | ; Minimum server message severity to display. 1364 | ; http://php.net/sybct.min-server-severity 1365 | sybct.min_server_severity = 10 1366 | 1367 | ; Minimum client message severity to display. 1368 | ; http://php.net/sybct.min-client-severity 1369 | sybct.min_client_severity = 10 1370 | 1371 | ; Set per-context timeout 1372 | ; http://php.net/sybct.timeout 1373 | ;sybct.timeout= 1374 | 1375 | ;sybct.packet_size 1376 | 1377 | ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. 1378 | ; Default: one minute 1379 | ;sybct.login_timeout= 1380 | 1381 | ; The name of the host you claim to be connecting from, for display by sp_who. 1382 | ; Default: none 1383 | ;sybct.hostname= 1384 | 1385 | ; Allows you to define how often deadlocks are to be retried. -1 means "forever". 1386 | ; Default: 0 1387 | ;sybct.deadlock_retry_count= 1388 | 1389 | [bcmath] 1390 | ; Number of decimal digits for all bcmath functions. 1391 | ; http://php.net/bcmath.scale 1392 | bcmath.scale = 0 1393 | 1394 | [browscap] 1395 | ; http://php.net/browscap 1396 | ;browscap = extra/browscap.ini 1397 | 1398 | [Session] 1399 | ; Handler used to store/retrieve data. 1400 | ; http://php.net/session.save-handler 1401 | session.save_handler = files 1402 | 1403 | ; Argument passed to save_handler. In the case of files, this is the path 1404 | ; where data files are stored. Note: Windows users have to change this 1405 | ; variable in order to use PHP's session functions. 1406 | ; 1407 | ; The path can be defined as: 1408 | ; 1409 | ; session.save_path = "N;/path" 1410 | ; 1411 | ; where N is an integer. Instead of storing all the session files in 1412 | ; /path, what this will do is use subdirectories N-levels deep, and 1413 | ; store the session data in those directories. This is useful if you 1414 | ; or your OS have problems with lots of files in one directory, and is 1415 | ; a more efficient layout for servers that handle lots of sessions. 1416 | ; 1417 | ; NOTE 1: PHP will not create this directory structure automatically. 1418 | ; You can use the script in the ext/session dir for that purpose. 1419 | ; NOTE 2: See the section on garbage collection below if you choose to 1420 | ; use subdirectories for session storage 1421 | ; 1422 | ; The file storage module creates files using mode 600 by default. 1423 | ; You can change that by using 1424 | ; 1425 | ; session.save_path = "N;MODE;/path" 1426 | ; 1427 | ; where MODE is the octal representation of the mode. Note that this 1428 | ; does not overwrite the process's umask. 1429 | ; http://php.net/session.save-path 1430 | ;session.save_path = "/tmp" 1431 | 1432 | ; Whether to use cookies. 1433 | ; http://php.net/session.use-cookies 1434 | session.use_cookies = 1 1435 | 1436 | ; http://php.net/session.cookie-secure 1437 | ;session.cookie_secure = 1438 | 1439 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1440 | ; the session id. We encourage this operation as it's very helpful in combatting 1441 | ; session hijacking when not specifying and managing your own session id. It is 1442 | ; not the end all be all of session hijacking defense, but it's a good start. 1443 | ; http://php.net/session.use-only-cookies 1444 | session.use_only_cookies = 1 1445 | 1446 | ; Name of the session (used as cookie name). 1447 | ; http://php.net/session.name 1448 | session.name = PHPSESSID 1449 | 1450 | ; Initialize session on request startup. 1451 | ; http://php.net/session.auto-start 1452 | session.auto_start = 0 1453 | 1454 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1455 | ; http://php.net/session.cookie-lifetime 1456 | session.cookie_lifetime = 0 1457 | 1458 | ; The path for which the cookie is valid. 1459 | ; http://php.net/session.cookie-path 1460 | session.cookie_path = / 1461 | 1462 | ; The domain for which the cookie is valid. 1463 | ; http://php.net/session.cookie-domain 1464 | session.cookie_domain = 1465 | 1466 | ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 1467 | ; http://php.net/session.cookie-httponly 1468 | session.cookie_httponly = 1469 | 1470 | ; Handler used to serialize data. php is the standard serializer of PHP. 1471 | ; http://php.net/session.serialize-handler 1472 | session.serialize_handler = php 1473 | 1474 | ; Defines the probability that the 'garbage collection' process is started 1475 | ; on every session initialization. The probability is calculated by using 1476 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator 1477 | ; and gc_divisor is the denominator in the equation. Setting this value to 1 1478 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1479 | ; the gc will run on any give request. 1480 | ; Default Value: 1 1481 | ; Development Value: 1 1482 | ; Production Value: 1 1483 | ; http://php.net/session.gc-probability 1484 | session.gc_probability = 1 1485 | 1486 | ; Defines the probability that the 'garbage collection' process is started on every 1487 | ; session initialization. The probability is calculated by using the following equation: 1488 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and 1489 | ; session.gc_divisor is the denominator in the equation. Setting this value to 1 1490 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1491 | ; the gc will run on any give request. Increasing this value to 1000 will give you 1492 | ; a 0.1% chance the gc will run on any give request. For high volume production servers, 1493 | ; this is a more efficient approach. 1494 | ; Default Value: 100 1495 | ; Development Value: 1000 1496 | ; Production Value: 1000 1497 | ; http://php.net/session.gc-divisor 1498 | session.gc_divisor = 1000 1499 | 1500 | ; After this number of seconds, stored data will be seen as 'garbage' and 1501 | ; cleaned up by the garbage collection process. 1502 | ; http://php.net/session.gc-maxlifetime 1503 | session.gc_maxlifetime = 1440 1504 | 1505 | ; NOTE: If you are using the subdirectory option for storing session files 1506 | ; (see session.save_path above), then garbage collection does *not* 1507 | ; happen automatically. You will need to do your own garbage 1508 | ; collection through a shell script, cron entry, or some other method. 1509 | ; For example, the following script would is the equivalent of 1510 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1511 | ; cd /path/to/sessions; find -cmin +24 | xargs rm 1512 | 1513 | ; PHP 4.2 and less have an undocumented feature/bug that allows you to 1514 | ; to initialize a session variable in the global scope, even when register_globals 1515 | ; is disabled. PHP 4.3 and later will warn you, if this feature is used. 1516 | ; You can disable the feature and the warning separately. At this time, 1517 | ; the warning is only displayed, if bug_compat_42 is enabled. This feature 1518 | ; introduces some serious security problems if not handled correctly. It's 1519 | ; recommended that you do not use this feature on production servers. But you 1520 | ; should enable this on development servers and enable the warning as well. If you 1521 | ; do not enable the feature on development servers, you won't be warned when it's 1522 | ; used and debugging errors caused by this can be difficult to track down. 1523 | ; Default Value: On 1524 | ; Development Value: On 1525 | ; Production Value: Off 1526 | ; http://php.net/session.bug-compat-42 1527 | session.bug_compat_42 = Off 1528 | 1529 | ; This setting controls whether or not you are warned by PHP when initializing a 1530 | ; session value into the global space. session.bug_compat_42 must be enabled before 1531 | ; these warnings can be issued by PHP. See the directive above for more information. 1532 | ; Default Value: On 1533 | ; Development Value: On 1534 | ; Production Value: Off 1535 | ; http://php.net/session.bug-compat-warn 1536 | session.bug_compat_warn = Off 1537 | 1538 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1539 | ; HTTP_REFERER has to contain this substring for the session to be 1540 | ; considered as valid. 1541 | ; http://php.net/session.referer-check 1542 | session.referer_check = 1543 | 1544 | ; How many bytes to read from the file. 1545 | ; http://php.net/session.entropy-length 1546 | session.entropy_length = 0 1547 | 1548 | ; Specified here to create the session id. 1549 | ; http://php.net/session.entropy-file 1550 | ;session.entropy_file = /dev/urandom 1551 | session.entropy_file = 1552 | 1553 | ; http://php.net/session.entropy-length 1554 | ;session.entropy_length = 16 1555 | 1556 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1557 | ; or leave this empty to avoid sending anti-caching headers. 1558 | ; http://php.net/session.cache-limiter 1559 | session.cache_limiter = nocache 1560 | 1561 | ; Document expires after n minutes. 1562 | ; http://php.net/session.cache-expire 1563 | session.cache_expire = 180 1564 | 1565 | ; trans sid support is disabled by default. 1566 | ; Use of trans sid may risk your users security. 1567 | ; Use this option with caution. 1568 | ; - User may send URL contains active session ID 1569 | ; to other person via. email/irc/etc. 1570 | ; - URL that contains active session ID may be stored 1571 | ; in publically accessible computer. 1572 | ; - User may access your site with the same session ID 1573 | ; always using URL stored in browser's history or bookmarks. 1574 | ; http://php.net/session.use-trans-sid 1575 | session.use_trans_sid = 0 1576 | 1577 | ; Select a hash function for use in generating session ids. 1578 | ; Possible Values 1579 | ; 0 (MD5 128 bits) 1580 | ; 1 (SHA-1 160 bits) 1581 | ; This option may also be set to the name of any hash function supported by 1582 | ; the hash extension. A list of available hashes is returned by the hash_alogs() 1583 | ; function. 1584 | ; http://php.net/session.hash-function 1585 | session.hash_function = 0 1586 | 1587 | ; Define how many bits are stored in each character when converting 1588 | ; the binary hash data to something readable. 1589 | ; Possible values: 1590 | ; 4 (4 bits: 0-9, a-f) 1591 | ; 5 (5 bits: 0-9, a-v) 1592 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1593 | ; Default Value: 4 1594 | ; Development Value: 5 1595 | ; Production Value: 5 1596 | ; http://php.net/session.hash-bits-per-character 1597 | session.hash_bits_per_character = 5 1598 | 1599 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1600 | ; form/fieldset are special; if you include them here, the rewriter will 1601 | ; add a hidden field with the info which is otherwise appended 1602 | ; to URLs. If you want XHTML conformity, remove the form entry. 1603 | ; Note that all valid entries require a "=", even if no value follows. 1604 | ; Default Value: "a=href,area=href,frame=src,form=,fieldset=" 1605 | ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1606 | ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" 1607 | ; http://php.net/url-rewriter.tags 1608 | url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" 1609 | 1610 | [MSSQL] 1611 | ; Allow or prevent persistent links. 1612 | mssql.allow_persistent = On 1613 | 1614 | ; Maximum number of persistent links. -1 means no limit. 1615 | mssql.max_persistent = -1 1616 | 1617 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1618 | mssql.max_links = -1 1619 | 1620 | ; Minimum error severity to display. 1621 | mssql.min_error_severity = 10 1622 | 1623 | ; Minimum message severity to display. 1624 | mssql.min_message_severity = 10 1625 | 1626 | ; Compatibility mode with old versions of PHP 3.0. 1627 | mssql.compatability_mode = Off 1628 | 1629 | ; Connect timeout 1630 | ;mssql.connect_timeout = 5 1631 | 1632 | ; Query timeout 1633 | ;mssql.timeout = 60 1634 | 1635 | ; Valid range 0 - 2147483647. Default = 4096. 1636 | ;mssql.textlimit = 4096 1637 | 1638 | ; Valid range 0 - 2147483647. Default = 4096. 1639 | ;mssql.textsize = 4096 1640 | 1641 | ; Limits the number of records in each batch. 0 = all records in one batch. 1642 | ;mssql.batchsize = 0 1643 | 1644 | ; Specify how datetime and datetim4 columns are returned 1645 | ; On => Returns data converted to SQL server settings 1646 | ; Off => Returns values as YYYY-MM-DD hh:mm:ss 1647 | ;mssql.datetimeconvert = On 1648 | 1649 | ; Use NT authentication when connecting to the server 1650 | mssql.secure_connection = Off 1651 | 1652 | ; Specify max number of processes. -1 = library default 1653 | ; msdlib defaults to 25 1654 | ; FreeTDS defaults to 4096 1655 | ;mssql.max_procs = -1 1656 | 1657 | ; Specify client character set. 1658 | ; If empty or not set the client charset from freetds.comf is used 1659 | ; This is only used when compiled with FreeTDS 1660 | ;mssql.charset = "ISO-8859-1" 1661 | 1662 | [Assertion] 1663 | ; Assert(expr); active by default. 1664 | ; http://php.net/assert.active 1665 | ;assert.active = On 1666 | 1667 | ; Issue a PHP warning for each failed assertion. 1668 | ; http://php.net/assert.warning 1669 | ;assert.warning = On 1670 | 1671 | ; Don't bail out by default. 1672 | ; http://php.net/assert.bail 1673 | ;assert.bail = Off 1674 | 1675 | ; User-function to be called if an assertion fails. 1676 | ; http://php.net/assert.callback 1677 | ;assert.callback = 0 1678 | 1679 | ; Eval the expression with current error_reporting(). Set to true if you want 1680 | ; error_reporting(0) around the eval(). 1681 | ; http://php.net/assert.quiet-eval 1682 | ;assert.quiet_eval = 0 1683 | 1684 | [COM] 1685 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1686 | ; http://php.net/com.typelib-file 1687 | ;com.typelib_file = 1688 | 1689 | ; allow Distributed-COM calls 1690 | ; http://php.net/com.allow-dcom 1691 | ;com.allow_dcom = true 1692 | 1693 | ; autoregister constants of a components typlib on com_load() 1694 | ; http://php.net/com.autoregister-typelib 1695 | ;com.autoregister_typelib = true 1696 | 1697 | ; register constants casesensitive 1698 | ; http://php.net/com.autoregister-casesensitive 1699 | ;com.autoregister_casesensitive = false 1700 | 1701 | ; show warnings on duplicate constant registrations 1702 | ; http://php.net/com.autoregister-verbose 1703 | ;com.autoregister_verbose = true 1704 | 1705 | ; The default character set code-page to use when passing strings to and from COM objects. 1706 | ; Default: system ANSI code page 1707 | ;com.code_page= 1708 | 1709 | [mbstring] 1710 | ; language for internal character representation. 1711 | ; http://php.net/mbstring.language 1712 | ;mbstring.language = Japanese 1713 | 1714 | ; internal/script encoding. 1715 | ; Some encoding cannot work as internal encoding. 1716 | ; (e.g. SJIS, BIG5, ISO-2022-*) 1717 | ; http://php.net/mbstring.internal-encoding 1718 | ;mbstring.internal_encoding = EUC-JP 1719 | 1720 | ; http input encoding. 1721 | ; http://php.net/mbstring.http-input 1722 | ;mbstring.http_input = auto 1723 | 1724 | ; http output encoding. mb_output_handler must be 1725 | ; registered as output buffer to function 1726 | ; http://php.net/mbstring.http-output 1727 | ;mbstring.http_output = SJIS 1728 | 1729 | ; enable automatic encoding translation according to 1730 | ; mbstring.internal_encoding setting. Input chars are 1731 | ; converted to internal encoding by setting this to On. 1732 | ; Note: Do _not_ use automatic encoding translation for 1733 | ; portable libs/applications. 1734 | ; http://php.net/mbstring.encoding-translation 1735 | ;mbstring.encoding_translation = Off 1736 | 1737 | ; automatic encoding detection order. 1738 | ; auto means 1739 | ; http://php.net/mbstring.detect-order 1740 | ;mbstring.detect_order = auto 1741 | 1742 | ; substitute_character used when character cannot be converted 1743 | ; one from another 1744 | ; http://php.net/mbstring.substitute-character 1745 | ;mbstring.substitute_character = none; 1746 | 1747 | ; overload(replace) single byte functions by mbstring functions. 1748 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1749 | ; etc. Possible values are 0,1,2,4 or combination of them. 1750 | ; For example, 7 for overload everything. 1751 | ; 0: No overload 1752 | ; 1: Overload mail() function 1753 | ; 2: Overload str*() functions 1754 | ; 4: Overload ereg*() functions 1755 | ; http://php.net/mbstring.func-overload 1756 | ;mbstring.func_overload = 0 1757 | 1758 | ; enable strict encoding detection. 1759 | ;mbstring.strict_detection = Off 1760 | 1761 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1762 | ; is activated. 1763 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1764 | ;mbstring.http_output_conv_mimetype= 1765 | 1766 | ; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte 1767 | ; Default: "" 1768 | ;mbstring.script_encoding= 1769 | 1770 | [gd] 1771 | ; Tell the jpeg decode to ignore warnings and try to create 1772 | ; a gd image. The warning will then be displayed as notices 1773 | ; disabled by default 1774 | ; http://php.net/gd.jpeg-ignore-warning 1775 | ;gd.jpeg_ignore_warning = 0 1776 | 1777 | [exif] 1778 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1779 | ; With mbstring support this will automatically be converted into the encoding 1780 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1781 | ; is used. For the decode settings you can distinguish between motorola and 1782 | ; intel byte order. A decode setting cannot be empty. 1783 | ; http://php.net/exif.encode-unicode 1784 | ;exif.encode_unicode = ISO-8859-15 1785 | 1786 | ; http://php.net/exif.decode-unicode-motorola 1787 | ;exif.decode_unicode_motorola = UCS-2BE 1788 | 1789 | ; http://php.net/exif.decode-unicode-intel 1790 | ;exif.decode_unicode_intel = UCS-2LE 1791 | 1792 | ; http://php.net/exif.encode-jis 1793 | ;exif.encode_jis = 1794 | 1795 | ; http://php.net/exif.decode-jis-motorola 1796 | ;exif.decode_jis_motorola = JIS 1797 | 1798 | ; http://php.net/exif.decode-jis-intel 1799 | ;exif.decode_jis_intel = JIS 1800 | 1801 | [Tidy] 1802 | ; The path to a default tidy configuration file to use when using tidy 1803 | ; http://php.net/tidy.default-config 1804 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1805 | 1806 | ; Should tidy clean and repair output automatically? 1807 | ; WARNING: Do not use this option if you are generating non-html content 1808 | ; such as dynamic images 1809 | ; http://php.net/tidy.clean-output 1810 | tidy.clean_output = Off 1811 | 1812 | [soap] 1813 | ; Enables or disables WSDL caching feature. 1814 | ; http://php.net/soap.wsdl-cache-enabled 1815 | soap.wsdl_cache_enabled=1 1816 | 1817 | ; Sets the directory name where SOAP extension will put cache files. 1818 | ; http://php.net/soap.wsdl-cache-dir 1819 | soap.wsdl_cache_dir="/tmp" 1820 | 1821 | ; (time to live) Sets the number of second while cached file will be used 1822 | ; instead of original one. 1823 | ; http://php.net/soap.wsdl-cache-ttl 1824 | soap.wsdl_cache_ttl=86400 1825 | 1826 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1827 | soap.wsdl_cache_limit = 5 1828 | 1829 | [sysvshm] 1830 | ; A default size of the shared memory segment 1831 | ;sysvshm.init_mem = 10000 1832 | 1833 | [ldap] 1834 | ; Sets the maximum number of open links or -1 for unlimited. 1835 | ldap.max_links = -1 1836 | 1837 | [mcrypt] 1838 | ; For more information about mcrypt settings see http://php.net/mcrypt-module-open 1839 | 1840 | ; Directory where to load mcrypt algorithms 1841 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1842 | ;mcrypt.algorithms_dir= 1843 | 1844 | ; Directory where to load mcrypt modes 1845 | ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) 1846 | ;mcrypt.modes_dir= 1847 | 1848 | [dba] 1849 | ;dba.default_handler= 1850 | 1851 | ; Local Variables: 1852 | ; tab-width: 4 1853 | ; End: 1854 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.3.3 5 | - 5.3 6 | - 5.4 7 | 8 | before_script: composer install 9 | 10 | script: phpunit -c app 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2013 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Sample Twitter API in Symfony2 2 | ============================== 3 | 4 | ```bash 5 | $ echo "rest.lo 10.10.10.10 >> /etc/hosts" 6 | # optional 7 | $ vagrant box add base http://files.vagrantup.com/lucid64.box 8 | $ vagrant up 9 | ``` 10 | 11 | Open in browser http://rest.lo/app_dev.php/api/doc 12 | -------------------------------------------------------------------------------- /UPGRADE-2.2.md: -------------------------------------------------------------------------------- 1 | UPGRADE FROM 2.1 to 2.2 2 | ======================= 3 | 4 | * The [`web/.htaccess`](https://github.com/symfony/symfony-standard/blob/2.2/web/.htaccess) 5 | file has been enhanced substantially to prevent duplicate content with and 6 | without `/app.php` in the URI. It also improves functionality when using 7 | Apache aliases or when mod_rewrite is not available. So you might want to 8 | update your `.htaccess` file as well. 9 | 10 | * The ``_internal`` route is not used any more. It should then be removed 11 | from both your routing and security configurations. A ``fragments`` key has 12 | been added to the framework configuration and must be specified when ESI or 13 | Hinclude are in use. No security configuration is required for this path as 14 | by default ESI access is only permitted for trusted hosts and Hinclude 15 | access uses an URL signing mechanism. 16 | 17 | ``` 18 | framework: 19 | # ... 20 | fragments: { path: /_proxy } 21 | ``` 22 | 23 | Functional Tests 24 | ---------------- 25 | 26 | * The profiler has been disabled by default in the test environment. You can 27 | enable it again by modifying the ``config_test.yml`` configuration file or 28 | even better, you can just enable it for the very next request by calling 29 | ``$client->enableProfiler()`` when you need the profiler in a test (that 30 | speeds up functional tests quite a bit). 31 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | Symfony Standard Edition Upgrade 2 | ================================ 3 | 4 | From Symfony 2.0 to Symfony 2.1 5 | ------------------------------- 6 | 7 | ### Project Dependencies 8 | 9 | As of Symfony 2.1, project dependencies are managed by 10 | [Composer](http://getcomposer.org/): 11 | 12 | * The `bin/vendors` script can be removed as `composer.phar` does all the work 13 | now (it is recommended to install it globally on your machine). 14 | 15 | * The `deps` file need to be replaced with the `composer.json` one. 16 | 17 | * The `composer.lock` is the equivalent of the generated `deps.lock` file and 18 | it is automatically generated by Composer. 19 | 20 | Download the default 21 | [`composer.json`](https://raw.github.com/symfony/symfony-standard/2.1/composer.json) 22 | and 23 | [`composer.lock`](https://raw.github.com/symfony/symfony-standard/2.1/composer.lock) 24 | files for Symfony 2.1 and put them into the main directory of your project. If 25 | you have customized your `deps` file, move the added dependencies to the 26 | `composer.json` file (many bundles and PHP libraries are already available as 27 | Composer packages -- search for them on [Packagist](http://packagist.org/)). 28 | 29 | Remove your current `vendor` directory. 30 | 31 | Finally, run Composer: 32 | 33 | $ composer.phar install 34 | 35 | Note: You must complete the upgrade steps below so composer can successfully generate the autoload files. 36 | 37 | ### `app/autoload.php` 38 | 39 | The default `autoload.php` reads as follows (it has been simplified a lot as 40 | autoloading for libraries and bundles declared in your `composer.json` file is 41 | automatically managed by the Composer autoloader): 42 | 43 | add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs'); 54 | } 55 | 56 | AnnotationRegistry::registerLoader(array($loader, 'loadClass')); 57 | 58 | return $loader; 59 | 60 | ### `app/config/config.yml` 61 | 62 | The `framework.charset` setting must be removed. If you are not using `UTF-8` 63 | for your application, override the `getCharset()` method in your `AppKernel` 64 | class instead: 65 | 66 | class AppKernel extends Kernel 67 | { 68 | public function getCharset() 69 | { 70 | return 'ISO-8859-1'; 71 | } 72 | 73 | // ... 74 | } 75 | 76 | You might want to add the new `strict_requirements` parameter to 77 | `framework.router` (it avoids fatal errors in the production environment when 78 | a link cannot be generated): 79 | 80 | framework: 81 | router: 82 | strict_requirements: %kernel.debug% 83 | 84 | You can even disable the requirements check on production with `null` as you should 85 | know that the parameters for URL generation always pass the requirements, e.g. by 86 | validating them beforehand. This additionally enhances performance. See 87 | [config_prod.yml](https://github.com/symfony/symfony-standard/blob/master/app/config/config_prod.yml). 88 | 89 | The `default_locale` parameter is now a setting of the main `framework` 90 | configuration (it was under the `framework.session` in 2.0): 91 | 92 | framework: 93 | default_locale: %locale% 94 | 95 | The `auto_start` setting under `framework.session` must be removed as it is 96 | not used anymore (the session is now always started on-demand). If 97 | `auto_start` was the only setting under the `framework.session` entry, don't 98 | remove it entirely, but set its value to `~` (`~` means `null` in YAML) 99 | instead: 100 | 101 | framework: 102 | session: ~ 103 | 104 | The `trust_proxy_headers` setting was added in the default configuration file 105 | (as it should be set to `true` when you install your application behind a 106 | reverse proxy): 107 | 108 | framework: 109 | trust_proxy_headers: false 110 | 111 | An empty `bundles` entry was added to the `assetic` configuration: 112 | 113 | assetic: 114 | bundles: [] 115 | 116 | The default `swiftmailer` configuration now has the `spool` setting configured 117 | to the `memory` type to defer email sending after the response is sent to the 118 | user (recommended for better end-user performance): 119 | 120 | swiftmailer: 121 | spool: { type: memory } 122 | 123 | The `jms_security_extra` configuration was moved to the `security.yml` 124 | configuration file. 125 | 126 | ### `app/config/config_dev.yml` 127 | 128 | An example of how to send all emails to a unique address was added: 129 | 130 | #swiftmailer: 131 | # delivery_address: me@example.com 132 | 133 | ### `app/config/config_test.yml` 134 | 135 | The `storage_id` setting must be changed to `session.storage.mock_file`: 136 | 137 | framework: 138 | session: 139 | storage_id: session.storage.mock_file 140 | 141 | ### `app/config/parameters.ini` 142 | 143 | The file has been converted to a YAML file which reads as follows: 144 | 145 | parameters: 146 | database_driver: pdo_mysql 147 | database_host: localhost 148 | database_port: ~ 149 | database_name: symfony 150 | database_user: root 151 | database_password: ~ 152 | 153 | mailer_transport: smtp 154 | mailer_host: localhost 155 | mailer_user: ~ 156 | mailer_password: ~ 157 | 158 | locale: en 159 | secret: ThisTokenIsNotSoSecretChangeIt 160 | 161 | Note that if you convert your parameters file to YAML, you must also change 162 | its reference in `app/config/config.yml`. 163 | 164 | ### `app/config/routing_dev.yml` 165 | 166 | The `_assetic` entry was removed: 167 | 168 | #_assetic: 169 | # resource: . 170 | # type: assetic 171 | 172 | ### `app/config/security.yml` 173 | 174 | Under `security.access_control`, the default rule for internal routes was changed: 175 | 176 | security: 177 | access_control: 178 | #- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 } 179 | 180 | Under `security.providers`, the `in_memory` example was updated to the following: 181 | 182 | security: 183 | providers: 184 | in_memory: 185 | memory: 186 | users: 187 | user: { password: userpass, roles: [ 'ROLE_USER' ] } 188 | admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] } 189 | 190 | ### `app/AppKernel.php` 191 | 192 | The following bundles have been added to the list of default registered bundles: 193 | 194 | new JMS\AopBundle\JMSAopBundle(), 195 | new JMS\DiExtraBundle\JMSDiExtraBundle($this), 196 | 197 | You must also rename the DoctrineBundle from: 198 | 199 | new Symfony\Bundle\DoctrineBundle\DoctrineBundle(), 200 | 201 | to: 202 | 203 | new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), 204 | 205 | ### `web/app.php` 206 | 207 | The default `web/app.php` file now reads as follows: 208 | 209 | register(true); 222 | */ 223 | 224 | require_once __DIR__.'/../app/AppKernel.php'; 225 | //require_once __DIR__.'/../app/AppCache.php'; 226 | 227 | $kernel = new AppKernel('prod', false); 228 | $kernel->loadClassCache(); 229 | //$kernel = new AppCache($kernel); 230 | $request = Request::createFromGlobals(); 231 | $response = $kernel->handle($request); 232 | $response->send(); 233 | $kernel->terminate($request, $response); 234 | 235 | ### `web/app_dev.php` 236 | 237 | The default `web/app_dev.php` file now reads as follows: 238 | 239 | loadClassCache(); 265 | $request = Request::createFromGlobals(); 266 | $response = $kernel->handle($request); 267 | $response->send(); 268 | $kernel->terminate($request, $response); 269 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant::Config.run do |config| 2 | 3 | # get a box here http://www.vagrantbox.es/ | precise32 and precise64 working well out of the box 4 | # uncomment line below and replace 'base' with the name of the vm of your choice 5 | config.vm.box = "base" 6 | config.vm.network :hostonly, "10.10.10.10" 7 | 8 | # set the memory - 1GB is good for SC 9 | config.vm.customize ["modifyvm", :id, "--memory", 1024] 10 | 11 | # remove the next line when running on a windows host system (Windows does not have NFS support) 12 | config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true) 13 | config.vm.provision :puppet do |puppet| 14 | puppet.manifests_path = ".puppet/vagrant/manifests" 15 | puppet.manifest_file = "app.pp" 16 | end 17 | 18 | end 19 | -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /app/AppCache.php: -------------------------------------------------------------------------------- 1 | getEnvironment(), array('dev', 'test'))) { 30 | $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); 31 | $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); 32 | $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); 33 | $bundles[] = new Nelmio\ApiDocBundle\NelmioApiDocBundle(); 34 | } 35 | 36 | return $bundles; 37 | } 38 | 39 | public function registerContainerConfiguration(LoaderInterface $loader) 40 | { 41 | $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Resources/views/base.html.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {% block title %}Welcome!{% endblock %} 6 | {% block stylesheets %}{% endblock %} 7 | 8 | 9 | 10 | {% block body %}{% endblock %} 11 | {% block javascripts %}{% endblock %} 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/SymfonyRequirements.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | /* 13 | * Users of PHP 5.2 should be able to run the requirements checks. 14 | * This is why the file and all classes must be compatible with PHP 5.2+ 15 | * (e.g. not using namespaces and closures). 16 | * 17 | * ************** CAUTION ************** 18 | * 19 | * DO NOT EDIT THIS FILE as it will be overriden by Composer as part of 20 | * the installation/update process. The original file resides in the 21 | * SensioDistributionBundle. 22 | * 23 | * ************** CAUTION ************** 24 | */ 25 | 26 | /** 27 | * Represents a single PHP requirement, e.g. an installed extension. 28 | * It can be a mandatory requirement or an optional recommendation. 29 | * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration. 30 | * 31 | * @author Tobias Schultze 32 | */ 33 | class Requirement 34 | { 35 | private $fulfilled; 36 | private $testMessage; 37 | private $helpText; 38 | private $helpHtml; 39 | private $optional; 40 | 41 | /** 42 | * Constructor that initializes the requirement. 43 | * 44 | * @param Boolean $fulfilled Whether the requirement is fulfilled 45 | * @param string $testMessage The message for testing the requirement 46 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 47 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 48 | * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement 49 | */ 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) 51 | { 52 | $this->fulfilled = (Boolean) $fulfilled; 53 | $this->testMessage = (string) $testMessage; 54 | $this->helpHtml = (string) $helpHtml; 55 | $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; 56 | $this->optional = (Boolean) $optional; 57 | } 58 | 59 | /** 60 | * Returns whether the requirement is fulfilled. 61 | * 62 | * @return Boolean true if fulfilled, otherwise false 63 | */ 64 | public function isFulfilled() 65 | { 66 | return $this->fulfilled; 67 | } 68 | 69 | /** 70 | * Returns the message for testing the requirement. 71 | * 72 | * @return string The test message 73 | */ 74 | public function getTestMessage() 75 | { 76 | return $this->testMessage; 77 | } 78 | 79 | /** 80 | * Returns the help text for resolving the problem 81 | * 82 | * @return string The help text 83 | */ 84 | public function getHelpText() 85 | { 86 | return $this->helpText; 87 | } 88 | 89 | /** 90 | * Returns the help text formatted in HTML. 91 | * 92 | * @return string The HTML help 93 | */ 94 | public function getHelpHtml() 95 | { 96 | return $this->helpHtml; 97 | } 98 | 99 | /** 100 | * Returns whether this is only an optional recommendation and not a mandatory requirement. 101 | * 102 | * @return Boolean true if optional, false if mandatory 103 | */ 104 | public function isOptional() 105 | { 106 | return $this->optional; 107 | } 108 | } 109 | 110 | /** 111 | * Represents a PHP requirement in form of a php.ini configuration. 112 | * 113 | * @author Tobias Schultze 114 | */ 115 | class PhpIniRequirement extends Requirement 116 | { 117 | /** 118 | * Constructor that initializes the requirement. 119 | * 120 | * @param string $cfgName The configuration name used for ini_get() 121 | * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, 122 | or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 123 | * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 124 | This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 125 | Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 126 | * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) 127 | * @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) 128 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 129 | * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement 130 | */ 131 | public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) 132 | { 133 | $cfgValue = ini_get($cfgName); 134 | 135 | if (is_callable($evaluation)) { 136 | if (null === $testMessage || null === $helpHtml) { 137 | throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.'); 138 | } 139 | 140 | $fulfilled = call_user_func($evaluation, $cfgValue); 141 | } else { 142 | if (null === $testMessage) { 143 | $testMessage = sprintf('%s %s be %s in php.ini', 144 | $cfgName, 145 | $optional ? 'should' : 'must', 146 | $evaluation ? 'enabled' : 'disabled' 147 | ); 148 | } 149 | 150 | if (null === $helpHtml) { 151 | $helpHtml = sprintf('Set %s to %s in php.ini*.', 152 | $cfgName, 153 | $evaluation ? 'on' : 'off' 154 | ); 155 | } 156 | 157 | $fulfilled = $evaluation == $cfgValue; 158 | } 159 | 160 | parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional); 161 | } 162 | } 163 | 164 | /** 165 | * A RequirementCollection represents a set of Requirement instances. 166 | * 167 | * @author Tobias Schultze 168 | */ 169 | class RequirementCollection implements IteratorAggregate 170 | { 171 | private $requirements = array(); 172 | 173 | /** 174 | * Gets the current RequirementCollection as an Iterator. 175 | * 176 | * @return Traversable A Traversable interface 177 | */ 178 | public function getIterator() 179 | { 180 | return new ArrayIterator($this->requirements); 181 | } 182 | 183 | /** 184 | * Adds a Requirement. 185 | * 186 | * @param Requirement $requirement A Requirement instance 187 | */ 188 | public function add(Requirement $requirement) 189 | { 190 | $this->requirements[] = $requirement; 191 | } 192 | 193 | /** 194 | * Adds a mandatory requirement. 195 | * 196 | * @param Boolean $fulfilled Whether the requirement is fulfilled 197 | * @param string $testMessage The message for testing the requirement 198 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 199 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 200 | */ 201 | public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) 202 | { 203 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false)); 204 | } 205 | 206 | /** 207 | * Adds an optional recommendation. 208 | * 209 | * @param Boolean $fulfilled Whether the recommendation is fulfilled 210 | * @param string $testMessage The message for testing the recommendation 211 | * @param string $helpHtml The help text formatted in HTML for resolving the problem 212 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 213 | */ 214 | public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) 215 | { 216 | $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true)); 217 | } 218 | 219 | /** 220 | * Adds a mandatory requirement in form of a php.ini configuration. 221 | * 222 | * @param string $cfgName The configuration name used for ini_get() 223 | * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, 224 | or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 225 | * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 226 | This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 227 | Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 228 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) 229 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) 230 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 231 | */ 232 | public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 233 | { 234 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false)); 235 | } 236 | 237 | /** 238 | * Adds an optional recommendation in form of a php.ini configuration. 239 | * 240 | * @param string $cfgName The configuration name used for ini_get() 241 | * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, 242 | or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement 243 | * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. 244 | This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. 245 | Example: You require a config to be true but PHP later removes this config and defaults it to true internally. 246 | * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) 247 | * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) 248 | * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) 249 | */ 250 | public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) 251 | { 252 | $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true)); 253 | } 254 | 255 | /** 256 | * Adds a requirement collection to the current set of requirements. 257 | * 258 | * @param RequirementCollection $collection A RequirementCollection instance 259 | */ 260 | public function addCollection(RequirementCollection $collection) 261 | { 262 | $this->requirements = array_merge($this->requirements, $collection->all()); 263 | } 264 | 265 | /** 266 | * Returns both requirements and recommendations. 267 | * 268 | * @return array Array of Requirement instances 269 | */ 270 | public function all() 271 | { 272 | return $this->requirements; 273 | } 274 | 275 | /** 276 | * Returns all mandatory requirements. 277 | * 278 | * @return array Array of Requirement instances 279 | */ 280 | public function getRequirements() 281 | { 282 | $array = array(); 283 | foreach ($this->requirements as $req) { 284 | if (!$req->isOptional()) { 285 | $array[] = $req; 286 | } 287 | } 288 | 289 | return $array; 290 | } 291 | 292 | /** 293 | * Returns the mandatory requirements that were not met. 294 | * 295 | * @return array Array of Requirement instances 296 | */ 297 | public function getFailedRequirements() 298 | { 299 | $array = array(); 300 | foreach ($this->requirements as $req) { 301 | if (!$req->isFulfilled() && !$req->isOptional()) { 302 | $array[] = $req; 303 | } 304 | } 305 | 306 | return $array; 307 | } 308 | 309 | /** 310 | * Returns all optional recommmendations. 311 | * 312 | * @return array Array of Requirement instances 313 | */ 314 | public function getRecommendations() 315 | { 316 | $array = array(); 317 | foreach ($this->requirements as $req) { 318 | if ($req->isOptional()) { 319 | $array[] = $req; 320 | } 321 | } 322 | 323 | return $array; 324 | } 325 | 326 | /** 327 | * Returns the recommendations that were not met. 328 | * 329 | * @return array Array of Requirement instances 330 | */ 331 | public function getFailedRecommendations() 332 | { 333 | $array = array(); 334 | foreach ($this->requirements as $req) { 335 | if (!$req->isFulfilled() && $req->isOptional()) { 336 | $array[] = $req; 337 | } 338 | } 339 | 340 | return $array; 341 | } 342 | 343 | /** 344 | * Returns whether a php.ini configuration is not correct. 345 | * 346 | * @return Boolean php.ini configuration problem? 347 | */ 348 | public function hasPhpIniConfigIssue() 349 | { 350 | foreach ($this->requirements as $req) { 351 | if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) { 352 | return true; 353 | } 354 | } 355 | 356 | return false; 357 | } 358 | 359 | /** 360 | * Returns the PHP configuration file (php.ini) path. 361 | * 362 | * @return string|false php.ini file path 363 | */ 364 | public function getPhpIniConfigPath() 365 | { 366 | return get_cfg_var('cfg_file_path'); 367 | } 368 | } 369 | 370 | /** 371 | * This class specifies all requirements and optional recommendations that 372 | * are necessary to run the Symfony Standard Edition. 373 | * 374 | * @author Tobias Schultze 375 | * @author Fabien Potencier 376 | */ 377 | class SymfonyRequirements extends RequirementCollection 378 | { 379 | const REQUIRED_PHP_VERSION = '5.3.3'; 380 | 381 | /** 382 | * Constructor that initializes the requirements. 383 | */ 384 | public function __construct() 385 | { 386 | /* mandatory requirements follow */ 387 | 388 | $installedPhpVersion = phpversion(); 389 | 390 | $this->addRequirement( 391 | version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='), 392 | sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion), 393 | sprintf('You are running PHP version "%s", but Symfony needs at least PHP "%s" to run. 394 | Before using Symfony, upgrade your PHP installation, preferably to the latest version.', 395 | $installedPhpVersion, self::REQUIRED_PHP_VERSION), 396 | sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion) 397 | ); 398 | 399 | $this->addRequirement( 400 | version_compare($installedPhpVersion, '5.3.16', '!='), 401 | 'PHP version must not be 5.3.16 as Symfony won\'t work properly with it', 402 | 'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)' 403 | ); 404 | 405 | $this->addRequirement( 406 | is_dir(__DIR__.'/../vendor/composer'), 407 | 'Vendor libraries must be installed', 408 | 'Vendor libraries are missing. Install composer following instructions from http://getcomposer.org/. ' . 409 | 'Then run "php composer.phar install" to install them.' 410 | ); 411 | 412 | $baseDir = basename(__DIR__); 413 | 414 | $this->addRequirement( 415 | is_writable(__DIR__.'/cache'), 416 | "$baseDir/cache/ directory must be writable", 417 | "Change the permissions of the \"$baseDir/cache/\" directory so that the web server can write into it." 418 | ); 419 | 420 | $this->addRequirement( 421 | is_writable(__DIR__.'/logs'), 422 | "$baseDir/logs/ directory must be writable", 423 | "Change the permissions of the \"$baseDir/logs/\" directory so that the web server can write into it." 424 | ); 425 | 426 | $this->addPhpIniRequirement( 427 | 'date.timezone', true, false, 428 | 'date.timezone setting must be set', 429 | 'Set the "date.timezone" setting in php.ini* (like Europe/Paris).' 430 | ); 431 | 432 | if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) { 433 | $timezones = array(); 434 | foreach (DateTimeZone::listAbbreviations() as $abbreviations) { 435 | foreach ($abbreviations as $abbreviation) { 436 | $timezones[$abbreviation['timezone_id']] = true; 437 | } 438 | } 439 | 440 | $this->addRequirement( 441 | isset($timezones[date_default_timezone_get()]), 442 | sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()), 443 | 'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.' 444 | ); 445 | } 446 | 447 | $this->addRequirement( 448 | function_exists('json_encode'), 449 | 'json_encode() must be available', 450 | 'Install and enable the JSON extension.' 451 | ); 452 | 453 | $this->addRequirement( 454 | function_exists('session_start'), 455 | 'session_start() must be available', 456 | 'Install and enable the session extension.' 457 | ); 458 | 459 | $this->addRequirement( 460 | function_exists('ctype_alpha'), 461 | 'ctype_alpha() must be available', 462 | 'Install and enable the ctype extension.' 463 | ); 464 | 465 | $this->addRequirement( 466 | function_exists('token_get_all'), 467 | 'token_get_all() must be available', 468 | 'Install and enable the Tokenizer extension.' 469 | ); 470 | 471 | $this->addRequirement( 472 | function_exists('simplexml_import_dom'), 473 | 'simplexml_import_dom() must be available', 474 | 'Install and enable the SimpleXML extension.' 475 | ); 476 | 477 | if (function_exists('apc_store') && ini_get('apc.enabled')) { 478 | if (version_compare($installedPhpVersion, '5.4.0', '>=')) { 479 | $this->addRequirement( 480 | version_compare(phpversion('apc'), '3.1.13', '>='), 481 | 'APC version must be at least 3.1.13 when using PHP 5.4', 482 | 'Upgrade your APC extension (3.1.13+).' 483 | ); 484 | } else { 485 | $this->addRequirement( 486 | version_compare(phpversion('apc'), '3.0.17', '>='), 487 | 'APC version must be at least 3.0.17', 488 | 'Upgrade your APC extension (3.0.17+).' 489 | ); 490 | } 491 | } 492 | 493 | $this->addPhpIniRequirement('detect_unicode', false); 494 | 495 | if (extension_loaded('suhosin')) { 496 | $this->addPhpIniRequirement( 497 | 'suhosin.executor.include.whitelist', 498 | create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'), 499 | false, 500 | 'suhosin.executor.include.whitelist must be configured correctly in php.ini', 501 | 'Add "phar" to suhosin.executor.include.whitelist in php.ini*.' 502 | ); 503 | } 504 | 505 | if (extension_loaded('xdebug')) { 506 | $this->addPhpIniRequirement( 507 | 'xdebug.show_exception_trace', false, true 508 | ); 509 | 510 | $this->addPhpIniRequirement( 511 | 'xdebug.scream', false, true 512 | ); 513 | 514 | $this->addPhpIniRecommendation( 515 | 'xdebug.max_nesting_level', 516 | create_function('$cfgValue', 'return $cfgValue > 100;'), 517 | true, 518 | 'xdebug.max_nesting_level should be above 100 in php.ini', 519 | 'Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.' 520 | ); 521 | } 522 | 523 | $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; 524 | 525 | $this->addRequirement( 526 | null !== $pcreVersion, 527 | 'PCRE extension must be available', 528 | 'Install the PCRE extension (version 8.0+).' 529 | ); 530 | 531 | /* optional recommendations follow */ 532 | 533 | $this->addRecommendation( 534 | file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'), 535 | 'Requirements file should be up-to-date', 536 | 'Your requirements file is outdated. Run composer install and re-check your configuration.' 537 | ); 538 | 539 | $this->addRecommendation( 540 | version_compare($installedPhpVersion, '5.3.4', '>='), 541 | 'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions', 542 | 'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.' 543 | ); 544 | 545 | $this->addRecommendation( 546 | version_compare($installedPhpVersion, '5.3.8', '>='), 547 | 'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156', 548 | 'Install PHP 5.3.8 or newer if your project uses annotations.' 549 | ); 550 | 551 | $this->addRecommendation( 552 | version_compare($installedPhpVersion, '5.4.0', '!='), 553 | 'You should not use PHP 5.4.0 due to the PHP bug #61453', 554 | 'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.' 555 | ); 556 | 557 | if (null !== $pcreVersion) { 558 | $this->addRecommendation( 559 | $pcreVersion >= 8.0, 560 | sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion), 561 | 'PCRE 8.0+ is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.' 562 | ); 563 | } 564 | 565 | $this->addRecommendation( 566 | class_exists('DomDocument'), 567 | 'PHP-XML module should be installed', 568 | 'Install and enable the PHP-XML module.' 569 | ); 570 | 571 | $this->addRecommendation( 572 | function_exists('mb_strlen'), 573 | 'mb_strlen() should be available', 574 | 'Install and enable the mbstring extension.' 575 | ); 576 | 577 | $this->addRecommendation( 578 | function_exists('iconv'), 579 | 'iconv() should be available', 580 | 'Install and enable the iconv extension.' 581 | ); 582 | 583 | $this->addRecommendation( 584 | function_exists('utf8_decode'), 585 | 'utf8_decode() should be available', 586 | 'Install and enable the XML extension.' 587 | ); 588 | 589 | if (!defined('PHP_WINDOWS_VERSION_BUILD')) { 590 | $this->addRecommendation( 591 | function_exists('posix_isatty'), 592 | 'posix_isatty() should be available', 593 | 'Install and enable the php_posix extension (used to colorize the CLI output).' 594 | ); 595 | } 596 | 597 | $this->addRecommendation( 598 | class_exists('Locale'), 599 | 'intl extension should be available', 600 | 'Install and enable the intl extension (used for validators).' 601 | ); 602 | 603 | if (class_exists('Collator')) { 604 | $this->addRecommendation( 605 | null !== new Collator('fr_FR'), 606 | 'intl extension should be correctly configured', 607 | 'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.' 608 | ); 609 | } 610 | 611 | if (class_exists('Locale')) { 612 | if (defined('INTL_ICU_VERSION')) { 613 | $version = INTL_ICU_VERSION; 614 | } else { 615 | $reflector = new ReflectionExtension('intl'); 616 | 617 | ob_start(); 618 | $reflector->info(); 619 | $output = strip_tags(ob_get_clean()); 620 | 621 | preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches); 622 | $version = $matches[1]; 623 | } 624 | 625 | $this->addRecommendation( 626 | version_compare($version, '4.0', '>='), 627 | 'intl ICU version should be at least 4+', 628 | 'Upgrade your intl extension with a newer ICU version (4+).' 629 | ); 630 | } 631 | 632 | $accelerator = 633 | (function_exists('apc_store') && ini_get('apc.enabled')) 634 | || 635 | function_exists('eaccelerator_put') && ini_get('eaccelerator.enable') 636 | || 637 | function_exists('xcache_set') 638 | ; 639 | 640 | $this->addRecommendation( 641 | $accelerator, 642 | 'a PHP accelerator should be installed', 643 | 'Install and enable a PHP accelerator like APC (highly recommended).' 644 | ); 645 | 646 | $this->addPhpIniRecommendation('short_open_tag', false); 647 | 648 | $this->addPhpIniRecommendation('magic_quotes_gpc', false, true); 649 | 650 | $this->addPhpIniRecommendation('register_globals', false, true); 651 | 652 | $this->addPhpIniRecommendation('session.auto_start', false); 653 | 654 | $this->addRecommendation( 655 | class_exists('PDO'), 656 | 'PDO should be installed', 657 | 'Install PDO (mandatory for Doctrine).' 658 | ); 659 | 660 | if (class_exists('PDO')) { 661 | $drivers = PDO::getAvailableDrivers(); 662 | $this->addRecommendation( 663 | count($drivers), 664 | sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'), 665 | 'Install PDO drivers (mandatory for Doctrine).' 666 | ); 667 | } 668 | } 669 | } 670 | -------------------------------------------------------------------------------- /app/autoload.php: -------------------------------------------------------------------------------- 1 | getPhpIniConfigPath(); 8 | 9 | echo "********************************\n"; 10 | echo "* *\n"; 11 | echo "* Symfony requirements check *\n"; 12 | echo "* *\n"; 13 | echo "********************************\n\n"; 14 | 15 | echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n"; 16 | 17 | echo "** ATTENTION **\n"; 18 | echo "* The PHP CLI can use a different php.ini file\n"; 19 | echo "* than the one used with your web server.\n"; 20 | if ('\\' == DIRECTORY_SEPARATOR) { 21 | echo "* (especially on the Windows platform)\n"; 22 | } 23 | echo "* To be on the safe side, please also launch the requirements check\n"; 24 | echo "* from your web server using the web/config.php script.\n"; 25 | 26 | echo_title('Mandatory requirements'); 27 | 28 | foreach ($symfonyRequirements->getRequirements() as $req) { 29 | echo_requirement($req); 30 | } 31 | 32 | echo_title('Optional recommendations'); 33 | 34 | foreach ($symfonyRequirements->getRecommendations() as $req) { 35 | echo_requirement($req); 36 | } 37 | 38 | /** 39 | * Prints a Requirement instance 40 | */ 41 | function echo_requirement(Requirement $requirement) 42 | { 43 | $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR'); 44 | echo ' ' . str_pad($result, 9); 45 | echo $requirement->getTestMessage() . "\n"; 46 | 47 | if (!$requirement->isFulfilled()) { 48 | echo sprintf(" %s\n\n", $requirement->getHelpText()); 49 | } 50 | } 51 | 52 | function echo_title($title) 53 | { 54 | echo "\n** $title **\n\n"; 55 | } 56 | -------------------------------------------------------------------------------- /app/config/config.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: parameters.yml } 3 | - { resource: security.yml } 4 | 5 | framework: 6 | #esi: ~ 7 | #translator: { fallback: %locale% } 8 | secret: %secret% 9 | router: 10 | resource: "%kernel.root_dir%/config/routing.yml" 11 | strict_requirements: %kernel.debug% 12 | form: ~ 13 | csrf_protection: ~ 14 | validation: { enable_annotations: true } 15 | templating: 16 | engines: ['twig'] 17 | #assets_version: SomeVersionScheme 18 | default_locale: "%locale%" 19 | trusted_proxies: ~ 20 | session: ~ 21 | fragments: ~ 22 | 23 | # Twig Configuration 24 | twig: 25 | debug: %kernel.debug% 26 | strict_variables: %kernel.debug% 27 | 28 | # Assetic Configuration 29 | assetic: 30 | debug: %kernel.debug% 31 | use_controller: false 32 | bundles: [ ] 33 | #java: /usr/bin/java 34 | filters: 35 | cssrewrite: ~ 36 | #closure: 37 | # jar: %kernel.root_dir%/Resources/java/compiler.jar 38 | #yui_css: 39 | # jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar 40 | 41 | # Doctrine Configuration 42 | doctrine: 43 | dbal: 44 | driver: %database_driver% 45 | host: %database_host% 46 | port: %database_port% 47 | dbname: %database_name% 48 | user: %database_user% 49 | password: %database_password% 50 | charset: UTF8 51 | # if using pdo_sqlite as your database driver, add the path in parameters.yml 52 | # e.g. database_path: %kernel.root_dir%/data/data.db3 53 | # path: %database_path% 54 | 55 | orm: 56 | auto_generate_proxy_classes: %kernel.debug% 57 | auto_mapping: true 58 | 59 | # Swiftmailer Configuration 60 | swiftmailer: 61 | transport: %mailer_transport% 62 | host: %mailer_host% 63 | username: %mailer_user% 64 | password: %mailer_password% 65 | spool: { type: memory } 66 | 67 | 68 | fos_rest: 69 | param_fetcher_listener: true 70 | view: 71 | view_response_listener: force 72 | 73 | sensio_framework_extra: 74 | view: { annotations: false } 75 | 76 | fos_user: 77 | db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel' 78 | firewall_name: main 79 | user_class: Twitter\DomainBundle\Entity\User 80 | 81 | -------------------------------------------------------------------------------- /app/config/config_dev.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | framework: 5 | router: { resource: "%kernel.root_dir%/config/routing_dev.yml" } 6 | profiler: { only_exceptions: false } 7 | 8 | web_profiler: 9 | toolbar: true 10 | intercept_redirects: false 11 | 12 | monolog: 13 | handlers: 14 | main: 15 | type: stream 16 | path: %kernel.logs_dir%/%kernel.environment%.log 17 | level: debug 18 | firephp: 19 | type: firephp 20 | level: info 21 | chromephp: 22 | type: chromephp 23 | level: info 24 | 25 | assetic: 26 | use_controller: true 27 | 28 | #swiftmailer: 29 | # delivery_address: me@example.com 30 | -------------------------------------------------------------------------------- /app/config/config_prod.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config.yml } 3 | 4 | # In production environment you should know that the parameters for URL generation 5 | # always pass the requirements. Otherwise it would break your link (or even site with 6 | # strict_requirements = true). So we can disable the requirements check completely for 7 | # enhanced performance with strict_requirements = null. 8 | framework: 9 | router: 10 | strict_requirements: null 11 | #validation: 12 | # cache: apc 13 | 14 | #doctrine: 15 | # orm: 16 | # metadata_cache_driver: apc 17 | # result_cache_driver: apc 18 | # query_cache_driver: apc 19 | 20 | monolog: 21 | handlers: 22 | main: 23 | type: fingers_crossed 24 | action_level: error 25 | handler: nested 26 | nested: 27 | type: stream 28 | path: %kernel.logs_dir%/%kernel.environment%.log 29 | level: debug 30 | -------------------------------------------------------------------------------- /app/config/config_test.yml: -------------------------------------------------------------------------------- 1 | imports: 2 | - { resource: config_dev.yml } 3 | 4 | framework: 5 | test: ~ 6 | session: 7 | storage_id: session.storage.mock_file 8 | profiler: 9 | enabled: false 10 | 11 | web_profiler: 12 | toolbar: false 13 | intercept_redirects: false 14 | 15 | swiftmailer: 16 | disable_delivery: true 17 | -------------------------------------------------------------------------------- /app/config/parameters.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | database_driver: pdo_mysql 3 | database_host: 127.0.0.1 4 | database_port: ~ 5 | database_name: sf-rest-api 6 | database_user: root 7 | database_password: root 8 | 9 | mailer_transport: smtp 10 | mailer_host: 127.0.0.1 11 | mailer_user: ~ 12 | mailer_password: ~ 13 | 14 | locale: en 15 | secret: ThisTokenIsNotSoSecretChangeIt 16 | -------------------------------------------------------------------------------- /app/config/routing.yml: -------------------------------------------------------------------------------- 1 | fos_user_security: 2 | resource: "@FOSUserBundle/Resources/config/routing/security.xml" 3 | prefix: / 4 | 5 | twitter_api: 6 | resource: "@TwitterApiBundle/Resources/config/routing.yml" 7 | prefix: /api/v0 8 | 9 | -------------------------------------------------------------------------------- /app/config/routing_dev.yml: -------------------------------------------------------------------------------- 1 | _wdt: 2 | resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml" 3 | prefix: /_wdt 4 | 5 | _profiler: 6 | resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml" 7 | prefix: /_profiler 8 | 9 | _configurator: 10 | resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml" 11 | prefix: /_configurator 12 | 13 | _main: 14 | resource: routing.yml 15 | 16 | NelmioApiDocBundle: 17 | resource: "@NelmioApiDocBundle/Resources/config/routing.yml" 18 | prefix: /api/doc 19 | -------------------------------------------------------------------------------- /app/config/security.yml: -------------------------------------------------------------------------------- 1 | jms_security_extra: 2 | secure_all_services: false 3 | expressions: true 4 | 5 | security: 6 | encoders: 7 | Symfony\Component\Security\Core\User\User: plaintext 8 | 9 | role_hierarchy: 10 | ROLE_ADMIN: ROLE_USER 11 | ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] 12 | 13 | providers: 14 | fos_userbundle: 15 | id: fos_user.user_provider.username 16 | in_memory: 17 | memory: 18 | users: 19 | user: { password: userpass, roles: [ 'ROLE_USER' ] } 20 | admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] } 21 | 22 | encoders: 23 | FOS\UserBundle\Model\UserInterface: sha512 24 | 25 | firewalls: 26 | dev: 27 | pattern: ^/(_(profiler|wdt)|css|images|js)/ 28 | security: false 29 | 30 | login: 31 | pattern: ^/demo/secured/login$ 32 | security: false 33 | 34 | main: 35 | pattern: ^/ 36 | form_login: 37 | provider: fos_userbundle 38 | csrf_provider: form.csrf_provider 39 | login_path: /login 40 | check_path: /login_check 41 | logout: true 42 | anonymous: true 43 | remember_me: 44 | key: "%secret%" 45 | lifetime: 31536000 # 365 days in seconds 46 | path: / 47 | domain: ~ # Defaults to the current domain from $_SERVER 48 | 49 | access_control: 50 | #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https } 51 | -------------------------------------------------------------------------------- /app/console: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev'); 18 | $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod'; 19 | 20 | $kernel = new AppKernel($env, $debug); 21 | $application = new Application($kernel); 22 | $application->run($input); 23 | -------------------------------------------------------------------------------- /app/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 17 | 18 | ../src/*/*Bundle/Tests 19 | ../src/*/Bundle/*Bundle/Tests 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | ../src 32 | 33 | ../src/*/*Bundle/Resources 34 | ../src/*/*Bundle/Tests 35 | ../src/*/Bundle/*Bundle/Resources 36 | ../src/*/Bundle/*Bundle/Tests 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/serializer/FOSUserBundle/Model.User.yml: -------------------------------------------------------------------------------- 1 | FOS\UserBundle\Model\User: 2 | exclusion_policy: ALL 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/framework-standard-edition", 3 | "description": "The \"Symfony Standard Edition\" distribution", 4 | "autoload": { 5 | "psr-0": { "": "src/" } 6 | }, 7 | "require": { 8 | "php": ">=5.3.3", 9 | "symfony/symfony": "2.2.*", 10 | "doctrine/orm": "~2.2,>=2.2.3", 11 | "doctrine/doctrine-bundle": "1.2.*", 12 | "twig/extensions": "1.0.*", 13 | "symfony/assetic-bundle": "2.1.*", 14 | "symfony/swiftmailer-bundle": "2.2.*", 15 | "symfony/monolog-bundle": "2.2.*", 16 | "sensio/distribution-bundle": "2.2.*", 17 | "sensio/framework-extra-bundle": "2.2.*", 18 | "sensio/generator-bundle": "2.2.*", 19 | "jms/security-extra-bundle": "1.4.*", 20 | "jms/di-extra-bundle": "1.3.*", 21 | "friendsofsymfony/rest-bundle": "0.11.0", 22 | "jms/serializer-bundle": "0.11.x", 23 | "friendsofsymfony/user-bundle": "2.0.*@dev" 24 | }, 25 | "require-dev": { 26 | "nelmio/api-doc-bundle": "2.1.x@dev" 27 | }, 28 | "scripts": { 29 | "post-install-cmd": [ 30 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 31 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 32 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 33 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 34 | ], 35 | "post-update-cmd": [ 36 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 37 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 38 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 39 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" 40 | ] 41 | }, 42 | "config": { 43 | "bin-dir": "bin" 44 | }, 45 | "minimum-stability": "alpha", 46 | "extra": { 47 | "symfony-app-dir": "app", 48 | "symfony-web-dir": "web", 49 | "branch-alias": { 50 | "dev-master": "2.2-dev" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Controller/ApiController.php: -------------------------------------------------------------------------------- 1 | getDoctrine()->getEntityManager(); 15 | } 16 | 17 | protected function deserialize($class, Request $request, $format = 'json') 18 | { 19 | $serializer = $this->get('serializer'); 20 | $validator = $this->get('validator'); 21 | 22 | try { 23 | $entity = $serializer->deserialize($request->getContent(), $class, $format); 24 | } catch (RuntimeException $e) { 25 | throw new HttpException(400, $e->getMessage()); 26 | } 27 | 28 | if (count($errors = $validator->validate($entity))) { 29 | return $errors; 30 | } 31 | 32 | return $entity; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Controller/TweetController.php: -------------------------------------------------------------------------------- 1 | $tweet); 40 | } 41 | 42 | /** 43 | * Post a Tweet 44 | * 45 | * **Request Format** 46 | * 47 | * { 48 | * "content": "an example tweet" 49 | * } 50 | * 51 | * **Response Headers** 52 | * 53 | * Location: http://example.com/api/tweets/4 54 | * 55 | * @ApiDoc( 56 | * section="Tweets", 57 | * statusCodes={ 58 | * 201="Created", 59 | * 400="Invalid input" 60 | * } 61 | * ) 62 | */ 63 | public function postAction(Request $request) 64 | { 65 | $tweet = $this->deserialize('Twitter\DomainBundle\Entity\Tweet', $request); 66 | 67 | if ($tweet instanceof Tweet === false) { 68 | return View::create(array('errors' => $tweet), 400); 69 | } 70 | 71 | $tweet->setUser($this->getUser()); 72 | 73 | $em = $this->getEntityManager(); 74 | $em->persist($tweet); 75 | $em->flush(); 76 | 77 | $url = $this->generateUrl( 78 | 'tweet_get', 79 | array('id' => $tweet->getId()), 80 | true 81 | ); 82 | 83 | $response = new Response(); 84 | $response->setStatusCode(201); 85 | $response->headers->set('Location', $url); 86 | 87 | return $response; 88 | } 89 | 90 | /** 91 | * Update a Tweet 92 | * 93 | * **Request Format** 94 | * 95 | * { 96 | * "content": "an example tweet" 97 | * } 98 | * 99 | * **Response Format** 100 | * 101 | * { 102 | * "tweet": { 103 | * "username": "sgordalina", 104 | * "content": "an example tweet", 105 | * "created_at": "2013-04-11T20:00:00+0000" 106 | * } 107 | * } 108 | * 109 | * @ApiDoc( 110 | * section="Tweets", 111 | * statusCode={ 112 | * 200="Updated", 113 | * 400="Invalid input", 114 | * 403="Forbidden" 115 | * } 116 | * ) 117 | */ 118 | public function putAction(Tweet $tweet, Request $request) 119 | { 120 | if ($this->getUser() !== $tweet->getUser()) { 121 | throw new HttpException(403, 'Forbidden'); 122 | } 123 | $newTweet = $this->deserialize('Twitter\DomainBundle\Entity\Tweet', $request); 124 | 125 | if ($newTweet instanceof Tweet === false) { 126 | return View::create(array('errors' => $newTweet), 400); 127 | } 128 | 129 | $tweet->merge($newTweet); 130 | $this->getEntityManager()->flush(); 131 | 132 | return array('tweet' => $tweet); 133 | } 134 | 135 | /** 136 | * Delete a Tweet 137 | * 138 | * @ApiDoc( 139 | * section="Tweets", 140 | * statusCodes={ 141 | * 204="Deleted", 142 | * 403="Forbidden" 143 | * } 144 | * ) 145 | * @RestView(statusCode=204) 146 | */ 147 | public function deleteAction(Tweet $tweet) 148 | { 149 | if ($this->getUser() !== $tweet->getUser()) { 150 | throw new HttpException(403, 'Forbidden'); 151 | } 152 | 153 | $em = $this->getEntityManager(); 154 | $em->remove($tweet); 155 | $em->flush(); 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Controller/UserController.php: -------------------------------------------------------------------------------- 1 | $user); 36 | } 37 | /** 38 | * Get Tweets by user 39 | * 40 | * **Response Format** 41 | * 42 | * { 43 | * "tweets": [ 44 | * { 45 | * "username": "sgordalina", 46 | * "content": "an example tweet", 47 | * "created_at": "2013-04-11T20:00:00+0000" 48 | * } 49 | * ] 50 | * } 51 | * 52 | * @ApiDoc( 53 | * section="User" 54 | * ) 55 | */ 56 | public function getTweetsAction(User $user) 57 | { 58 | return array('tweets' => $user->getTweets()); 59 | } 60 | 61 | /** 62 | * Get user's followers 63 | * 64 | * **Response Format** 65 | * 66 | * { 67 | * "followers": [ 68 | * { 69 | * "username": "sgordalina", 70 | * } 71 | * ] 72 | * } 73 | * 74 | * @ApiDoc( 75 | * section="User" 76 | * ) 77 | */ 78 | public function getFollowersAction(User $user) 79 | { 80 | return array('followers' => $user->getFollowers()); 81 | } 82 | 83 | /** 84 | * Get users following by user 85 | * 86 | * **Response Format** 87 | * 88 | * { 89 | * "following": [ 90 | * { 91 | * "username": "sgordalina", 92 | * } 93 | * ] 94 | * } 95 | * 96 | * @ApiDoc( 97 | * section="User" 98 | * ) 99 | */ 100 | public function getFollowingAction(User $user) 101 | { 102 | return array('following' => $user->getFollowing()); 103 | } 104 | 105 | /** 106 | * Get own tweets timeline 107 | * 108 | * **Response Format** 109 | * 110 | * { 111 | * "tweets": [ 112 | * { 113 | * "username": "sgordalina", 114 | * "content": "an example tweet", 115 | * "created_at": "2013-04-11T20:00:00+0000" 116 | * } 117 | * ] 118 | * } 119 | * 120 | * @ApiDoc( 121 | * section="User Bound" 122 | * ) 123 | */ 124 | public function getTimelineAction() 125 | { 126 | $timeline = $this->getEntityManager() 127 | ->getRepository('TwitterDomainBundle:User') 128 | ->getTimeline($this->getUser()); 129 | 130 | return array('tweets' => $timeline); 131 | } 132 | 133 | /** 134 | * Register as a user in the application 135 | * 136 | * **Request Format** 137 | * 138 | * { 139 | * "username": "sgordalina", 140 | * "email": "samuel.gordalina@gmail.com", 141 | * "password": "sample-password" 142 | * } 143 | * 144 | * **Response Headers** 145 | * 146 | * Location: http://example.com/api/v1/sgordalina 147 | * 148 | * @ApiDoc( 149 | * section="Authorization", 150 | * statusCodes={ 151 | * 201="Created", 152 | * 400="Invalid input", 153 | * 409="Username already taken" 154 | * } 155 | * ) 156 | */ 157 | public function registerAction(Request $request) 158 | { 159 | $registration = $this->deserialize('Twitter\ApiBundle\Form\Registration', $request); 160 | 161 | if ($registration instanceof Registration === false) { 162 | return View::create(array('errors' => $registration), 400); 163 | } 164 | 165 | $user = $registration->getUser(); 166 | $userManager = $this->get('fos_user.user_manager'); 167 | $exists = $userManager->findUserBy(array('username' => $user->getUsername())); 168 | 169 | if ($exists instanceof User) { 170 | throw new HttpException(409, 'Username already taken'); 171 | } 172 | 173 | $userManager->updateUser($user); 174 | 175 | $url = $this->generateUrl( 176 | 'user_get', 177 | array('username' => $user->getUsername()), 178 | true 179 | ); 180 | 181 | $response = new Response(); 182 | $response->setStatusCode(201); 183 | $response->headers->set('Location', $url); 184 | 185 | return $response; 186 | } 187 | /** 188 | * Follow a user 189 | * 190 | * @ApiDoc( 191 | * section="User Bound", 192 | * statusCodes={ 193 | * 204="User followed", 194 | * 409="Already following user" 195 | * } 196 | * ) 197 | * @RestView(statusCode="204") 198 | */ 199 | public function followAction(User $user) 200 | { 201 | $me = $this->getUser(); 202 | 203 | if ($me->isFollowing($user)) { 204 | throw new HttpException(409, 'Already following user'); 205 | } 206 | 207 | $me->followUser($user); 208 | 209 | $this->getEntityManager()->flush(); 210 | } 211 | 212 | /** 213 | * Unfollow a user 214 | * 215 | * @ApiDoc( 216 | * section="User Bound", 217 | * statusCodes={ 218 | * 204="User followed", 219 | * 409="Not following user" 220 | * } 221 | * ) 222 | * @RestView(statusCode="204") 223 | */ 224 | public function unfollowAction(User $user) 225 | { 226 | $me = $this->getUser(); 227 | 228 | if (!$me->isFollowing($user)) { 229 | throw new HttpException(409, 'Not following user'); 230 | } 231 | 232 | $me->unfollowUser($user); 233 | 234 | $this->getEntityManager()->flush(); 235 | } 236 | } 237 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('twitter_api'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/DependencyInjection/TwitterApiExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.xml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/EventListener/LinkRequestListener.php: -------------------------------------------------------------------------------- 1 | httpKernel = $httpKernel; 44 | $this->eventDispatcher = $eventDispatcher; 45 | $this->resolver = $controllerResolver; 46 | $this->urlMatcher = $urlMatcher; 47 | } 48 | 49 | /** 50 | * @param FilterControllerEvent $event A FilterControllerEvent instance 51 | */ 52 | public function onKernelController(FilterControllerEvent $event) 53 | { 54 | if (!$event->getRequest()->headers->has('link')) { 55 | return; 56 | } 57 | 58 | $links = array(); 59 | $header = $event->getRequest()->headers->get('link'); 60 | 61 | /* 62 | * Due to limitations, multiple same-name headers are sent as comma 63 | * separated values. 64 | * 65 | * This breaks those headers into Link headers following the format 66 | * http://tools.ietf.org/html/rfc2068#section-19.6.2.4 67 | */ 68 | while (preg_match('/^((?:[^"]|"[^"]*")*?),/', $header, $matches)) { 69 | $header = trim(substr($header, strlen($matches[0]))); 70 | $links[] = $matches[1]; 71 | } 72 | 73 | if ($header) { 74 | $links[] = $header; 75 | } 76 | 77 | $requestMethod = $this->urlMatcher->getContext()->getMethod(); 78 | // Force the GET method to avoid the use of the 79 | // previous method (LINK/UNLINK) 80 | $this->urlMatcher->getContext()->setMethod('GET'); 81 | 82 | // The controller resolver needs a request to resolve the controller. 83 | $stubRequest = new Request(); 84 | 85 | foreach ($links as $idx => $link) { 86 | $linkParams = explode(';', trim($link)); 87 | $resource = array_shift($linkParams); 88 | $resource = preg_replace('/<|>/', '', $resource); 89 | 90 | if (preg_match('#^/|https?://#', $resource) === 0) { 91 | $resource = '/' . $resource; 92 | } 93 | 94 | try { 95 | $route = $this->urlMatcher->match($resource); 96 | } catch (\Exception $e) { 97 | // If we don't have a matching route we return 98 | // the original Link header 99 | continue; 100 | } 101 | 102 | $stubRequest->attributes->replace($route); 103 | 104 | if (false === $controller = $this->resolver->getController($stubRequest)) { 105 | continue; 106 | } 107 | 108 | try { 109 | $stubEvent = new FilterControllerEvent($this->httpKernel, $controller, $stubRequest, HttpKernelInterface::SUB_REQUEST); 110 | $this->eventDispatcher->dispatch(KernelEvents::CONTROLLER, $stubEvent); 111 | 112 | $arguments = $this->resolver->getArguments($stubRequest, $controller); 113 | 114 | $result = call_user_func_array($controller, $arguments); 115 | 116 | // By convention the controller action must return an array 117 | if (!is_array($result)) { 118 | continue; 119 | } 120 | 121 | // The key of first item is discarded 122 | $links[$idx] = current($result); 123 | } catch (\Exception $e) { 124 | continue; 125 | } 126 | } 127 | 128 | $event->getRequest()->attributes->set('link', $links); 129 | $this->urlMatcher->getContext()->setMethod($requestMethod); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Form/Registration.php: -------------------------------------------------------------------------------- 1 | setUsername($this->username); 38 | $user->setEmail($this->email); 39 | $user->setPassword($this->password); 40 | $user->setEnabled(true); 41 | 42 | return $user; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Resources/config/routing.yml: -------------------------------------------------------------------------------- 1 | tweet_get: 2 | pattern: /tweets/{id} 3 | defaults: { _controller: TwitterApiBundle:Tweet:get, _format: json } 4 | methods: GET 5 | requirements: 6 | id: \d+ 7 | 8 | tweet_post: 9 | pattern: /tweets 10 | defaults: { _controller: TwitterApiBundle:Tweet:post, _format: json } 11 | methods: POST 12 | 13 | tweet_put: 14 | pattern: /tweets/{id} 15 | defaults: { _controller: TwitterApiBundle:Tweet:put, _format: json } 16 | methods: PUT 17 | requirements: 18 | id: \d+ 19 | 20 | tweet_delete: 21 | pattern: /tweets/{id} 22 | defaults: { _controller: TwitterApiBundle:Tweet:delete, _format: json } 23 | methods: DELETE 24 | requirements: 25 | id: \d+ 26 | 27 | user_get: 28 | pattern: /{username} 29 | defaults: { _controller: TwitterApiBundle:User:get, _format: json } 30 | methods: GET 31 | requirements: 32 | username: "[-a-zA-Z0-9]+" 33 | 34 | user_register: 35 | pattern: /register 36 | defaults: { _controller: TwitterApiBundle:User:register, _format: json } 37 | methods: POST 38 | 39 | user_get_tweets: 40 | pattern: /{username}/tweets 41 | defaults: { _controller: TwitterApiBundle:User:getTweets, _format: json } 42 | methods: GET 43 | 44 | 45 | user_follow: 46 | pattern: /{username}/followers 47 | defaults: { _controller: TwitterApiBundle:User:follow, _format: json } 48 | methods: POST 49 | 50 | user_unfollow: 51 | pattern: /{username}/followers 52 | defaults: { _controller: TwitterApiBundle:User:unfollow, _format: json } 53 | methods: DELETE 54 | 55 | 56 | user_get_followers: 57 | pattern: /{username}/followers 58 | defaults: { _controller: TwitterApiBundle:User:getFollowers, _format: json } 59 | methods: GET 60 | 61 | user_get_following: 62 | pattern: /{username}/following 63 | defaults: { _controller: TwitterApiBundle:User:getFollowing, _format: json } 64 | methods: GET 65 | 66 | 67 | user_get_timeline: 68 | pattern: / 69 | defaults: { _controller: TwitterApiBundle:User:getTimeline, _format: json } 70 | methods: GET 71 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Resources/config/services.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Resources/doc/index.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordalina/sample-twitter-api-symfony2/6c4de1a5e973fa3521a4cf0b2009c882f1404a4d/src/Twitter/ApiBundle/Resources/doc/index.rst -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/hello/Fabien'); 14 | 15 | $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/Tests/Controller/TweetControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/tweets/{id}'); 14 | } 15 | 16 | public function testPost() 17 | { 18 | $client = static::createClient(); 19 | 20 | $crawler = $client->request('GET', '/tweets/{id}'); 21 | } 22 | 23 | public function testDelete() 24 | { 25 | $client = static::createClient(); 26 | 27 | $crawler = $client->request('GET', '/tweets/{id}'); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Twitter/ApiBundle/TwitterApiBundle.php: -------------------------------------------------------------------------------- 1 | render('TwitterDomainBundle:Default:index.html.twig', array('name' => $name)); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('twitter_domain'); 22 | 23 | // Here you should define the parameters that are allowed to 24 | // configure your bundle. See the documentation linked above for 25 | // more information on that topic. 26 | 27 | return $treeBuilder; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/DependencyInjection/TwitterDomainExtension.php: -------------------------------------------------------------------------------- 1 | processConfiguration($configuration, $configs); 24 | 25 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 26 | $loader->load('services.yml'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Entity/Tweet.php: -------------------------------------------------------------------------------- 1 | __wakeup(); 68 | } 69 | 70 | public function __wakeup() 71 | { 72 | $this->createdAt = new \DateTime(); 73 | } 74 | 75 | public function getUsername() 76 | { 77 | return $this->user->getUsername(); 78 | } 79 | 80 | /** 81 | * Get id 82 | * 83 | * @return integer 84 | */ 85 | public function getId() 86 | { 87 | return $this->id; 88 | } 89 | 90 | /** 91 | * Set content 92 | * 93 | * @param string $content 94 | * @return Tweet 95 | */ 96 | public function setContent($content) 97 | { 98 | $this->content = $content; 99 | 100 | return $this; 101 | } 102 | 103 | /** 104 | * Get content 105 | * 106 | * @return string 107 | */ 108 | public function getContent() 109 | { 110 | return $this->content; 111 | } 112 | 113 | /** 114 | * Set createdAt 115 | * 116 | * @param \DateTime $createdAt 117 | * @return Tweet 118 | */ 119 | public function setCreatedAt($createdAt) 120 | { 121 | $this->createdAt = $createdAt; 122 | 123 | return $this; 124 | } 125 | 126 | /** 127 | * Get createdAt 128 | * 129 | * @return \DateTime 130 | */ 131 | public function getCreatedAt() 132 | { 133 | return $this->createdAt; 134 | } 135 | 136 | public function merge(Tweet $tweet) 137 | { 138 | $this->content = $tweet->content; 139 | } 140 | public function setUser(User $user) 141 | { 142 | $this->user = $user; 143 | $this->user->addTweet($this); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Entity/TweetRepository.php: -------------------------------------------------------------------------------- 1 | id; 75 | } 76 | 77 | public function addTweet(Tweet $tweet) 78 | { 79 | $this->tweets->add($tweet); 80 | } 81 | 82 | public function removeTweet(Tweet $tweet) 83 | { 84 | $this->tweets->removeElement($tweet); 85 | } 86 | 87 | public function getTweets() 88 | { 89 | return $this->tweets; 90 | } 91 | 92 | public function followUser(User $user) 93 | { 94 | $this->following->add($user); 95 | $user->followers->add($this); 96 | } 97 | 98 | public function unfollowUser(User $user) 99 | { 100 | $this->following->removeElement($user); 101 | $user->followers->removeElement($this); 102 | } 103 | 104 | public function isFollowing(User $user) 105 | { 106 | return $this->following->contains($user); 107 | } 108 | 109 | public function getFollowers() 110 | { 111 | return $this->followers; 112 | } 113 | 114 | public function getFollowing() 115 | { 116 | return $this->following; 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Entity/UserRepository.php: -------------------------------------------------------------------------------- 1 | _em->createQuery(' 18 | SELECT 19 | tweet 20 | FROM 21 | TwitterDomainBundle:Tweet tweet 22 | JOIN tweet.user author 23 | WHERE author.id IN ( 24 | SELECT 25 | follower.id 26 | FROM 27 | TwitterDomainBundle:User me 28 | JOIN me.following follower 29 | WHERE 30 | me.id = :id 31 | ) 32 | ORDER BY 33 | tweet.id DESC') 34 | ->setParameter('id', $user->getId()) 35 | ->getResult(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Resources/config/routing.yml: -------------------------------------------------------------------------------- 1 | twitter_domain_homepage: 2 | pattern: /hello/{name} 3 | defaults: { _controller: TwitterDomainBundle:Default:index } 4 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | # twitter_domain.example.class: Twitter\DomainBundle\Example 3 | 4 | services: 5 | # twitter_domain.example: 6 | # class: %twitter_domain.example.class% 7 | # arguments: [@service_id, "plain_value", %parameter%] 8 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Resources/doc/index.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordalina/sample-twitter-api-symfony2/6c4de1a5e973fa3521a4cf0b2009c882f1404a4d/src/Twitter/DomainBundle/Resources/doc/index.rst -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Resources/translations/messages.fr.xlf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Symfony2 is great 7 | J'aime Symfony2 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Resources/views/Default/index.html.twig: -------------------------------------------------------------------------------- 1 | Hello {{ name }}! 2 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/Tests/Controller/DefaultControllerTest.php: -------------------------------------------------------------------------------- 1 | request('GET', '/hello/Fabien'); 14 | 15 | $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Twitter/DomainBundle/TwitterDomainBundle.php: -------------------------------------------------------------------------------- 1 | 9 | RewriteEngine On 10 | 11 | # Redirect to URI without front controller to prevent duplicate content 12 | # (with and without `/app.php`). Only do this redirect on the initial 13 | # rewrite by Apache and not on subsequent cycles. Otherwise we would get an 14 | # endless redirect loop (request -> rewrite to front controller -> 15 | # redirect -> request -> ...). 16 | # So in case you get a "too many redirects" error or you always get redirected 17 | # to the startpage because your Apache does not expose the REDIRECT_STATUS 18 | # environment variable, you have 2 choices: 19 | # - disable this feature by commenting the following 2 lines or 20 | # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the 21 | # following RewriteCond (best solution) 22 | RewriteCond %{ENV:REDIRECT_STATUS} ^$ 23 | RewriteRule ^app\.php(/(.*)|$) %{CONTEXT_PREFIX}/$2 [R=301,L] 24 | 25 | # If the requested filename exists, simply serve it. 26 | # We only want to let Apache serve files and not directories. 27 | RewriteCond %{REQUEST_FILENAME} -f 28 | RewriteRule .? - [L] 29 | 30 | # The following rewrites all other queries to the front controller. The 31 | # condition ensures that if you are using Apache aliases to do mass virtual 32 | # hosting, the base path will be prepended to allow proper resolution of the 33 | # app.php file; it will work in non-aliased environments as well, providing 34 | # a safe, one-size fits all solution. 35 | RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$ 36 | RewriteRule ^(.*) - [E=BASE:%1] 37 | RewriteRule .? %{ENV:BASE}app.php [L] 38 | 39 | 40 | 41 | 42 | # When mod_rewrite is not available, we instruct a temporary redirect of 43 | # the startpage to the front controller explicitly so that the website 44 | # and the generated links can still be used. 45 | RedirectMatch 302 ^/$ /app.php/ 46 | # RedirectTemp cannot be used instead 47 | 48 | 49 | -------------------------------------------------------------------------------- /web/app.php: -------------------------------------------------------------------------------- 1 | register(true); 14 | */ 15 | 16 | require_once __DIR__.'/../app/AppKernel.php'; 17 | //require_once __DIR__.'/../app/AppCache.php'; 18 | 19 | $kernel = new AppKernel('prod', false); 20 | $kernel->loadClassCache(); 21 | //$kernel = new AppCache($kernel); 22 | Request::enableHttpMethodParameterOverride(); 23 | $request = Request::createFromGlobals(); 24 | $response = $kernel->handle($request); 25 | $response->send(); 26 | $kernel->terminate($request, $response); 27 | -------------------------------------------------------------------------------- /web/app_dev.php: -------------------------------------------------------------------------------- 1 | loadClassCache(); 24 | Request::enableHttpMethodParameterOverride(); 25 | $request = Request::createFromGlobals(); 26 | $response = $kernel->handle($request); 27 | $response->send(); 28 | $kernel->terminate($request, $response); 29 | -------------------------------------------------------------------------------- /web/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordalina/sample-twitter-api-symfony2/6c4de1a5e973fa3521a4cf0b2009c882f1404a4d/web/apple-touch-icon.png -------------------------------------------------------------------------------- /web/config.php: -------------------------------------------------------------------------------- 1 | getFailedRequirements(); 20 | $minorProblems = $symfonyRequirements->getFailedRecommendations(); 21 | 22 | ?> 23 | 24 | 25 | 26 | 27 | 28 | Symfony Configuration 29 | 30 | 31 | 32 | 33 | 34 |
35 |
36 | 39 | 40 | 60 |
61 | 62 |
63 |
64 |
65 |

Welcome!

66 |

Welcome to your new Symfony project.

67 |

68 | This script will guide you through the basic configuration of your project. 69 | You can also do the same by editing the ‘app/config/parameters.yml’ file directly. 70 |

71 | 72 | 73 |

Major problems

74 |

Major problems have been detected and must be fixed before continuing:

75 |
    76 | 77 |
  1. getHelpHtml() ?>
  2. 78 | 79 |
80 | 81 | 82 | 83 |

Recommendations

84 |

85 | Additionally, toTo enhance your Symfony experience, 86 | it’s recommended that you fix the following: 87 |

88 |
    89 | 90 |
  1. getHelpHtml() ?>
  2. 91 | 92 |
93 | 94 | 95 | hasPhpIniConfigIssue()): ?> 96 |

* 97 | getPhpIniConfigPath()): ?> 98 | Changes to the php.ini file must be done in "getPhpIniConfigPath() ?>". 99 | 100 | To change settings, create a "php.ini". 101 | 102 |

103 | 104 | 105 | 106 |

Your configuration looks good to run Symfony.

107 | 108 | 109 | 118 |
119 |
120 |
121 |
Symfony Standard Edition
122 |
123 | 124 | 125 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gordalina/sample-twitter-api-symfony2/6c4de1a5e973fa3521a4cf0b2009c882f1404a4d/web/favicon.ico -------------------------------------------------------------------------------- /web/robots.txt: -------------------------------------------------------------------------------- 1 | # www.robotstxt.org/ 2 | # www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449 3 | 4 | User-agent: * 5 | --------------------------------------------------------------------------------